Using the Built in Visual Studio Diff Tool to View P4VS's Diffs

孤街浪徒 提交于 2019-12-12 02:07:58

问题


Visual Studio has a fantastic internal diff tool: https://www.visualstudio.com/en-us/docs/tfvc/compare-files

I'm using Perforce in Visual Studio via the P4VS plugin. The plugin adds the "Diff" sub-menu when you right-click on a file's tab. But by default any diff operations are carried out by P4M, rather than using Visual Studio's internal diff tool:

To it's credit, P4VS does allow for the selection of a different diff app. But the provision is for a command line operation. I don't know how to make it use the current instance of Visual Studio's diff tool. Is there a way to do that?


回答1:


You can absolutely use Visual Studio's Diff tool! You just need to run devenv with the /diff option: https://msdn.microsoft.com/en-us/library/jj874068.aspx

Doing so will spawn the diff in the current Visual Studio instance.

To set this up in the "Default diff application" section of the "Source Control" > "Perforce - Diff/Merge" options dialog that you specify in your question:

  1. Select "Other"
  2. In "Location" specify the path to your devenv.exe (default path is: "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe")
  3. For "Arguments" use "/diff %1 %2"

So your dialog will look something like this:



来源:https://stackoverflow.com/questions/43185880/using-the-built-in-visual-studio-diff-tool-to-view-p4vss-diffs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!