Converting an SVN Repository to Bazaar

A. S. Budden abudden at gmail.com
Thu Jan 22 18:49:38 GMT 2009


2009/1/22 James Henstridge <james at jamesh.id.au>:
> On Wed, Jan 21, 2009 at 8:10 PM, A. S. Budden <abudden at gmail.com> wrote:
>> I have been trying to convert my subversion repository to a bazaar
>> repository, but I have been having some problems so was hoping that
>> someone on this list might be able to help.
[snip]
>> I have tried a few approaches to converting the repository, but had no
>> success.  My first attempt was to use svn2bzr [1] on the whole
>> repository: this produced a matching layout, but the only way I could
>> get anything out of the bazaar repository was to check out the entire
>> 1.5 GB repository!  After some googling, I found "An Academic Gets
>> Bazaar" [2], which sounded really promising.  So I downloaded
>> svndumpfilter4 [3] and tried the suggested command line listed on the
>> website:
[snip]
>
> You might be best off editing the svn2bzr source code and defining a
> new DynamicBranchCreator subclass that describes your branch scheme.
> You will want to override the _want_brt(path) method to return True
> for any path that should be converted to a branch and False for
> anything above those directories.
>
> The TrunkBranchCreator and ProjectBranchCreator might be worth looking
> at for reference, but you'll need something a bit more complex to both
> recognise your old branch paths and new branch paths.  Provided that
> you've only copied from old paths that were considered to be branches
> to new paths that are considered branches, things should just work.
> If you've essentially split modules, things might not work as well.
>
> You'll then need to edit main() to provide a way to select your new
> BranchCreator and then run with --scheme=whatever.

This certainly looks very promising and I have now (sort of) managed
to make a bazaar repository out of my existing repository.  I created
a new "AlBranchCreator" that had an additional __init__ stage that
read a list of project directories (e.g. applications/vim/vimfiles)
from a text file and used this as the basis upon which to decide in
the _want_brt method.  This went ahead and chewed for a bit and
produced a functional repository.  The only problem with it is that
the history only goes back as far as the repository reorganisation (as
the 'filter' won't recognise trunk/configuration/vimfiles/ as being
the same directory as applications/vim/vimfiles/).

Is this possible, or will I have to refer back to the subversion
repository if I ever I want to look at earlier history?

Many thanks in advance,

Al



More information about the bazaar mailing list