好的,看看原帖博客,这就是你想要的:
svn diff --diff-cmd wm [optional-filename]
如果你想看看这里发生了什么(即svn diff
传递到指定的参数类型diff-cmd
),你可以使用svn diff --diff-cmd echo
并查看它的内容:
[~/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
会通过
-u -L "" -L " "
到您的批处理文件.您拥有的批处理文件用于将这些命令转换为WinMerge理解的格式.
svn书中提供了有关这一切是如何工作的更多细节和示例.
要使您的批处理文件成为默认文件svn diff
,您需要[helpers]
在本地subversion配置文件的部分中添加以下行(~/.subversion/config
在Linux中,我不确定配置文件在Windows中的位置)(请参阅此前的SO问题)
diff-cmd=wm.bat
看看这个链接:
http://blog.tplus1.com/index.php/2007/08/29/how-to-use-vimdiff-as-the-subversion-diff-tool/
以下是SOer方便的副本:
获取此diffwrap.sh脚本并将其保存在任何位置.我把它保存在我的$ HOME/bin目录中.一定要让它可执行!我在下面显示:
#!/bin/sh # Configure your favorite diff program here. DIFF="/usr/bin/vimdiff" # Subversion provides the paths we need as the sixth and seventh # parameters. LEFT="$6" RIGHT="$7" # Call the diff command (change the following line to make sense for # your merge program). "$DIFF" "$LEFT" "$RIGHT" # Return an errorcode of 0 if no differences were detected, 1 if some were. # Any other errorcode will be treated as fatal.然后将
$HOME/.subversion/config
文件更改为指向该脚本:[helpers] diff-cmd = /home/matt/bin/diffwrap.sh然后去差异文件!