Comments (7)
I'm investigating this issue, but in the latest code I'm getting a different error than what you reported in issue #35.
DEBUG: initializing
DEBUG: fetching remote 'origin' 'lp:~felipec/+junk/test'
Updating bzr branches
Cloning branch 'master'
Traceback (most recent call last):
File "/home/felipec/bin/git-remote-bzr", line 972, in <module>
sys.exit(main(sys.argv))
File "/home/felipec/bin/git-remote-bzr", line 952, in main
do_list(parser)
File "/home/felipec/bin/git-remote-bzr", line 771, in do_list
branch = get_remote_branch(master_branch)
File "/home/felipec/bin/git-remote-bzr", line 808, in get_remote_branch
branch = clone(branch_path, remote_branch)
File "/home/felipec/bin/git-remote-bzr", line 789, in clone
repo = bdir.find_repository()
File "/usr/lib/python2.7/site-packages/bzrlib/bzrdir.py", line 574, in find_repository
raise errors.NoRepositoryPresent(self)
bzrlib.errors.NoRepositoryPresent: No repository present: "file:///tmp/test-git/.git/bzr/origin/clone/master/"
fatal: Reading from helper 'git-remote-bzr' failed
from git.
Ah, the second time I do it I get the same error you reported.
from git.
This seems to do the trick:
--- a/contrib/remote-helpers/git-remote-bzr
+++ b/contrib/remote-helpers/git-remote-bzr
@@ -785,7 +785,10 @@ def do_list(parser):
print
def clone(path, remote_branch):
- bdir = bzrlib.bzrdir.BzrDir.create(path)
+ try:
+ bdir = bzrlib.bzrdir.BzrDir.create(path)
+ except bzrlib.errors.AlreadyControlDirError:
+ bdir = bzrlib.bzrdir.BzrDir.open(path)
repo = bdir.find_repository()
repo.fetch(remote_branch.repository)
return remote_branch.sprout(bdir, repository=repo)
@@ -860,6 +863,13 @@ def get_repo(url, alias):
clone_path = os.path.join(dirname, 'clone')
if not os.path.exists(clone_path):
os.mkdir(clone_path)
+ else:
+ # check and remove old organization
+ try:
+ bdir = bzrlib.bzrdir.BzrDir.open(clone_path)
+ bdir.destroy_repository()
+ except bzrlib.errors.NoRepositoryPresent:
+ pass
info('Updating bzr branches')
from git.
That diff fixes the problem with pulling in repos created with 1.8.2 but it seems to have broken pulling in the ones I cloned with the latest version, I get
DEBUG: initializing
DEBUG: fetching remote 'origin' 'http://code.bitlbee.org/bitlbee/'
Traceback (most recent call last):
File "/usr/lib/git-core/git-remote-bzr", line 982, in <module>
sys.exit(main(sys.argv))
File "/usr/lib/git-core/git-remote-bzr", line 952, in main
repo = get_repo(url, alias)
File "/usr/lib/git-core/git-remote-bzr", line 869, in get_repo
bdir = bzrlib.bzrdir.BzrDir.open(clone_path)
File "/usr/lib/python2.7/dist-packages/bzrlib/controldir.py", line 689, in open
_unsupported=_unsupported)
File "/usr/lib/python2.7/dist-packages/bzrlib/controldir.py", line 718, in open_from_transport
find_format, transport, redirected)
File "/usr/lib/python2.7/dist-packages/bzrlib/transport/__init__.py", line 1719, in do_catching_redirections
return action(transport)
File "/usr/lib/python2.7/dist-packages/bzrlib/controldir.py", line 706, in find_format
probers=probers)
File "/usr/lib/python2.7/dist-packages/bzrlib/controldir.py", line 1155, in find_format
raise errors.NotBranchError(path=transport.base)
bzrlib.errors.NotBranchError: Not a branch: "/home/ahktenzero/src/apps/bitlbee/.git/bzr/origin/clone/".
when I try to pull. If I remove the diff it works.
from git.
Right, then this in addition:
--- contrib/remote-helpers/git-remote-bzr 2013-05-13 19:19:07.308241475 -0500
+++ /home/felipec/bin/git-remote-bzr 2013-05-13 19:46:39.028285706 -0500
@@ -868,7 +868,7 @@
try:
bdir = bzrlib.bzrdir.BzrDir.open(clone_path)
bdir.destroy_repository()
- except bzrlib.errors.NoRepositoryPresent:
+ except (bzrlib.errors.NoRepositoryPresent, bzrlib.errors.NotBranchError):
pass
info('Updating bzr branches')
from git.
Thanks, that's fixed it.
from git.
All right, I pushed the fix 1aea34a.
from git.
Related Issues (20)
- Something is wrong with git-stage docs HOT 2
- Crash during push to Hg repo HOT 2
- planet bzr repos cannot be cloned HOT 6
- push failed when git branch is different than bzr branch name HOT 2
- Trying to Parse email as int. HOT 1
- Push to new launchpad branch using git-remote-bzr HOT 4
- Fatal error thrown by felipec-git on fast-import of Hg assets HOT 13
- bzrlib.errors.NoSuchFile error while cloning openobject-addons on Launchpad HOT 1
- Cannot push when using https authentication with git-remote-hg HOT 5
- git-remote-hg mysteriously fails HOT 2
- Cloning hg repo from Octave project crashes fast-import HOT 5
- rebase or merge latest git release HOT 2
- Git commits show up in the "draft" phase in BitBucket HOT 2
- Closed branches can cause synchronization issues after gc
- Link to git-remote-hg.py in the wiki is wrong HOT 2
- Worked for a while, now fetch fails with "mark not declared"
- Sorry, flubbed an enter key press... please delete.
- git-remote-hg doesn't fetch HOT 2
- Bookmarks on named branches HOT 1
- uses obsolete python2 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from git.