Perforce Public Knowledge Base - Resolving File Actions
Reset Search
 

 

Article

Resolving File Actions

« Go Back

Information

 
Problem
This article summarizes the 'action' resolve implementation in the generation 3 integration engine and provides examples of each. The generation 3 engine is optionally available in 2011.1+ releases and is the default beginning with the 2013.2 Server release. For details on the history of Perforce integration engines, see A Brief History of Integration.
Solution

Action resolves refer to any file resolve which does not involve content.  They are:

  • Branch Resolve
  • Delete Resolve
  • Move Resolve
  • Filetype Resolve
  • Attribute Resolve

By default, any required resolve listed above as well as a required content resolve are attempted during a resolve.

If you want to limit the type of resolving that will be attempted, you need to use one or more of the flags listed below with the p4 resolve command.

 -Aa  Resolve attribute changes.
 -Ab  Resolve file branching.
 -Ac  Resolve file content changes.
 -Ad  Resolve file deletions.
 -Am  Resolve moved and renamed files.
 -At  Resolve filetype changes.

Branch Resolve

To illustrate how action resolves work, let's start with "Branch Resolve."  A branch resolve typically happens when you are trying to merge an edit into a deleted file. 

CMD: mkdir main

CMD: echo "t" > main\a

CMD: p4 add main\a
  //depot/resolve_test/main/a#1 - opened for add

CMD: p4 submit -d "a added"
  Submitting change 5584.
  Locking 1 files ...
  add //depot/resolve_test/main/a#1
  Change 5584 submitted.

CMD: p4 integ main\... rel\...
  //depot/resolve_test/rel/a#1 - branch/sync from //depot/resolve_test/main/a#1

CMD: p4 submit -d "integ from main to rel"
  Submitting change 5585.
  Locking 1 files ...
  branch //depot/resolve_test/rel/a#1
  Change 5585 submitted.

CMD: p4 edit main\a
  //depot/resolve_test/main/a#1 - opened for edit

CMD: echo more >> main\a

CMD: p4 delete rel\a
  //depot/resolve_test/rel/a#1 - opened for delete

CMD: p4 submit -d "edit src and delete target"
  Submitting change 5586.
  Locking 2 files ...
  edit //depot/resolve_test/main/a#2
  delete //depot/resolve_test/rel/a#2
  Change 5586 submitted.

CMD: p4 integ -o main\... rel\...
  //depot/resolve_test/rel/a#2 - sync/delete from //depot/resolve_test/main/a#2


CMD: p4 resolve
  C:/QA/clients/p4d/resolve/resolve_test\rel\a - resolving branch from //depot/resolve_test/main/a#2
  Branch resolve:
  at: branch
  ay: ignore
  Accept(at/ay) Skip(s) Help(?) s: at
  //resolve_test/rel/a - branch from //depot/resolve_test/main/a

CMD: p4 submit -d "branch resolve"
  Submitting change 5587.
  Locking 1 files ...
  branch //depot/resolve_test/rel/a#3
  Change 5587 submitted.

In the above example, an interactive resolve is launched and "at" (accept theirs) is selected to over-write the deleted destination file with the edited source file. 

See the revision graph below for details: 


Delete Resolve

A delete resolve normally happens when you are trying to merge a delete into an edited file. 

CMD: p4 integ main\... rel\...
  //depot/resolve_test/rel/a#1 - branch/sync from //depot/resolve_test/main/a#1

CMD: p4 submit -d "integ from main to rel"
  Submitting change 5589.
  Locking 1 files ...
  branch //depot/resolve_test/rel/a#1
  Change 5589 submitted.

CMD: p4 edit rel\a
  //depot/resolve_test/rel/a#1 - opened for edit

CMD: echo more >> rel\a

CMD: p4 delete main\a
  //depot/resolve_test/main/a#1 - opened for delete

CMD: p4 submit -d "delete src and edit target"
  Submitting change 5590.
  Locking 2 files ...
  delete //depot/resolve_test/main/a#2
  edit //depot/resolve_test/rel/a#2
  Change 5590 submitted.

