在 Subversion 中撤消特定修订
假设我在存储库文件夹中有一组提交...
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 的更改。
编辑:也许为了使问题更清楚,我想撤消 118 和 120 中所做的更改,同时保留所有其他更改。 该文件夹包含数百个子文件夹中的数千个文件。
实现这一目标的最佳方法是什么?
答案,感谢 Bruno 和 Bert,是命令(在本例中,用于在执行完全合并后删除 120)
svn merge -c -120 .
请注意,修订号必须以前导减号指定。 “-120”不是“120”
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)
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.
EDIT: 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?
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 .
Note that the revision number must be specified with a leading minus. '-120' not '120'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您使用 TortoiseSVN(Subversion 的 Windows 客户端),则有一种更直接的方法。 您只需单击查看更新的工作副本中的日志,选择要撤消的修订,右键单击,然后选择“恢复这些修订的更改”。
这是一个安全的操作,因为更改仅应用在您的工作区中。 您仍然必须承诺修改您的存储库。
这是TortoiseSVN 最好的功能之一。 我一直是一个命令行爱好者,但 Tortoise 改变了我的想法。
There's a more straightforward way if you use TortoiseSVN, a Windows client for Subversion. You just click to view the log in your updated work copy, select the revisions you want to undo, right click, and select "Revert changes from these revisions".
It is a safe operation because the changes are applied just in your workspace. You still have to commit to modify your repository.
It is one of the best features of TortoiseSVN. I've always been a command line guy, but Tortoise changed my mind.
要撤消修订版 118 和 120:
另请参阅 撤消更改。
请注意 -c -120 参数中的减号。 从 Subversion 1.4 开始支持
-c
(或--change
)开关,旧版本可以使用-r 120:119
。To undo revisions 118 and 120:
Also see the description in Undoing changes.
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
.我想您可以从修订版 117 创建一个分支,然后合并除 118 和 120 之外的所有内容。
然后签出此分支并从那里执行
svnmerge.py merge -r119,120-123
编辑:< /strong> 这不会撤消分支/主干中的修订。 请改用
svn merge
。I suppose you could create a branch from revision 117, then merge everything except 118 and 120.
Then checkout this branch and from there do
svnmerge.py merge -r119,120-123
EDIT: This doesn't undo the revisions in the branch/trunk. Use
svn merge
instead.