从不幸的“svn 副本”中恢复
今天下午,在注意到一个损坏的构建以及一些文件看起来像非常旧的版本(大约两周前)的事实后,我检查了 svn 日志。 显然就在今天下午,一位开发人员将旧版本的目录“svn 复制”到了同一目录。 因此,看起来该目录中所有文件的最新版本“ie head”确实很旧,并且所有历史记录“ie log”甚至更旧。
然而,我认为我可以通过使用另一个“svn副本”来恢复(即疾病就是治疗)。 我正在考虑做的是找到完成错误“svn copy”的修订版(例如修订版1234),减去1(1233)并执行以下操作:
svn copy -r 1233 file://path/to/messed/up/dir file://path/to/messed/up/dir
应该恢复最新版本,并获取找回我所有的历史。 我的说法正确吗?
This afternoon, upon noticing a broken build and the fact that some files looked like very old versions (about 2 weeks old), I checked the svn log. Apparently just this afternoon, 1 of the developers did an "svn copy" of a directory from an older revision to the same directory. Thus it appears that the latest version "i.e. head" of all the files in that directory are really old, and all the history "i.e. log" is even older.
However, I think I can recover by using another "svn copy" (i.e. the disease is the cure). What I am considering doing is finding the revision where the bad "svn copy" was done (say rev 1234) , subtracting 1 (1233) and doing:
svn copy -r 1233 file://path/to/messed/up/dir file://path/to/messed/up/dir
That should restore the latest version, as well as get back all my history. Am I right about this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
根据 SVN 书籍,
应该可以解决问题。
有一个完整的部分 书中对此进行了介绍。
详细解释:
-c -1234
转换为-r 1234:1233
,这会恢复修订版 1234 中的更改。According to the SVN book,
should do the trick.
There's a whole section about this in the book.
The verbose explanation:
-c -1234
translates into-r 1234:1233
, which reverts the change from revision 1234.这个复制命令不起作用有两个原因:
要解决此问题,您需要
删除当前的目录对象:
使用“peg revisions”复制
This copy command doesn't work for two reasons:
To fix this, you need to
remove the current dir object:
Copy using "peg revisions"
可能吧,但先备份一下。
实际上,我很想知道为什么你没有可以从已经恢复的每日备份......你的 SVN 存储库肯定足够重要吗?
Probably, but make a backup first.
Actually, I'm left wondering why you don't have a daily backup that you can just restore from already... Your SVN repository is surely important enough for that?