CMD: p4 integ -o main\... rel\...
  //depot/resolve_test/rel/a#2 - integrate from //depot/resolve_test/main/a#2


CMD: p4 resolve
  C:/QA/clients/p4d/resolve/resolve_test\rel\a - resolving delete from //depot/resolve_test/main/a#2
  Delete resolve:
  at: delete
  ay: ignore
  Accept(at/ay) Skip(s) Help(?) s: at
  //resolve_test/rel/a - delete from //depot/resolve_test/main/a

CMS: p4 submit -d "delete resolve"
  Submitting change 5591.
  Locking 1 files ...
  delete //depot/resolve_test/rel/a#3
  Change 5591 submitted.

In the above example,  the target file is deleted due to selecting "at" (accept theirs) to propagate the deleted source file.

See the revision graph below for details: 



Move Resolve

If a source or target file or both source and target files are renamed, a move resolve is needed after an integration. 

CMD: p4 integ main\... rel\...
  //depot/resolve_test/rel/a#1 - branch/sync from //depot/resolve_test/main/a#1

CMD: p4 submit -d "integ from main to rel"
  Submitting change 5597.
  Locking 1 files ...
  branch //depot/resolve_test/rel/a#1
  Change 5597 submitted.

CMD: p4 edit rel\a
  //depot/resolve_test/rel/a#1 - opened for edit

CMD: p4 move rel\a rel\b
  //depot/resolve_test/rel/b#1 - moved from //depot/resolve_test/rel/a#1

CMD: p4 edit main\a
  //depot/resolve_test/main/a#1 - opened for edit

CMD: echo more >> main\a

CMD: p4 submit -d "edit src and move target"
  Submitting change 5598.
  Locking 3 files ...
  edit //depot/resolve_test/main/a#2
  move/delete //depot/resolve_test/rel/a#2
  move/add //depot/resolve_test/rel/b#1
  Change 5598 submitted.

CMD: p4 integ -o main\... rel\...
  //depot/resolve_test/rel/b#1 - integrate from //depot/resolve_test/main/a#2 using base //depot/resolve_test/main/a#1 (re
  mapped from //depot/resolve_test/rel/a)


CMD: p4 resolve
  C:/QA/clients/p4d/resolve/resolve_test\rel\b - merging //depot/resolve_test/main/a#2
  Diff chunks: 0 yours + 1 theirs + 0 both + 0 conflicting
  Accept(a) Edit(e) Diff(d) Merge (m) Skip(s) Help(?) at: a
  //resolve_test/rel/b - copy from //depot/resolve_test/main/a
  C:/QA/clients/p4d/resolve/resolve_test\rel\b - resolving move to //depot/resolve_test/rel/a
  Filename resolve:
  at: //depot/resolve_test/rel/a
  ay: //depot/resolve_test/rel/b
  Accept(a) Skip(s) Help(?) ay: at
  //depot/resolve_test/rel/a - moved from //depot/resolve_test/rel/b

CMD: p4 submit -d "move resolve"
  Submitting change 5599.
  Locking 2 files ...
  move/add //depot/resolve_test/rel/a#3
  move/delete //depot/resolve_test/rel/b#2
  Change 5599 submitted.

In the above example, you see the source file is being remapped from the target file "rel\a" to "rel\b" and merge the content change from "main" to "rel".   However, during the resolve process, "accept theirs" is selected instead of "accept yours."  This action deletes "rel\b" and adds"rel\a". 

See the revision graph below for details: 



FileType Resolve

A filetype resolve normally happens when a user changes the filetype of the source or the destination or both. 

CMD: p4 integ main\... rel\...
  //depot/resolve_test/rel/a#1 - branch/sync from //depot/resolve_test/main/a#1

CMD: p4 submit -d "integ from main to rel"
  Submitting change 5605.
  Locking 1 files ...
  branch //depot/resolve_test/rel/a#1
  Change 5605 submitted.

