Search code examples
gitmercurialgit-svnhgsubversion

How to import a deleted path in a svn repositroy into git or mercurial


I need to do some research about sources in a svn-deleted path in our company svn repository. Since I need to work a lot with annotate, I want to have the history in mercurial or git. I tried so far:

  • hgsubversion and git-svn: For both programs I can't find a way to specify that I need a older revision where the path existed, both try the svn HEAD and fail since the path is deleted there.
  • hgsvn: It finds the old path (with a peg revision), but fails to do the initial update, since it wants to get the log from the svn HEAD revision, where the wanted path doesn't exist anymore.

So is there a way to import a deleted svn path into git or hg?


Solution

  • Assuming that the path was deleted on revision 117, the following should work with hgsubversion:

    hg clone -r 116 http://svn.example.com/whereever
    

    (I haven't tested this recently, but it should work. It's a bug if it doesn't…)

    You should also note that despite what khmarbaise claimed, closing a branch in Mercurial does not delete it from history. Closing a branch will merely hide it from hg heads unless the -c/--closed argument is given.