Wednesday, July 01, 2009

Convert an svn repository to an hg repository

[The following is a very condensed version of the instructions found here.]

Suppose svn-working-copy is a working copy of the svn repo.
hgimportsvn svn-working-copy hg-repo
Pull all SVN history with hgpullsvn
cd hg-repo
hgpullsvn
Do an update for good measure
hg update (optional)
Clean up the .svn and .hgignore directories.
cd hg-repo
find . -name .svn | xargs -0 rm -rf
find . -name .hgignore | xargs -0 rm -rf
Done. Yay.