[fastimport Patch / RFC] Add import/exporting of marks to bzr-fastimport

Pieter de Bie frimmirf at gmail.com
Wed Jun 4 21:38:23 BST 2008


Hi list,

Attached is a bundle (I hope I did this correct) with some changes to
bzr-fastimport that allow you to import and export revision marks. The
patch is rough because I'm not really into bzr-fastimport (or bazaar,
for that matter), though it does produce wanted results here ;)

If you use this patch, you can now do something like:

git fast-export --import-marks=git-map --export-marks=git-map HEAD |
bzr fast-import --import-marks=map --export-marks=map

If you keep the map files up to do date (that is, don't mess with
them), this will allow you to keep your bazaar repository up to date
with the latest changes in a git repository. The reverse way was
already possible, as both bzr-fast-export and git-fast-import support
the importing and exporting of marks.

Because of this bidirectionality, I kept the format of the mapfile the
same as what bzr-fast-export produces (as they otherwise can't read
each others map). This means that the file is almost the same, but not
quite, as the fastimport_idmap that is produced anyway.

There is some conflict between how bzr fast-import continues if an
idmap is found and the marks importing: If bzr fast-import encounters
an idmap, it skips all revisions that are found in that map, and then
continues importing. As with the above command old revisions won't be
exported, and thus also can't be skipped, I changed the code so that
an import command with --import-marks overrides the old idmap thing.

I don't really like the code as it is (though I do like the
functionality); part of it is duplicate with bzr-fast-export and part
of it is duplicate with the idmap thing. Perhaps someone with more
knowledge of the code can have a go at it?

A small example of how the git / bzr integration goes can be seen
here: http://pastie.textmate.org/private/jvcinnuwy76kekwp532g . I put
the git-bzr script online at http://frim.frim.nl/git-bzr.rb , though
it's really more a test than something useable.

- Pieter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: import_export.patch
Type: application/octet-stream
Size: 9169 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080604/a93c79d5/attachment.obj 


More information about the bazaar mailing list