svnmercurialhgsubversion

How to push a range of revisions from svn to hg


I am trying to migrate from Subversion to Mercurail (Hg). For that process I use hg convert command. I want only the newest revisions that are a year older to be migrated to Mercurial. I tried using the below command

hg convert --rev 4234 http://mysvn/myrepo/trunk

But the above command migrates only the revisions that are older than 4234 (4233, 4232,..... ,1 ,0)

How to get migrate to mercurial from HEAD to specified revision.


Solution

  • You will need the SVN specific conversion config option svn.startrev.

    You can either add it to a [convert] section in your .hgrc:

    [convert]
    svn.startrev=4234
    

    or you can specify that config option on the command line:

    hg --config convert.svn.startrev=4234 convert http://mysvn/myrepo/trunk
    

    Please take note that the docs say this will work for single branch conversion only. If you have more than one branch, you should be able to use the splice map option to accomplish your goal, but that might take some extra work.