bzr-fastimport fails to incrementally re-import bzr-migration-docs from git

Bug #457287 reported by Miklos Vajna
This bug report is a duplicate of:  Bug #347729: new marks file format not supported. Edit Remove
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Bazaar Fast Import
New
Undecided
Unassigned

Bug Description

Here is a script to reproduce the issue I have:

http://frugalware.org/~vmiklos/files/bzr-fastimport-bug-sh

Here is the output of the script on my machine:

http://frugalware.org/~vmiklos/files/bzr-fastimport-bug-out

This is r253 from trunk and git version 1.6.5.

Let me know if you can't reproduce the issue and you need more info.

Thanks.

Revision history for this message
Yaroslav Halchenko (yarikoptic) wrote :
Download full text (4.0 KiB)

Was about to file a new bug report but finally found at least the one describing the same symptoms ;)

Preamble: I was using git-bzr script (here is my clone of its Ruby version http://github.com/yarikoptic/git-bzr) in the beginning of last year and it was working fine... Recently I've tried to incrementally upgrade few of git-bzr'ed repositories and updates failed with similar 'KeyError'...
Decided to give a try to Python version of the same script from Matthew Brett (http://github.com/matthew-brett/git-bzr/) where he also describes that push back into bzr didn't work -- decided to look finally WTF is happening and it immediately gave me a clue:

Ugly face of the bug is revealed with a dump of marks file within bzr:
{{{
$> cat test-git/.git/bzr-git/bzr-repo-bzr-map
format=1
tmp.0
1 <email address hidden>
}}}

Whenever KeyError would be: KeyError: ':1'

More interesting that upon subsequent fastimport (after you fix marks file and add that leading colon) it would add a new mark WITH colon at the beginning:

{{{
$> cat test-git/.git/bzr-git/bzr-repo-bzr-map
format=1
tmp.0
:1 <email address hidden>
:3 <email address hidden>
}}}

So, the problem is buried in handling marks during export, and actual history of modifications of that file is quite interesting (sorry for non-bzrish format, I know only git):

{{{
commit 682805c7a9890f09587be709e94fe3188a9f65f5
Author: Ian Clatworthy <email address hidden>
Date: Sun Aug 23 18:35:41 2009 +1000

    backout git-bzr fix as it was breaking fast-export

diff --git a/bzr_exporter.py b/bzr_exporter.py
index 6ce20a0..a1a46d1 100755
--- a/bzr_exporter.py
+++ b/bzr_exporter.py
@@ -244,7 +244,7 @@ class BzrFastExporter(object):
         # Print the commit
         git_ref = 'refs/heads/%s' % (git_branch,)
         mark = ncommits + 1
- self.revid_to_mark[revid] = ':' + str(mark)
+ self.revid_to_mark[revid] = mark
         file_cmds = self._get_filecommands(parent, revid)
         self.print_cmd(self._get_commit_command(git_ref, mark, revobj,
             file_cmds))

commit b554c8ab84b0fb2b2d624b8a73120a4236abd49b
Author: Gonéri Le Bouder <email address hidden>
Date: Fri Aug 21 16:47:35 2009 +0200

    really put ':' in the commit mark

diff --git a/bzr_exporter.py b/bzr_exporter.py
index 2685731..6ce20a0 100755
--- a/bzr_exporter.py
+++ b/bzr_exporter.py
@@ -244,7 +244,7 @@ class BzrFastExporter(object):
         # Print the commit
         git_ref = 'refs/heads/%s' % (git_branch,)
         mark = ncommits + 1
- self.revid_to_mark[revid] = str(mark)
+ self.revid_to_mark[revid] = ':' + str(mark)
         file_cmds = self._get_filecommands(parent, revid)
         self.print_cmd(self._get_commit_command(git_ref, mark, revobj,
             file_cmds))

commit 6596f1441ade6718094708434c40a47a87d60e55
Author: Gonéri Le Bouder <email address hidden>
Date: Wed Aug 19 14:11:40 2009 +0200

    add the missing ":" since revid_to_mark are "committish"

diff --git a/bzr_exporter.py b/bzr_exporter.py
index d7f3435..2685731 100755
--- a/bzr_exporter.py
+++ b/bzr_exporter.py
@@ -243,7 +243,8 @@ class B...

Read more...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.