visual-studiodiffdifftoolp4mergep4vs

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


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:

enter image description here

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?


Solution

  • 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:

    enter image description here