问题
We're trying to move from Subversion to Mercurial and we've hit a snag. "svnadmin verify" produces this error:
svnadmin: No such revision 21228
Looking on the server, there is no file in the "revs" directory for 21228. Everything else is intact and the current head is working perfectly (we're on revision 63000 or so now).
We don't really care about this revision, but we don't really want to lose the history for 1-21227 when converting. Does anyone know of a way of forcing SVN to ignore this error or recover the missing file in some way?
回答1:
I went through something similar in one of my svn -> hg conversions. If you're not worried about what was in that revision you can probably do the conversion in three steps:
1) Dump the SVN repository twice using svnadmin dump, skipping over the bad 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 new temporary SVN repos.
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 the two temp repositories into two hg repositories using hg convert
hg convert ./foo-svn-1 foo-hg-1
hg convert ./foo-svn-2 foo-hg-2
and pull all the changesets from the second into the first repository (using hg pull -f to force the import of the unrelated changesets).
cd ./foo-hg-1
hg pull -f ../foo-hg-2
You'll then have one repo with a break in the revision history where you split the svn repo.
3) Splice the two trees together with the hg rebase extension as described in Splicing over discontinuities in Mercurial repository timeline
来源:https://stackoverflow.com/questions/6061160/svn-missing-revision-when-moving-to-mercurial