We were using bazaar-vcs for some years but decided to migrate to git because of some long standing annoying bugs and stopped development of bzr.
While using bazaar, we extensively used the "bug tracker metadata" feature of bazaar (http://doc.bazaar.canonical.com/bzr.dev/en/user-reference/bugs-help.html). So every bug-fix commit included the ID to the corresponding mantis-bug-Id so that we have the link between source and mantis.
Our commit-message does not include the mantis-id, we only used the "metadata-feature":
It is very important for us that we don`t loose these informations so I need a solution for migrating this bug-links in some form.
I already tried to export/import our bazaar repository into git using the fast-import/fast-export commands:
bzr fast-export --no-plain --rewrite-tag-names /var/www/source_branch/ | git fast-import
Unfortunately I get the following error:
fatal: This version of fast-import does not support feature commit-properties.
However, if I use the option --plain instead of --no-plain the import works, but we lose all connections to our bugs.
Is there some solution/workaround for migrating from bzr to git without loosing all these bug-links which are so important for us?
[Edit]: I just analysed the fast-import/fast-export file-format which is very simple. It should be possible to write some script to modify the file and move the (property bugs...) lines into the corresponding commit message line. However, if there is an out-of-the box solution I would be happy to hear it :)
Git Fast-import does not support metadata properties so there was no way of migrating these infos solely with the existing tools.
Since there was no response and losing all these bug-ids was no option for us, I wrote a fast-export stream-rewriter which is capable of rewriting the stream in a format that git understands but with all our bug id infos included.
The C# rewriter works by executing the following steps:
More infos about this rewriter + the code can be found here: http://www.fusonic.net/en/blog/2013/03/26/migrating-from-bazaar-to-git/
I had a similar need. I tried David's rewriter, but it produced output that git import would fail on. I suspect it was a subtle bug in renaming of some files in a commit.
I realized it might be easier to just modify 'bzr fast-export --plain' to just do what I wanted.
I filed the upstream (bzr fast-export) bug at LP: #1606973 and attached a solution that worked for me. After modifying fastimport/exporter.py, I just did:
bzr fast-export --git-branch=master --plain | git fast-import
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With