Jifan Wang
Jifan Wang

Reputation: 67

Can perforce command line mark a file as merged?

In Git, I can use add to mark a file as merged. In SVN, I can use resolved to mark a file as merged.

But in perforce, I cannot find a command to do this job. Do anyone know if perforce has a command like this?

Update: I'm trying to develop a SCC wrapper for perforce and it can merge files within its environment. But after the merge (not by perforce), how can I tell perforce that this file is already merged and remove the conflict flag?

Upvotes: 1

Views: 1009

Answers (2)

the_cat_lady
the_cat_lady

Reputation: 951

First you must integrate one file (the source) into the other file (the target).

p4 integrate //depot1/mydir/myfile //depot2/mydir/myfile

To submit the resulting changelist, you must resolve.

  1. If you don't want to change the target, resolve accepting the target (ignore source) file.
  2. If you want to overwrite the target with the source file, resolve accepting the source file.
  3. If you want to merge the two files, accept merged.

The command for each of these is:

  1. Accept target: p4 resolve -ay //depot2/mydir/myfile
  2. Accept source: p4 resolve -at //depot2/mydir/myfile
  3. Accept merged: p4 resolve -am //depot2/mydir/myfile

Finally, submit your change:

p4 submit # for default changelist
p4 submit -c 12345 # submit changelist # 12345

(there are additional resolve options that are interactive, outlined here: http://www.perforce.com/perforce/doc.current/manuals/cmdref/resolve.html#1040665

Upvotes: 2

Bryan Pendleton
Bryan Pendleton

Reputation: 16349

Probably you are looking for 'p4 resolve -am'.

If you provide more information, that would help others give you advice.

Upvotes: 0

Related Questions