在 Subversion 中撤消特定修订 [英] Undoing specific revisions in Subversion

查看:30
本文介绍了在 Subversion 中撤消特定修订的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我在存储库文件夹中有一组提交...

Suppose I have a set of commits in a repository folder...

123 (250 new files, 137 changed files, 14 deleted files)
122 (150 changed files)
121 (renamed folder)
120 (90 changed files)
119 (115 changed files, 14 deleted files, 12 added files)
118 (113 changed files)
117 (10 changed files)

我想要一份工作副本,其中包含修订版 117 以后的所有更改,但不包含修订版 118 和 120 的更改.

I want to get a working copy that includes all changes from revision 117 onward but does NOT include the changes for revisions 118 and 120.

为了让问题更清楚,我想撤消在 118 和 120 中所做的更改,同时保留所有其他更改.该文件夹包含数百个子文件夹中的数千个文件.

To perhaps make the problem clearer, I want to undo the changes that were made in 118 and 120 while retaining all other changes. The folder contains thousands of files in hundreds of subfolders.

实现这一目标的最佳方法是什么?

What is the best way to achieve this?

答案,感谢 Bruno 和 Bert,是命令(在本例中,用于在执行完全合并后删除 120)

The answer, thanks to Bruno and Bert, is the command (in this case, for removing 120 after the full merge was performed)

svn merge -c -120 .

请注意,修订号必须以减号开头.-120"不是120"

Note that the revision number must be specified with a leading minus. '-120' not '120'

推荐答案

要撤消修订 118 和 120:

To undo revisions 118 and 120:

svn up -r HEAD       # get latest revision
svn merge -c -120 .  # undo revision 120
svn merge -c -118 .  # undo revision 118
svn commit           # after solving problems (if any)

另见撤消更改.

注意 -c -120 参数中的减号.-c(或 --change)开关从 Subversion 1.4 开始就被支持,旧版本可以使用 -r 120:119.

Note the minus in the -c -120 argument. The -c (or --change) switch is supported since Subversion 1.4, older versions can use -r 120:119.

这篇关于在 Subversion 中撤消特定修订的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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