在Visual Studio 2008中合并时强制比较文件 [英] Force comparison of files when merging in Visual Studio 2008

查看:82
本文介绍了在Visual Studio 2008中合并时强制比较文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前,当我右键单击->在Visual Studio 2008中合并特定文件时,它会尝试(并且通常会成功)将文件自动合并到指定的目标.

Currently when I right-click -> Merge on a specific file in Visual Studio 2008 it attempts (and often succeeds) to automatically merge the file to my indicated target.

如何强制VS始终允许我在合并工具中手动比较和合并文件?

How can I force VS to always allow me to manually compare and merge the file in my merge tool?

我应该提到我的源代码控制是TFS.

I should mention that my source control is TFS.

推荐答案

这里确实存在两个潜在问题:

There are really two potential issues here:

  1. 作为合并计算的一部分,服务器确定自上次两者完全同步以来,尚未对目标文件提交任何更改.因此,简单地覆盖目标文件是安全的(无论如何使用TFS语义).

  1. As part of the Merge calculation, the server determines that no changes have been committed against the target file since the last time the two were fully in sync. Therefore, it's safe (by TFS semantics anyway) to simply overwrite the target file.

两个分支中都有历史记录,因此服务器将文件声明为冲突状态.现在由客户选择解决方案.

There are history records in both branches, so the server declares the file to be in a conflict state. It's now up to the client to choose a resolution.

  • 您可以决定按原样保留源或目标.
  • 您可以在配置的工具中选择手动合并.
  • 您可以请求自动合并(通过 tf resolve -auto:acceptmerge 或外部对话框上的自动合并所有"按钮,或内部对话框上的为我合并更改"单选按钮)
    • 如果自动合并失败,将为您显示相同的选择,只是自动合并将显示为灰色
    • You can decide to keep either the source or the target as-is.
    • You can opt for a manual merge in your configured tool.
    • You can request an AutoMerge (via tf resolve -auto:acceptmerge, or the Auto Merge All button on the outer dialog, or the "merge changes for me" radio button on the inner dialog)
      • If the AutoMerge fails, you'll be presented with the same choices except that AutoMerge will be greyed out

      对于情况1,您无能为力.除非服务器代码中存在未修补的严重缺陷,历史数据库中的损坏或[最有可能]您以前的解决方案选择严重误导了TFS有关您的真实意图,否则这确实应该是安全的.最坏的情况是,您始终有机会进行构建和构建.在签入任何内容之前,针对您的待处理合并运行测试.

      There is nothing you can do about situation #1. It really should be safe unless there is a serious unpatched defect in the server code, corruption in the history database, or [most likely] your previous resolution choices have dramatically misled TFS about your true intentions. Worst case scenario, you always have the chance to build & run tests against your pending merge before anything gets checked in.

      如您所见,情况2有很多皱纹.尚不清楚您要阻止该过程的哪一步(如果有的话).好消息是,一旦控制权转移给客户,您将拥有广泛(且易于扩展)的选择范围.唯一棘手的部分是确保您了解每个操作的后果.诚然,在这一点上,UI和文档都不是很清楚.根据需要回复并提供有关您问题的更多详细信息.

      As you can see, there are many wrinkles to situation #2. It's unclear which step of that process you want to interdict, if any. Good news is, once control is transferred to the client, you have a broad (and easily extended) range of choices. Only tricky part is making sure you understand the consequences of each; admittedly, neither the UI nor the documentation is completely clear on this count. Reply with more details of your issue as needed.

      这篇关于在Visual Studio 2008中合并时强制比较文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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