如何比较 XCode 中的两个 SVN 修订版?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8134931/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to compare two SVN revisions in XCode?
提问by Danra
Is there a way to compare all changes between two SVN revisions in XCode?
有没有办法比较 XCode 中两个 SVN 修订版之间的所有更改?
(I do know how to view compare a single file, using XCode 4's source-control view mode, and I do know how to view changes introduced in a single revision in the organizer's repositories section.)
(我知道如何使用 XCode 4 的源代码控制视图模式查看单个文件的比较,并且我知道如何查看组织者存储库部分中单个修订版中引入的更改。)
回答by wmarbut
In XCode 6, here is how you do it:
在 XCode 6 中,您可以这样做:
Click the compare button and choose "Comparison". Button is in the top right of the XCode window.
- Choose a revision. Controls are at the bottom of the editor pane.
单击比较按钮并选择“比较”。按钮位于 XCode 窗口的右上角。
- 选择一个修订版。控件位于编辑器窗格的底部。
回答by iDou
I don't know since when, but in the organizer's repositories section of xCode 4.4.1 there is a "view revision" button in the bottom right. If you put a revision number you will have all the changes from this version to the head of the repositories.
我不知道从什么时候开始,但是在 xCode 4.4.1 的组织者存储库部分,右下角有一个“查看修订版”按钮。如果您输入修订号,您将拥有从该版本到存储库头部的所有更改。
But you can also write "1800:1803" if you want to see the changes made in revision 1801, 1802 and 1803 (i.e. compare revision 1800 and 1803).
但是,如果您想查看修订版 1801、1802 和 1803 中所做的更改(即比较修订版 1800 和 1803),您也可以编写“1800:1803”。
I think that's what you wanted.
我想这就是你想要的。
回答by Chris Trahey
In the source-control split-view, there are revision selection controls at the very bottom. Both sides have this control available, so you can pick any arbitrary commits to diff:
在源代码控制拆分视图中,最底部有修订选择控件。双方都可以使用此控件,因此您可以选择任何对 diff 的任意提交:
Discolsure: I tested this with git andSVN, works great!
Discolsure:我用 git和SVN测试了这个,效果很好!
回答by Dan J
If you can't find a way to do this through Xcode you can always use the SVN command line from the Terminal to do it.
如果您找不到通过 Xcode 执行此操作的方法,您始终可以从终端使用 SVN 命令行来执行此操作。
To see the diffs for revision 186 in Terminal run (press space to see the next page in the diffs, or q to quit):
要在终端运行中查看修订版 186 的差异(按空格键查看差异中的下一页,或按 q 退出):
svn diff -c 186 | more
To see the diffs made between revisions 179 and 186 run:
要查看修订版 179 和 186 之间的差异,请运行:
svn diff -r 179:186 | more
You can then copy a script like fmdiffand invoke FileMerge directly with the output of the diffs, e.g:
然后,您可以复制fmdiff 之类的脚本并直接使用差异的输出调用FileMerge,例如:
svn diff -c 186 --diff-cmd fmdiff
回答by Gordon Dove
You can compare two branches, if you're using branches. I found it using source control|merge and then cancelling the merge, but there might be another way.
如果您使用分支,则可以比较两个分支。我发现它使用源代码管理|合并然后取消合并,但可能还有另一种方法。
I don't know if you can retroactively create a branch in Xcode, but if you create the branch from the command line, I'm pretty sure Xcode will recognise it.
我不知道您是否可以在 Xcode 中追溯创建分支,但是如果您从命令行创建分支,我很确定 Xcode 会识别它。
svn copy -r specificRevisionNumber file:///Users/yourName/svn/yourProject/trunk file:///Users/yourName/yourProject/branches/yourProject-1.0
svn copy -r specificRevisionNumber file:///Users/yourName/svn/yourProject/trunk file:///Users/yourName/yourProject/branches/yourProject-1.0
Hope that helps
希望有帮助