svn to mercurial?

nicholas on 2010-04-01T14:14:06

Dear lazyweb...

We're using Trac at work. It's made of software, but some software is more equal than others. In particular, we're planning to move from subversion to mercurial, because Trac seems to work nicely (enough)* with mercurial, unlike git.

So, what's the best way to convert a 20000 revision svn repository to mercurial? We have branches, which it would be nice to convert to real branches. I have some idea how to do this for svn to git, including branches and tags, but not for mercurial.

* svn vs. Trac - which sucks more? The ultimate cagematch.


HgSubversion

nnunley on 2010-04-01T17:14:40

Have you tried http://mercurial.selenic.com/wiki/HgSubversion? It looks like the initial import will be slow, but it seems to be getting top billing from the Mercurial maintainers.

Re:HgSubversion

nicholas on 2010-04-02T17:33:10

Admittedly this is only from reading its fine manual, but it looks more like git svn than a "proper" importer. i.e. it concentrates on bidirectional tracking of one remote branch in a subversion repository, not on untangling the "branches are branches and tags are branches too*" mess that a subversion repository can get into, not on converting them all to first class tags and first class branches.

* but really they're all just copies within a directory tree.

Re:HgSubversion

craigb on 2010-04-02T21:08:27

That doesn't look like a proper importer because that's not the proper importer; this is:

http://mercurial.selenic.com/wiki/ConvertExtension

You basically just do

$ hg convert

in whatever repository you are converting from, but there are lots of options including some svn-specific features. I think it also remembers what it's converted so a subsequent convert picks up where it left off.

I've never used it with Subversion, but I once converted the Perl git repository this way and it worked fine.

snerp vortex isn't just for git

rcaputo on 2010-04-01T17:35:15

I can't answer your question directly, but I know that my Snerp Vortex is designed to support more than just git.

Someone with Mercurial chops could write SVN::Dump::Replayer::Mercural, and then snerp would support --replayer=mercurial