Determining Which Files are Reopened for Add/Edit
PROBLEM
How can I identify files that have been opened for integrate and then reopened for edit or add? The p4 opened command does not seem to do what I want.
SOLUTION
Use both the p4 resolve -n and p4 resolved commands. The resolve preview (using the -n flag) lists integration file revisions that have been reopened for "edit'". However, p4 resolve -n does not show files reopened for "add". For that, use p4 resolved, because adds and deletes are automatically resolved.The following is an example of exposing an integration file revision re-opened for edit:
- Perform an integration (on an existing target file):
p4 integrate -i //depot/test/a //depot/test/b //depot/test/b#1 - integrate from //depot/test/a#1
-
Delete the source file, "a":
p4 delete //depot/test/a //depot/test/a#1 - opened for delete
- At this point, p4 opened gives you a full and current picture of the integrate:
p4 opened //depot/test/a#1 - delete default change (text) //depot/test/b#1 - integrate default change (text)
- Before submitting, "b" is re-opened for edit:
p4 edit //depot/test/b //depot/test/b#1 - reopened for edit
- Now p4 opened shows that "b" is opened for edit, but does not note that the file is also opened for integration:
p4 opened //depot/test/a#1 - delete default change (text) //depot/test/b#1 - edit default change (text)
- Using p4 resolve -n, you can see that a merge is involved between "a" and "b":
p4 resolve -n c:\p4_workspace\test\b - merging //depot/test/a#1The p4 resolve -n command does NOT show integrated file revisions reopened for "add". For that, you need to use p4 resolved:
p4 integ //depot/test/a //depot/test/c //depot/test/c#1 - branch/sync from //depot/test/a#1
- Here again the branch operation is visible when using p4 opened:
p4 opened //depot/test/a#1 - delete default change (text) //depot/test/b#1 - edit default change (text) //depot/test/c#1 - branch default change (text)
- But re-opening for add masks the "branch" operation:
p4 edit //depot/test/c //depot/test/c#1 - reopened for add
p4 opened //depot/test/a#1 - delete default change (text) //depot/test/b#1 - edit default change (text) //depot/test/c#1 - add default change (text)
- The integ/edit is exposed with p4 resolve -n, but the integration/add is not:
p4 resolve -n c:\p4_workspace\test\b - merging //depot/test/a#1
- Use p4 resolved to expose the integration/add case ("branch"):
p4 resolved c:\p4_workspace\test\c - branch from //depot/test/a#1
