The generation 3 engine can resolve files that are opened for delete or branch. Previously, branch and delete actions were not resolvable. The generation 3 integration engine can also resolve changes to file types, and do independent resolves of files having changes to both content and type.
2004.2 to 2010.2 integration engine [generation two]
If a file is deleted in Perforce, a new head revision marks the file as a delete. The delete can be propagated when integrating if the target has been fully integrated with the source. If not, Perforce does not integrate the file unless a special flag is used (-d, -Dt, -Ds). A file can be opened for delete or branch depending on if the delete is on the source or target file, respectively.
2011.1+ integration engine [generation three]
In P4D version 2011.1/428846
and greater, the generation 2 engine is the default for the p4 integrate
command. Users of P4D version 2011.1 prior to patch release 428846
have the generation 3 engine enabled by default.
When using the generation 3 engine, no special flags are required to propagate a delete or open a file for branch. Deletes are now handled during the p4 resolve
The p4 copy
and p4 merge
commands always use the generation 3 engine.
Source file deleted, un-integrated revisions on the target file
p4 integ FA.cpp FB.cpp
//depot/main/FB.cpp#2 - integrate from //depot/main/FA.cpp#3
c:\bruno_ws\main\FB.cpp - resolving delete from //depot/main/FA.cpp#3
Accept(at/ay) Skip(s) Help(?) s: at
//bruno_ws/main/FB.cpp - delete from //depot/main/FA.cpp
Note: 'ay: ignore', accepts the target file, not propagating the delete, and 'at: delete', propagates the delete and opens the target file for delete.
Target file deleted, un-integrated revisions on the source file
p4 integ JA.cpp JB.cpp
//depot/main/JB.cpp#2 - sync/delete from //depot/main/JA.cpp#2
c:\bruno_ws\main\JB.cpp - resolving branch from //depot/main/JA.cpp#2
Accept(at/ay) Skip(s) Help(?) s:
Note: 'ay: ignore', accepts the target file and the target remains deleted, and 'at: branch' propagates the edited source revision and opens the target file for branch.
Resolving all deletes
What if you want to resolve a delete instead of simply submitting?
Use p4 integ -Rd
to schedule a delete resolve.
p4 integ -Rd HA.cpp HB.cpp
//depot/main/HB.cpp#1 - integrate from //depot/main/HA.cpp#2,#3
c:\bruno_ws\main\HB.cpp - resolving delete from //depot/main/HA.cpp#2,#3
Accept(a) Skip(s) Help(?) at:
For contrast, below is the same integration as above, but without the -Rd flag. Note that no resolve is required. Also note that instead of an "integrate from" action in the output, you now see a "sync/delete" action.
p4 integ HA.cpp HB.cpp
//depot/main/HB.cpp#1 - sync/delete from //depot/main/HA.cpp#3
p4 submit -d "delete HB.cpp"
Submitting change 1422.
Locking 1 files ...
Change 1422 submitted.
Resolvable branch actions
Can files opened for 'branch' be resolved?
Yes. Use p4 integ -Rb
to resolve files which normally would be opened for branch.
p4 integ -Rb KA.cpp KB.cpp
//depot/main/KB.cpp#1 - sync/delete from //depot/main/KA.cpp#1
c:\bruno_ws\main\KB.cpp - resolving branch from //depot/main/KA.cpp#1
Accept(a) Skip(s) Help(?) at:
Resolving filetype and content changes
Here is an example of a source file which has a filetype and a content change to propagate.
p4 integ LA.cpp LB.cpp
//depot/main/LB.cpp#2 - integrate from //depot/main/LA.cpp#2
c:\bruno_ws\main\LB.cpp - merging //depot/main/LA.cpp#2
Diff chunks: 0 yours + 0 theirs + 1 both + 1 conflicting
Accept(a) Edit(e) Diff(d) Merge (m) Skip(s) Help(?) e: e
Accept(a) Edit(e) Diff(d) Merge (m) Skip(s) Help(?) ae: ae
//bruno_ws/main/LB.cpp - edit from //depot/main/LA.cpp
LB.cpp - resolving filetype from //depot/main/LA.cpp#2
Accept(a) Skip(s) Help(?) at: at
//depot/main/LB.cpp#2 - reopened; type text+C
The integration algorithm has been improved (in generation 3) to enable propagation of a variety of changes, including moved files, filetype and content changes as well as the ability to resolve deleted files. If more than one type of resolve is required, the end user steps through each resolve during the resolve process.
When using the generation 2 integration algorithm, "delete" actions are not "resolvable". For more information, see the following KB article: Preventing the Propagation of Deletes