Converting a Subversion repository to Bazaar

I recently wanted to test drive Bazaar with a fairly large project.
The first problem is to convert the whole repository which happen to be stored in subversion to a bunch of Bazaar branches.
There’s a tool called svn2bzr written by Gustavo Niemeyer which allows you to easily import a bunch of subversion branches in bzr.

There’s nothing special about my subversion repository, it only contains a couple of modules in the same repository, similar to how KDE has it set up, but different to GNOME.

First you need a dump, that’s easily created using

$ svnadmin dump /path/to/url > stoq-projects.dump

Next step is to convert the four modules called kiwi, stoqlib, stoqdrivers and stoq, to do that, issue this command:

$ python ./ --scheme=trunk \
--exclude=kiwi(|/tags|/branches)$ \
--exclude=stoq(|/tags|/branches)$ \ 
--exclude=stoqdrivers(|/tags|/branches)$ \ 
--exclude=stoqlib(|/tags|/branches)$ ../stoq-projects.svndump stoq-projects

It turned out that the revision timestamp conversion had a couple of bugs, so you’d really need the latest version, incidentally available as a bzr branch from here.

This entry was posted in General. Bookmark the permalink.