Search code examples
diffperforcep4vwinmerge

How can WinMerge be used with Perforce Visual Client (P4V)?


I like using the WinMerge file comparison tool. I'd like to use it with Perforce's P4V tool to be my diff editor.

How can Perforce be configured to allow this?


Solution

  • This is possible. Follow these steps:

    1. In the P4V Client, choose: Edit > Preferences
      --> The Preferences dialog appears

    2. In the dialog, in the list on the left, select Diff towards the bottom.

    3. Change the "Default diff application" to be "Other application", then set:

    Location:     C:/Program Files (x86)/WinMerge/WinMergeU.exe
    Arguments:    /ul /ur /e %1 %2
    

    Per WinMerge's Command-line parameters documentation:

    • /ul prevents WinMerge from adding the left path to the Most Recently Used (MRU) list. External applications should not add paths to the MRU list in the Select Files or Folders dialog.
    • /ur prevents WinMerge from adding the right path to the Most Recently Used (MRU) list. External applications should not add paths to the MRU list in the Select Files or Folders dialog.
    • /e enables you to close WinMerge with a single Esc key press. This is useful when you use WinMerge as an external compare application: you can close WinMerge quickly, like a dialog. Without this parameter, you might have to press Esc multiple times to close all its windows.

    Perforce Preferences dialog

    There is documentation on the WinMerge site that describes how to set it up to work with Visual Studio, SVN and Visual Source Safe, too.