最初的问题是“如何将WinMerge配置为TFS的比较和合并工具”。但是,我正在改变它,因为TehOne回答了这个问题的更一般形式。
我会在Stackoverflow上已经提到过这个问题。我在其他地方找到了答案,但我在这里问/回答。它现在是一个社区维基。
答案 0 :(得分:33)
当我在寻找如何做到这一点时,我发现这篇文章非常宝贵: http://blogs.msdn.com/jmanning/articles/535573.aspx
答案 1 :(得分:12)
简短的回答是比较的参数列表是:
/x /e /ub /wl /dl %6 /dr %7 %1 %2
和合并的参数列表是:
/x /e /ub /wl /dl %6 /dr %7 %1 %2 %4
有时Winmerge不会返回0并且TFS会认为合并已取消。您需要使用以下包装器批处理文件进行合并:
@rem winmergeFromTFS.bat
@rem 2007-08-01
@rem File created by Paul Oliver to get Winmerge to play nicely with TFS
@rem
@rem To use, tell TFS to use this command as the merge command
@rem And then set this as your arguments:
@rem %6 %7 %1 %2 %4
"C:\Program Files\WinMerge\WinMerge.exe" /x /e /ub /wl /dl %1 /dr %2 %3 %4 %5
exit 0
然后将参数列表设置为:
%6 %7 %1 %2 %
退出0
答案 2 :(得分:0)
对于SourceGear DiffMerge,您需要将默认命令行更改为:
C:\ Program Files(x86)\ SourceGear \ Vault Client \ sgdm.exe
我在SourceGear支持论坛上的this thread以及@TehOne提到的James Manning的博客中找到了参数,但给出的参数不正确并导致自动-merge反向执行,即旧代码覆盖新代码。正确的论点是:
/ m / t1 =%6 / t2 =%7 / t3 =%8 / c =%9%1%3%2 / r =%4