2011-05-10 34 views
10

当您在Team Foundation Server源资源管理器中比较两个版本的MS Word doc/Excel书籍时,结果是枯燥的“Binary filles differ”对话框。TFS下的MS Office文件差异

虽然它不一定是那样。相关应用程序(Word/Excel)具有出色的内置差异界面。您可以在使用启用了版本控制的SharePoint文件库时进行见证,并与以前的版本进行比较。另外,当你做差异时,TortoiseSVN会提起它。

问题 - 我可以在TFS中启用它吗?

回答

9

您可以为每个文件类型(扩展名)配置比较(差异)和合并工具。这是通过工具可用 - >选项 - >源代码管理 - > Visual Studio团队基础服务器 - >配置用户工具”按钮或者通过与tf diff /configure

命令行为了建立一个比较工具,您将指定扩展名(如果您希望它用于未指定的所有文件,请使用.*),您正在设置的操作(比较或合并),要调用的命令以及命令的参数。参数,可用变量如下:

%1 = Original file (in diff, the pre-changes file, in merge, the "server" or "theirs" file, the file that is the base file after "their" changes were applied) 
%2 = Modified file (in diff, the post-changes file, in merge the "yours" file - the base file with "your" changes applied) 
%3 = Base file (in the 3-way merge operation, the file which both "theirs" and "yours" are derived from - the common ancestor. This doesn't mean it's the version the changes were based from, since this may be a cherry-pick merge) 
%4 = Merged file (The output file for the merge operation - the filename that the merge tool should write to) 
%5 = Diff options (any additional command-line options you want to pass to your diff tool - this comes into play only when using "tf diff /options" from the command-line) 
%6 = Original file label (The label for the %1 file) 
%7 = Modified file label (The label for the %2 file) 
%8 = Base file label (The label for the %3 file) 
%9 = Merged file label (The label for the %4 file) 

要使用TortoiseSVN - 这似乎像它你想要什么 - 你会指定命令的文件路径TortoiseMerge.exe

对于比较,指定参数:/base:%1 /mine:%2 /basename:%6 /minename:%7

对于合并,指定参数:/base:%3 /mine:%2 /theirs:%1 /basename:%8 /minename:%7 /theirsname:%6 /merged:%4 /mergedname:%9

有关各种合并工具(包括其他文字比较工具,如DiffDoc.exe)的参数的其他信息可以在on James Manning's MSDN blog找到。您也可以在invoking the word comparison tool from the command line的另一个stackoverflow问题中找到使用。

+0

我受益于此,谢谢。 – oqx 2012-05-14 08:46:53

+2

我将[diff-doc.js](http://code.google.com/p/tortoisesvn/source/browse/trunk/contrib/diff-scripts/diff-doc.js)的副本保存到目录中用作命令并给它参数“%1%2”。很棒。 – 2013-02-13 00:05:36

+0

为了扩展@DanielBallinger的说法,实际上有许多文件格式的脚本(Word,Excel,Powerpoint,exe/dll等)[这里](https://code.google.com/p/tortoisesvn/)源/浏览/中继/了contrib/DIFF-脚本/)。 – sclarke81 2014-08-07 10:42:12