views:

208

answers:

3

I'd like see a visual diff of a branched file. So I do this

p4 diff2 -b branchname main.cpp

One problem... it's not visual and external diff isn't supported. http://www.perforce.com/perforce/doc.current/manuals/cmdref/diff2.html

p4 diff2 does not use the diff program specified by the environment variable P4DIFF.
The diff algorithm used by p4 diff2 runs on the machine hosting the Perforce server,
and always uses the server's built-in diff routine.

I want my visual diff. How do I get it?

+2  A: 

Maybe easiest to do the diff from P4V?

Other than that, you might have to p4 print the two files to some local temporaries, and then run the diff on those?

Douglas Leeder
A: 

You should give Kdiff3 a try if you're not using it already.

For your scenario, I'd do this (from old-school P4Win):

  • go to the first file -> right click -> explore. This opens up the file in explorer. Right-click it -> Kdiff3 -> Save [file name] for later
  • go to the second file -> right click -> explore -> right-click file -> Kdiff3 -> Compare With -> [first file]

Ta-da!

I am assuming your local repository contains both files. I'm also assuming you're running Windows, but this could be adapted to other OS-es, as Kdiff3 is multi-platform.

Cristi Diaconescu
A: 

You may be able to pull this off. The Perforce blog has an entry on calling p4v tasks from the command line.
I could only get the diffdialog command to work on a single file, but maybe if you play around with it you could figure out something.

Chance