SVN “missing revision” when moving to Mercurial

眉间皱痕 提交于 2019-12-11 08:08:18

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!