How to use TortoiseMerge from Perforce P4V?
Asked Answered
A

3

1

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

Alible answered 28/9, 2012 at 9:16 Comment(0)
A
3

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.

Alible answered 28/9, 2012 at 10:51 Comment(3)
Did you try configuring it as the merge tool? What was the error?Portis
Vote at p4ideax.com/ideas/366412/…Alible
p4ideax is not really the place to report issues. Something like this is best reported to [email protected] or the Perforce forumsSpermatozoid
P
9

You can do this by creating a bat file. In the bat file you can call the merge program with the correct arguments. This is the content of my bat file:

TortoiseMerge.exe /base:%1 /theirs:%2 /mine:%3 /merged:%4

The settings in p4 %b %1 %2 %r : Settings in P4

As you can see I called my bat file "p4Helper.bat"

Photochronograph answered 6/11, 2013 at 14:29 Comment(2)
Perfect! Thank you! I've been beating my head against a wall for a while now trying to get this to work.Yankee
After so long, this is still broken. This is just amazing.Perfuse
A
3

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.

Alible answered 28/9, 2012 at 10:51 Comment(3)
Did you try configuring it as the merge tool? What was the error?Portis
Vote at p4ideax.com/ideas/366412/…Alible
p4ideax is not really the place to report issues. Something like this is best reported to [email protected] or the Perforce forumsSpermatozoid
S
1

There is an existing enhancement request because P4V does not substitute values for %b, %1, %2, and %r if these arguments are not by themselves. For example, P4V does not substitute:

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

which are needed by TortoiseMerge.

However, one user reported that the command worked once he added the quotes around the pathname due to the spaces in it. For example:

start /WAIT "C:/Program Files/Beyond Compare 3/BComp.exe" %1 %2 %3 /mergeoutput=%4

Thus as a workaround, you can augment the %b %1 %2 %r arguments in a script that calls TortoiseMerge. In TortoiseMerge's case, you would have a line like this:

 c:"\the_path_to_TortoiseMerge" /base:%1 /theirs:%2 /mine:%3 /merged:%4
Spermatozoid answered 28/8, 2014 at 21:30 Comment(2)
Hi. It sounds like you work for Perforce. Could you report the bug for us?Alible
Hello! Yes, you have already been added to the issue report for this. :-)Spermatozoid

© 2022 - 2024 — McMap. All rights reserved.