I guess you are talking about resolving files in three way diff tool. The different versions are,
Now, to do that a little setup is needed in linux. I have a .p4config
file that defines my preferable diff tool.
P4CLIENT=mywork
P4DIFF=diff -u
P4EDITOR=vi
P4IGNORE=.p4ignore
Here P4DIFF
is set to diff -u
. To make the whole thing work the .p4config
file needs to be plugged to perforce by environment variable.
export P4CONFIG=.p4config
Now it is the sweet-spot. We need to actually do the resolve by p4 resolve
command.
p4 resolve /path/to/mysource.h
As soon as we do that, it shows that there is conflict as someone modified the original version we were working. So it prompts for our action.
/path/to/mysource.h - merging //stream/version/path/to/mysource.h#2
Diff chunks: 13 yours + 2 theirs + 0 both + 1 conflicting
Accept(a) Edit(e) Diff(d) Merge (m) Skip(s) Help(?) e: d
We can see the diff by pressing d
.
--- /path/to/mysource.h 2016-09-28 18:34:54.918709150 -0400
+++ /path/to/tmp.6365.102 2016-09-29 11:05:32.228946564 -0400
@@ -16,6 +16,7 @@
we are same in all branches
same as everywhere
+ added line
more same
@@ -28,7 +29,12 @@
here you go the conflict
+>>>> ORIGINAL //stream/version/path/to/mysource.h#1
+ the original line is here
+==== THEIRS //stream/version/path/to/mysource.h#2
+ their line is here
+==== YOURS /path/to/mysource.h
my line is here
+<<<<
Accept(a) Edit(e) Diff(d) Merge (m) Skip(s) Help(?) e: e
Now it is possible to fix this typing e
. It will open an editor where we can compare the different versions in between the +====
lines and +<<<<
lines.
Once we are done with editing we can accept by typing a
.
Accept(a) Edit(e) Diff(d) Merge (m) Skip(s) Help(?) ae: a
The whole process can be done from remote command/shell window. So there is no X-server is needed.