CMD: p4 edit -t +k rel\a
  //depot/resolve_test/rel/a#1 - opened for edit

CMD: p4 edit -t +C main\a
  //depot/resolve_test/main/a#1 - opened for edit

CMD: echo more >> main\a

CMD: p4 submit -d "edit src and move target"
  Submitting change 5606.
  Locking 2 files ...
  edit //depot/resolve_test/main/a#2
  edit //depot/resolve_test/rel/a#2
  Change 5606 submitted.
  //depot/resolve_test/rel/a#2 - refreshing

CMD: p4 integ -o main\... rel\...
  //depot/resolve_test/rel/a#2 - integrate from //depot/resolve_test/main/a#2 using base //depot/resolve_test/main/a#1


CMD: p4 resolve
  C:/QA/clients/p4d/resolve/resolve_test\rel\a - merging //depot/resolve_test/main/a#2
  Diff chunks: 0 yours + 1 theirs + 0 both + 0 conflicting
  Accept(a) Edit(e) Diff(d) Merge (m) Skip(s) Help(?) at: a
  //resolve_test/rel/a - copy from //depot/resolve_test/main/a
  C:/QA/clients/p4d/resolve/resolve_test\rel\a - resolving filetype from //depot/resolve_test/main/a#2
  Filetype resolve:
  at: (text+C)
  ay: (text+k)
  am: (text+Ck)
  Accept(a) Skip(s) Help(?) am: am
  //depot/resolve_test/rel/a#2 - reopened; type text+Ck

p4 submit -d "filetype resolve"
  Submitting change 5607.
  Locking 1 files ...
  integrate //depot/resolve_test/rel/a#3
  Change 5607 submitted.
  //depot/resolve_test/rel/a#3 - refreshing


In the above example, the filetype of the source as well as target files is changed.  In the process, a destination file is created which is ctext combined with ktext. 

See the revision graph below for details: 


Attribute Resolve

An attribute resolve normally happens when a user adds or modified an attribute of the source or the destination or both. 

CMD: p4 integ main\... rel\...
  //depot/resolve_test/rel/a#1 - branch/sync from //depot/resolve_test/main/a#1

CMD: p4 submit -d "integ from main to rel"
  Submitting change 255227.
  Locking 1 files ...
  branch //depot/resolve_test/rel/a#1
  Change 255227 submitted.

CMD: p4 edit main\a
//depot/resolve_test/main/a#1 - opened for edit

CMD: p4 attribute -n attr1 -v value1 main\a
  //ws/resolve_test/main/a#1 - attr1 set

CMD: p4 submit -d "add attribute to a"
  Submitting change 255228.
  Locking 1 files ...
  edit //depot/resolve_test/main/a#2
  Change 255228 submitted.

CMD: p4 integ -o main\... rel\...
  //depot/resolve_test/rel/a#1 - integrate from //depot/resolve_test/main/a#2 using base //depot/resolve_test/main/a#1

CMD: p4 resolve
  c:\resolve_test\rel\a - merging //depot/resolve_test/main/a#2
  Diff chunks: 0 yours + 0 theirs + 0 both + 0 conflicting
  Accept(a) Edit(e) Diff(d) Merge (m) Skip(s) Help(?) at:
  //depot/resolve_test/rel/a - copy from //depot/resolve_test/main/a
  c:\Calls\3758734\12.2\integ-history-rebuild-root\ws\depot\resolve_test\rel\a - resolving attributes from //depot/resolve_
  Attribute resolve:
  at: overwrite your open attributes with their set of 1 attribute(s)
  ay: leave your set of 0 open attribute(s) unchanged
  Accept(a) Skip(s) Help(?) ay: at
  //ws/resolve_test/rel/a - copy from //depot/resolve_test/main/a

CMD: p4 submit -d "attribute resolve"
  Submitting change 255229.
  Locking 1 files ...
  integrate //depot/resolve_test/rel/a#2
  Change 255229 submitted.

