Converting an SVN Repository to Bazaar

A. S. Budden abudden at gmail.com
Thu Jan 29 21:45:25 GMT 2009


2009/1/22 James Henstridge <james at jamesh.id.au>:
> On Fri, Jan 23, 2009 at 5:49 AM, A. S. Budden <abudden at gmail.com> wrote:
>> 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/).
>
> If your BranchCreator treats both trunk/configuration/vimfiles and
> applications/vim/vimfiles as branches, then svn2bzr should follow
> history if you did a copy/move from one location to the other.
>
> During the import process it literally copies the branch at the first
> location to the other, so it should maintain history.
>
> Note that your BranchCreator should be returning False for paths
> trunk, trunk/configuration, applications and applications/vim for this
> to work though, or the copies won't be correctly traced.

Thanks, this sort-of worked.  Some of the reorganisation parts came
across cleanly, others appeared to be added rather than moved.  As far
as I can tell this is because one of the major parts of my
reorganisation was to lose the trunk/ branches/ tags/ part of the
repository, so I did something along the lines of:

svn mv -m "Repository reorganisation" svn://localhost/trunk/documents
svn://localhost/documents
svn mv -m "Repository reorganisation"
svn://localhost/trunk/configuration/vim
svn://localhost/applications/vim

Since none of these directories are working paths (the working paths
are applications/vim/vimfiles, documents/contacts,
documents/university/thesis etc), it seems to treat these as
independent add and deletes (although nothing appears in the log for
the delete, even with --log debug), so the history starts with the
repository reorganisation.

I guess I'll have to keep the subversion repository around in case
it's ever needed.  Not the end of the world: at least I seem to have
all of the projects accessible.  Having said that, if I can't browse
my repository without having to memorise the structure (see my other
thread), I can't see bazaar as being really usable yet, so I'll
probably just end up sticking with subversion... we shall see.

Thanks for the help anyway.

Al



More information about the bazaar mailing list