更改默认 SVN 差异工具 [英] Change default SVN diffing tool
问题描述
在博客之后,我创建了一个批处理文件 wm.bat:
Following a blog, I created a batch file, wm.bat:
"d:svnrootexternalwinmergeWinMerge.exe" /B /WAIT "d:svnrootexternalwinmergeWinMergeU.exe" /e /ub /dl %3 /dr %5 %6 %7
我试着打电话
svn diff | wm
但这没有用.那么我如何将 WinMerge 或类似的实用程序与 svn diff
集成?
but that didn't work. So how do I integrate WinMerge or similar utility with svn diff
?
扩展下面 David 的回答,更改 Windows 的默认值需要编辑位于(对于 Windows XP)的配置文件
Extending on David's answer below, changing the default for Windows requires editing the configuration file located at (for Windows XP)
C:Documents and Settings\%USERNAME%Application DataSubversionconfig
或(Windows Vista)
or (Windows Vista)
C:Users\%USERNAME%AppDataRoamingSubversionconfig
推荐答案
好的,看看 原创博客发布,这就是你想要的:
Ok, looking at the original blog post, this is what you want:
svn diff --diff-cmd wm [optional-filename]
如果你想看看这里实际发生了什么(即 svn diff
传递给指定的 diff-cmd
什么样的参数),你可以使用 svn diff --diff-cmd echo
看看它说了什么:
If you want to see what is actually happening here (i.e. what sort of parameters the svn diff
passes to the nominated diff-cmd
), you can just use svn diff --diff-cmd echo
and see what it says:
[~/src/gosmore-dev]$ svn diff --diff-cmd echo
Index: gosmore.cpp
===================================================================
-u -L gosmore.cpp (revision 13753) -L gosmore.cpp (working copy) .svn/text-base/gosmore.cpp.svn-base gosmore.cpp
上面去掉了一些引号,但是基本上可以看到svn diff
会通过
Some quotes were removed above, but basically you can see that svn diff
will pass
-u -L "<left-label>" -L "<right-label>" <left-file> <right-file>
到您的批处理文件.您拥有的批处理文件用于将这些命令转换为 WinMerge 能够理解的格式.
to your batch file. The batch file you have is used to turn these commands into the format that WinMerge understands.
要使您的批处理文件成为 svn diff
的默认文件,您需要在本地 subversion 配置文件的 [helpers]
部分中添加以下行(~/.subversion/config
在 Linux 中,我不确定配置文件在 Windows 中的位置)(请参阅此 之前的问题)
To make your batch file the default for svn diff
, you need to add the following line in the [helpers]
section in your local subversion config file (~/.subversion/config
in Linux, I'm not sure where the config file is located in Windows) (see this earlier SO question)
diff-cmd=wm.bat
这篇关于更改默认 SVN 差异工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!