Search code examples
mergeperforcep4vtortoisemerge

How to use TortoiseMerge from Perforce P4V?


How can I configure Perforce to use the tool TortoiseMerge for diff and merging?


I tried arguments

/base:%1 /mine:%2

enter image description here

following http://tortoisesvn.net/docs/release/TortoiseMerge_en/tme-automation.html and http://www.perforce.com/perforce/doc.current/manuals/p4v/Configuring_display_preferences.html#Diff . The Perforce docs say

Specify arguments for third-party diff applications in the Arguments field: Enter %1 for the name of the first file and %2 for the name of the second file. P4V replaces these placeholders with the actual filenames when calling the diff application.

Yet when I try it, TortoiseMerge errors "Can't open file %1" suggesting P4V didn't replace the arguments and left %1 as is

enter image description here


Solution

  • Sadly P4V's argument replacement is broken. You can use TortoiseMerge for diffing, but not merging.

    To set up TortoiseMerge for diffing, use the argument string %1 %2

    enter image description here

    The correct arguments for merging would be

    /base:%b /theirs:%1 /mine:%2 /merged:%r
    

    However it gives this error

    enter image description here

    Presumably what's happening is that P4V fails to replace the '%b' in /base:%b with the appropriate file path.