TFS下的MS Office文件diff [英] MS Office file diff under TFS

查看:95
本文介绍了TFS下的MS Office文件diff的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Team Foundation Server Source Explorer中比较两个版本的MS Word doc/Excel书籍时,结果是无聊的二进制填充不同"对话框.

When you compare two versions of MS Word doc/Excel book in Team Foundation Server Source Explorer, the result is the boring "Binary filles differ" dialog.

虽然不一定要那样.相关的应用程序(Word/Excel)具有出色的内置差异界面.使用启用了版本控制的SharePoint文件库并与以前的版本进行比较时,您可以见证它.此外,TortoiseSVN在进行差异处理时也会显示出来.

It does not have to be that way though. The relevant apps (Word/Excel) have an excellent built-in diff interface. You can witness it when you work with versioning-enabled SharePoint file library and do compare with a previous version. Also, TortoiseSVN brings it up when you do diffs.

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

Question - can I enable this in TFS?

推荐答案

您可以配置比较(diff)并按文件类型(扩展名)合并工具.可通过工具->选项->源代码控制-> Visual Studio Team Foundation Server->配置用户工具"按钮或通过命令行使用 tf diff /configure

You can configure comparison (diff) and merge tools per file type (extension). This is available via Tools -> Options -> Source Control -> Visual Studio Team Foundation Server -> Configure User Tools" button or via the command-line with tf diff /configure

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

In order to set up a comparison tool, you'll specify the extension (use .* if you want it to be used for all files not otherwise specified), the operation you're setting up (Compare or Merge), the command to invoke and the arguments to the command. For arguments, the variables available for use are the following:

%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

To use TortoiseSVN -- which seems like it does what you want -- you would specify the command as the file path to TortoiseMerge.exe

为进行比较,请指定参数:/base:%1 /mine:%2 /basename:%6 /minename:%7

For comparisons, specify the arguments: /base:%1 /mine:%2 /basename:%6 /minename:%7

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

For merges, specify the arguments: /base:%3 /mine:%2 /theirs:%1 /basename:%8 /minename:%7 /theirsname:%6 /merged:%4 /mergedname:%9

关于各种合并工具(包括其他单词比较工具,例如DiffDoc.exe)的自变量的此信息和其他信息可以找到调用命令行中的单词比较工具.

This and other information on the arguments for various merge tools (including other word comparison tools like DiffDoc.exe) can be found on James Manning's MSDN blog. You may also find use in another stackoverflow question on invoking the word comparison tool from the command line.

这篇关于TFS下的MS Office文件diff的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