views:

46

answers:

1

Is there a conversion utility from svn to hg that can deal with a branch hierarchy that's more complex than just a flat list of branches under /branches?

My repository has a directory that looks (conceptually) like this:

/branches
  /projectA
     /v1.x
        /v1.1
        /v1.2

etc..

IOW I need a tool that can get a tree structure as input that represents the branch hierarchy, and migrate this into hg (could be flat in HG, don't really care).

+1  A: 

The convert extension has a number of options to map paths and branch names. Maybe these can be of help. You could also try to make a copy of your SVN repository and in that copy move the branches into a flat structure before converting it. Finally, you could try to convert to a Mercurial repository, and then convert that repository again to do some cleaning up.

If that doesn’t help either, I fear that your options are limited... Probably you would have to write a custom script that manually converts the repository, or uses history rewriting to alter the converted repository. You could also take the convert or hgsubversion extension and modify them to suit your needs. Or you could decide to ditch the branches entirely, or only keep a few important ones and manually create them/clean them up.

Laurens Holst
I like the 2nd option - moving branches around in svn is cheap. Doing the reorganization in hg is not actually feasible, since the sheer size of the repo with all the branches in one directory is prohibitive.I'll try it.
Assaf Lavie