0

I'm using p4merge as external merge tool for Accurev. I created a wrapper for p4merge and set the command "p4m -dw -tw 8 -nb %3% -nl %4% -nr %5% %a% %1% %2% %o%" for both acgui (Tools-Preferences-Diff/merge) and CLI (AC_MERGE_CLI variable).

It successfully works in acgui, but when I use CLI version (accurev merge <filename>), Accurev doesn't pass file titles for %3, %4 and %5.

What's wrong with it? How can I get file titles for CLI?

UPD: I'm using Accurev 6.0.1

Rom098
  • 2,445
  • 4
  • 35
  • 52

1 Answers1

1

The commands for diff and merge will need to be different asAccuRev does not pass the same parameters for both. You will need to refer to the AccuRev User CLI Guide for the list of valid parameters for both commands.

I was able to get the diff to work using the following:

c:\Program Files\Perforce\p4merge.exe -dw -tw 4 -nl "%3%" -nr "%4%"  %1% %2%

Notice the double quotes around the left and right titles and the omission of the base/ancestor parameters. Also, in a diff, there is no output file expected.

The merge command did not work due to how P4Merge is handling the output file name given by AccuRev. I received an error stating the output temp file is invalid. However, AccuRev expects the merge tool to create the file upon completion so this is an shortcoming of P4Merge. The following may be a good starting point for discussion with the Perforce folks:

c:\Program Files\Perforce\p4merge.exe -dw -tw 4 -nb "%3%" -nl "%4%" -nr "%5%" %a% %1% %2% %o%
Mike Abusheery
  • 539
  • 2
  • 6
  • Mike, actually I'm using Linux at the moment, so I can't reproduce the issue on Windows for now. I will let you know in case of the issue is on Windows too. Anyway, for testing purposes you could create p2m.bat file which just echoes its arguments to an external text file. The fact is Accurev doesn't pass %3, %4, %5 values in case I use CLI (on Linux). That is my issue. – Rom098 Feb 25 '14 at 15:29
  • It may be a bug but I found the titles need to be quoted on Windows. I suspect the same may need to be done on Linux as well. – Mike Abusheery Feb 26 '14 at 14:16
  • I wrote simple Bash script p4m " `for last; do echo $last >>~/1.txt; done eval touch $last; eval ~/opt/p4v/bin/p4merge $@; exit $?;` ". Set `AC_MERGE_CLI='p4m -dw -tw 8 -nb "%3%" -nl "%4%" -nr "%5%" %a% %1% %2% %o%'`. Then tried to merge. The result (1.txt) is `-dw -tw 8 -nb %3% -nl %4% -nr %5% /tmp/0848-e04e-527e-b4ea.4147951360.basis.1.tmp /tmp/b8cf-0d97-32cd-f820.4147951360.head.1.tmp / /tmp/2df3-abf8-7984-400e.4147951360.1.tmp` You can see that %3,4,5 are not replaced on script call. – Rom098 Mar 04 '14 at 15:21