SVN“缺少修订"搬到水星时 [英] SVN "missing revision" when moving to Mercurial

查看:86
本文介绍了SVN“缺少修订"搬到水星时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正试图从Subversion转向Mercurial,但遇到了障碍. "svnadmin verify"产生此错误:

We're trying to move from Subversion to Mercurial and we've hit a snag. "svnadmin verify" produces this error:

svnadmin:无此类修订21228

svnadmin: No such revision 21228

在服务器上,"revs"目录中没有用于21228的文件.其他所有内容都完整无缺,并且当前磁头运行正常(我们的修订版为63000左右).

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).

我们并不是很在意此修订,但是我们真的不想在转换时丢失1-21227的历史记录.有人知道强制SVN忽略此错误或以某种方式恢复丢失的文件的方法吗?

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?

推荐答案

我在svn-> hg转换之一中经历了类似的事情.如果您不担心该修订版中的内容,则可以分三步进行转换:

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)使用svnadmin dump转储SVN存储库两次,跳过错误的版本

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

并将它们重新加载到新的SVN临时存储库中.

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)使用hg convert

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

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

并将所有变更集从第二个导入到第一个存储库中(使用hg pull -f强制导入不相关的变更集).

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

然后您将拥有一个版本库,在修订历史记录中有一个中断,您可以在该版本库中拆分svn版本库.

You'll then have one repo with a break in the revision history where you split the svn repo.

3)如hg rebase扩展名拼接在一起>在Mercurial储存库时间轴中拼接不连续性

3) Splice the two trees together with the hg rebase extension as described in Splicing over discontinuities in Mercurial repository timeline

这篇关于SVN“缺少修订"搬到水星时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