views:

453

answers:

2

Our team has been using SVN for managing an application of decent size and over time a rather complex hierarchy of branches and tags has built up, which is following the basic standard layout for SVN repositories, but is more nested:

  |-trunk
  |-branches
  |  |-releases
  |  |   |-releaseA
  |  |   `-releaseB
  |  `-features
  |      |-featureX
  |      `-featureY
  |-tags
     |-releaseA
     |   |-beta
     |   `-RTP
     `-releaseB
         |-beta
         `-RTP     

(The feature branches are obviously temporary branches but we have to take them into consideration as it won't be feasible to close all of them at once in the near future)

For several reasons but primarily because merges have been becoming an increasing pain, we are considering to switch to Mercurial.

The main problem we are currently facing is migrating the existing code base without losing our history. I've tried several migration tools (e.g., yasvn2hg, hg convert and svn2hg) with yasvn2hg being the most promising, but none of them seem to be able to deal with nested hierarchies but they all assume that branches and tags are organized in one flat directory respectively.

The choice between named branches or clones as the conversion target of old SVN branches is not a limiting factor in this case, as either solution would be appreciated. We are currently experimenting with both options and how they would fit into our current processes but haven't decided on one yet. I'd obviously be interested in recommendations or experiences with similar setups concerning that issue as well.

So, what is the best way to convert a nested SVN branch hierarchy like this to Mercurial?

Converting one branch at a time into a separate repository would be quite annoying and I am not sure if that would be the right approach in the first place, depending on how the tools handle historic merges and need to be aware of all other branches?

+2  A: 

An excelent article I read was. http://ww2.samhart.com/node/50

Nathan Lee
This link mentions my rationale for splitting the svn repo into multiple hg repos
John Weldon
+2  A: 

You should really ask such questions on the mercurial mailing list. That is where the Mercurial developers hang out, and there has been many Subversion migration question over time.

That being said, a recent change might help you -- it claims to let you

[...] fix even the most badly mismanaged repositories and turn them into nicely structured Mercurial repositories.

I have not tried it out myself, so I cannot comment on how effective it will be for your exact case.

Martin Geisler
Thanks, I'll see if I can find the fix you mentioned and give it a try. Concerning the mailing list, that's an option I will definitely explore as well. Most Google hits I found concerning Mercurial migration either pointed to a blog entry or SO, so it seemed the convenient first place for asking
Christian Hang
Right. I suggested it since I think it's a shame to spread the answers over both the wiki, the mailing list, and now stackoverflow. Also, the mailing list has a number of people who have worked on this specific part of the code. If you like IRC, then I've seen a number of people getting help in the #mercurial channel on irc.freenode.net.
Martin Geisler