更改默认的SVN差异工具
在博客之后,我创建了一个批处理文件wm.bat:
Following a blog, I created a batch file, wm.bat:
"d:\svnroot\external\winmerge\WinMerge.exe" /B /WAIT "d:\svnroot\external\winmerge\WinMergeU.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 Data\Subversion\config
或(Windows Vista)
or (Windows Vista)
C:\Users\%USERNAME%\AppData\Roaming\Subversion\config
好,看看原始博客文章,这就是您想要的:
Ok, looking at the original blog post, this is what you want:
svn diff --diff-cmd wm [optional-filename]
如果您想查看此处实际发生的情况(即 svn diff
passe s到指定的 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书。
要将您的批处理文件设置为 svn diff
的默认文件,您需要在 [helpers] $ c中添加以下行$ c>部分在您的本地Subversion配置文件中(在Linux中为
〜/ .subversion / config
,我不确定该配置文件在Windows中的位置)(请参阅此早期的SO问题)
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