SVN "missing revision" when switching to Mercurial

We are trying to move from Subversion to Mercurial, and we are trapped. "svnadmin verify" causes this error:

svnadmin: No such version 21228

Looking at the server, there is no file in the "revs" directory for 21228. Everything else is intact, and the current head is working fine (we are now reviewing 63,000 or so on).

We do not care about this revision, but we do not want to lose the history for 1-21227 during conversion. Does anyone know how to get SVN to ignore this error or somehow recover the missing file?

+1
source share
1 answer

I went through something similar in one of my svn β†’ hg conversions. If you are not worried about what was in this revision, you can probably do the conversion in three steps:

1) Reset the SVN repository twice using svnadmin dump , skipping the failed revision

 svnadmin dump -r1:21227 /var/svn/repo/foo > foo-svn-1.dump svnadmin dump -r21229:X /var/svn/repo/foo > foo-svn-2.dump 

and reload them into the new temporary SVN repositories.

 svnadmin create ./foo-svn-1 svnadmin load ./foo-svn-1 ./foo-svn-1.dump svnadmin create ./foo-svn-2 svnadmin load ./foo-svn-2 ./foo-svn-2.dump 

2) Convert two temporary repositories to two hg repositories with hg convert

 hg convert ./foo-svn-1 foo-hg-1 hg convert ./foo-svn-2 foo-hg-2 

and pull all the changes from the second to the first repository (using hg pull -f to force import unrelated changes).

 cd ./foo-hg-1 hg pull -f ../foo-hg-2 

You will have one repo with a break in the change history in which you split the svn repository.

3) Connect the two trees together with the hg rebase , as described in Gluing at breaks in the Mercurial repository timeline

+3
source

All Articles