In the above example, an attribute is added to the source file.  This attribute is merged into the target file, and can be copied or ignored during the attribute resolve. 

See the revision graph below for details:
 

 
Note that only a content resolve is stored; no record of filetype or attribute resolves is stored in in the database. Comparisons are done based on the current filetype or attribute values of revisions involved in later integrations to determine whether or not a filetype or attribute change needs to be resolved. 
 

Multiple Resolves Combined:

In this example, several resolves are combined during a submit.  As it was mentioned previously, the resolving can be limited with one of  the "-A*" flags.  In this example, a non-interactive resolve is followed by an interactive resolve. 

CMD: p4 integ main\... rel\...
  //depot/resolve_test/rel/a#1 - branch/sync from //depot/resolve_test/main/a#1

CMD: p4 submit -d "integ from main to rel"
  Submitting change 5612.
  Locking 1 files ...
  branch //depot/resolve_test/rel/a#1
  Change 5612 submitted.

CMD: p4 edit -t +k rel\a
 //depot/resolve_test/rel/a#1 - opened for edit

CMD: p4 move rel\a rel\b
 //depot/resolve_test/rel/b#1 - moved from //depot/resolve_test/rel/a#1

CMD: p4 edit -t +C main\a
 //depot/resolve_test/main/a#1 - opened for edit

CMD: echo more >> main\a

CMD: p4 move main\a main\d
  //depot/resolve_test/main/d#1 - moved from //depot/resolve_test/main/a#1

CMD: p4 submit -d "edit src and move target"
  Submitting change 5613.
  Locking 4 files ...
  move/delete //depot/resolve_test/main/a#2
  move/add //depot/resolve_test/main/d#1
  move/delete //depot/resolve_test/rel/a#2
  move/add //depot/resolve_test/rel/b#1
  Change 5613 submitted.
  //depot/resolve_test/rel/b#1 - refreshing

CMD: p4 integ -o main\... rel\...
  //depot/resolve_test/rel/b#1 - integrate from //depot/resolve_test/main/d#1 using base //depot/resolve_test/main/a#1 (re
  mapped from //depot/resolve_test/rel/d)

CMD: p4 resolve -Ac -at
  C:/QA/clients/p4d/resolve/resolve_test\rel\b - vs //depot/resolve_test/main/d#1
  //resolve_test/rel/b - copy from //depot/resolve_test/main/d

CMD: p4 resolve
 C:/QA/clients/p4d/resolve/resolve_test\rel\b - resolving filetype from //depot/resolve_test/main/d#1
 Filetype resolve:
 at: (text+C)
 ay: (text+k)
 am: (text+Ck)
 Accept(a) Skip(s) Help(?) am: am
 //depot/resolve_test/rel/b#1 - reopened; type text+Ck
 C:/QA/clients/p4d/resolve/resolve_test\rel\b - resolving move to //depot/resolve_test/rel/d
 Filename resolve:
 at: //depot/resolve_test/rel/d
 ay: //depot/resolve_test/rel/b
 Accept(at/ay) Skip(s) Help(?) s: at
 //depot/resolve_test/rel/d - moved from //depot/resolve_test/rel/b

CMD: p4 submit -d "content, move, and filetype resolves"
  Submitting change 5614.
  Locking 2 files ...
  move/delete //depot/resolve_test/rel/b#2
  move/add //depot/resolve_test/rel/d#1
  Change 5614 submitted.
  //depot/resolve_test/rel/d#1 - refreshing

In the example, content is resolved by "accepting theirs."  This limits the resolving which can be performed, however the file move and filetype change have to be resolved before a submit can happen.  This is done by re-running the "p4 resolve" command. 

See the revision graph below for details: 



For the further details on actions resolves, please take a look at the following two blog articles written by Sam Stafford: 
Related Links
  •  

Feedback

 

Was this article helpful?


   

Feedback

Please tell us how we can make this article more useful.

Characters Remaining: 255