Reputation: 34267
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?
Upvotes: 9
Views: 9067
Reputation: 731
your easiest way to diff a full directory of opened files will be setting p4 diff tool to tkdiff.
setenv P4DIFF tkdiff
and then you can diff a directory by
p4 diff <path_to_dir>/...
it will open tkdiff file by file for all opened files.
Upvotes: 0
Reputation: 3386
Use p4 diff
.
from http://www.perforce.com/perforce/doc.021/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."
Upvotes: 0
Reputation: 2700
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.
Upvotes: 0
Reputation: 35641
You should give Kdiff3 a try if you're not using it already.
For your scenario, I'd do this (from old-school P4Win):
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.
Upvotes: 0
Reputation: 53310
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?
Upvotes: 7