visual-studio-2010 - TFS 下的 MS Office 文件差异

标签 visual-studio-2010 tfs ms-word ms-office

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

不过,也不必如此。相关应用程序(Word/Excel)具有出色的内置差异界面。当您使用启用版本控制的 SharePoint 文件库并与以前的版本进行比较时,您可以见证它。此外,TortoiseSVN 会在您进行差异处理时提出。

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

最佳答案

您可以为每个文件类型(扩展名)配置比较(差异)和合并工具。这可以通过 获得工具 -> 选项 -> 源代码管理 -> Visual Studio Team Foundation Server -> 配置用户工具”按钮 或通过命令行使用 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
可以在 on James Manning's MSDN blog 中找到有关各种合并工具(包括其他单词比较工具,如 DiffDoc.exe)的参数的此信息和其他信息。 .您还可以在 invoking the word comparison tool from the command line 上的另一个 stackoverflow 问题中找到用途。 .

关于visual-studio-2010 - TFS 下的 MS Office 文件差异,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5955793/

相关文章:

c# - 在 Visual Studio 2010 中使用 Mercurial

c# - 如何通过 Visual Studio 创建和运行 NUnit/WebDriver 测试套件?

tfs - 如何获得 .net 标准 2.0 项目以在 TFS2015 上构建

tfs - 程序集版本是否可以随每个 TFS 2010 版本自动更新?

vba - 如何以编程方式检查 MS Word 2007 文档的任何文档属性是否已更改?

c++ - Microsoft Visual Studio 中的 QWT 直方图和立即关闭的 Qt 插件

visual-studio-2010 - 使用 DiffMerge

powershell - 如何在 Powershell 中使用 TFS SnapIn "Add-TfsPendingChange -Edit"函数?

c# - 如何在 Word 表格中选择矩形单元格区域

VB.Net保存Word文档没有提示