跨2个不同存储库的SVN差异 [英] SVN diff across 2 different repositories
问题描述
我有2个存储库。由于主干代码位于受保护的一个存储库中,因此我进行了签出,然后签入了另一个存储库(因为用户没有权限访问第一个受保护的存储库)。
I have 2 repositories. As the trunk code was in one repository, which was protected, I did a checkout and then checked in to the other repository (as users did not have permission to the first protected one).
现在的问题是两个存储库都已使用,我们希望最终将第二个未受保护的存储库中的代码/分支与受保护的存储库合并。但是,其中会有冲突。
Now the issue is that both the repositories have been worked on and we wish to finally merge the code/branch in the second unprotected one with the protected one. But, there will be conflicts in these.
是否有办法找出两个存储库分支的差异?
另外,如果存在空格更改,我该如何忽略它们?
Is there a way to find out the diff for the 2 repository branches? Also, if there are whitespace changes, how do I ignore those?
推荐答案
我不知道内置的Subversion功能可以实现这一点,但是您可以创建两个存储库的完整签出并使用命令行diff实用程序比较两个工作副本:
I don't know of a built-in subversion feature that would allow this, but you could create a complete checkout of both repositories and use the command line diff utility to compare both working copies:
diff -w -u -r -N WorkingCopy1 WorkingCopy2
-w
忽略所有空白
-u
使用统一的diff格式(如subversion)
-r
递归
-N
允许新文件出现在补丁中
-w
to ignore all Whitespace
-u
to use the unified diff format (like subversion)
-r
for recursive
-N
to let new files appear in the patch
并非最快的方法,但对于一次性过程来说可能是可以接受的。您也可以通过将输出重定向到文件 diff -w -u -r -N WorkingCopy1 WorkingCopy2>创建补丁。 wc1-to-wc2.patch
It's surely not the fastest approach, but might be acceptable for a one-time process. You can also create a patch by redirecting the output to a file diff -w -u -r -N WorkingCopy1 WorkingCopy2 > wc1-to-wc2.patch
如果您正在运行Windows,则可以在此处找到diff和patch的win32版本: http://gnuwin32.sourceforge.net/packages/diffutils.htm
If you're running windows, win32 builds of diff and patch can be found here: http://gnuwin32.sourceforge.net/packages/diffutils.htm
这篇关于跨2个不同存储库的SVN差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!