First question, why would I want to do that? Actually I don't really want to do that but code.google.com uses SVN as its VCS and I want to host a project there. I originally used Mercurial (hg) for that project and so I need to get it out of hg and into svn. The ultimate goal is to use either Bazaar-NG (bzr) with it's svn plugin or svk, this is a step along that path.
Second question, isn't that straight forward? No, tailor's hg->svn support is busted. hg doesn't care about directories, svn does and this makes it impossible to move from hg to svn if you have any directories (I filed a bug). So instead I must move everything to bzr first and then to svn as the bzr->svn code seems to handle directories correctly. It seems that one of hg->bzr or bzr->svn makes the directories problem go away.
The following little bash script takes 3 arguments:
- the path to the hg repo that you want to put into svn
- the path to the svn repository
- the name of the svn module that the code will live in
I invoked it as
It takes quite a while to push all the changes and I had to clear out the repo once as the svn command stalled and timed out (server problem I think). Then I made a mess of restarting the whole process (I think it also wasn't helped by me reusing a directory from my test run!). Speaking of the test run, I played around with svk and it seemed quite awkward in comparison to hg and bzr. Not having used any of them for heavy duty work I can't really speak with authority. It definitely seems that svk's branch and merge process (as described in a rather good tutorial) reuires typing more commands and typing more awkward paths than with bzr or hg.