Svn to Mercurial: Fewer revision numbers and missing tags

Kevin Bullock kbullock+mercurial at ringworld.org
Mon Nov 15 18:27:51 UTC 2010


On Nov 14, 2010, at 8:35 AM, Florian Brunner wrote:

> Hi, 
> 
> I want to migrate my project (https://softsmithy.svn.sourceforge.net/svnroot/softsmithy) from Subversion to Mercurial. 
> 
> I'm working on a local mirror (svnsync; as described at http://panospace.wordpress.com/2010/05/19/svn2hg_part1/ ). 
> The current svn revision number is: 544 
> I'm using the following command to convert the subversion Repository to a Mercurial repository: 
> hg convert --branchsort --authors svn_users.txt softsmithy-mirror softsmithy-mercurial-all
> 
> The resulting repository doesn't contain all tags, though.
> 
> The resulting repository also does have only 511 revisions. I'm not sure if this is only related to the tags.
> 
> Some of the missing tags are tagging a subdirectory of trunk. This might be a part of the problem.
> 
> How can I get all tags and revisions?

You might re-try the conversion using the [hgsubversion extension][1]. It's designed to allow two-way use of a Subversion repository from Mercurial, but as a consequence it can sometimes handle a simple one-way conversion better (and faster).

  [1]: http://mercurial.selenic.com/wiki/HgSubversion

Neither `hg convert` nor hgsubversion will likely be able to handle subdir tags automatically, though. You might have to manually add the tags after the conversion. If you're using a current version of hg (>= 1.6), this can be done relatively easily:

    $ svn log svn://example.com/original/repo/tags/subdirtag  # note revision number
    $ hg tag -r 'svnrev(X)' TAGNAME                           # X is revision number

> PS: This is a cross-post: http://stackoverflow.com/questions/4173875/svn-to-mercurial-fewer-revision-numbers-and-missing-tags

This answer also cross-posted: http://stackoverflow.com/questions/4173875/svn-to-mercurial-fewer-revision-numbers-and-missing-tags/4187567#4187567

pacem in terris / mir / shanti / salaam / heiwa
Kevin R. Bullock




More information about the Mercurial mailing list