felipec / git

Fork of Junio Hamano's git for users
Other
204 stars 34 forks source link

remote-bzr: Conversion of Emacs repository fails #32

Closed dengste closed 11 years ago

dengste commented 11 years ago

I'm using latest git-remote-bzr (8161a8479d) to access the Emacs bzr repository (locally on disk, cloned from bzr://bzr.savannah.gnu.org/emacs/trunk/). When I try to convert the Emacs repository to git, I get the following backtrace after a few minutes:

Traceback (most recent call last):
  File "/home/void/bin/git-remote-bzr", line 755, in <module>
    sys.exit(main(sys.argv))
  File "/home/void/bin/git-remote-bzr", line 744, in main
    do_list(parser)
  File "/home/void/bin/git-remote-bzr", line 672, in do_list
    branch.revision_id_to_dotted_revno(revid)
  File "<string>", line 4, in revision_id_to_dotted_revno_read_locked
  File "/usr/lib/python2.7/site-packages/bzrlib/branch.py", line 399, in revision_id_to_dotted_revno
    return self._do_revision_id_to_dotted_revno(revision_id)
  File "/home/void/.bazaar/plugins/history_db/__init__.py", line 231, in _history_db_revision_id_to_dotted_revno
    revision_id_map = query.get_dotted_revnos([revision_id])
  File "/home/void/.bazaar/plugins/history_db/history_db.py", line 1385, in get_dotted_revnos
    % (rev_id,))
bzrlib.errors.BzrError: rev_id {cyd@stupidchicken.com-20090730011415-1ur84cd4r2dats1v} not in database
felipec commented 11 years ago

It works here. Which version of bazaar are you using?

dengste commented 11 years ago

bzr --version says:

Bazaar (bzr) 2.5.1 Python interpreter: /usr/bin/python2 2.7.4 Python standard library: /usr/lib/python2.7

felipec commented 11 years ago

Seems the problem is the history_db plugin. I've installed it and still can't reproduce the issue.

felipec commented 11 years ago

I think the bug is in the hsitory_db plugin, but you can try this:

index bd25e08..a19174a 100755
--- a/contrib/remote-helpers/git-remote-bzr
+++ b/contrib/remote-helpers/git-remote-bzr
@@ -670,7 +670,7 @@ def do_list(parser):
     for tag, revid in branch.tags.get_tag_dict().items():
         try:
             branch.revision_id_to_dotted_revno(revid)
-        except bzrlib.errors.NoSuchRevision:
+        except:
             continue
         if not ref_is_valid(tag):
             continue
dengste commented 11 years ago

Damn, I totally forgot about that plugin. I should've looked a bit more closely at the backtrace. I simply removed the plugin and now everything works. Sorry for the noise.