pancakes
pancakes

Reputation: 761

Perforce: Integrate all revisions at once, but with the same result as integrating the revisions one by one?

Situation:

  1. test/... containing a.txt was branched into test2/...
  2. test/a.txt was deleted, and then re-added and edited
  3. Now I'd like to integrate all revisions from test/... to test2/....

revision graph

In my actual use case, there can be many files like a.txt

What I've tried:

I've tried three methods:

Method 1 - Integrating all revisions results in a conflict as it thinks that test/a.txt#3 is a new, unrelated file:

>p4 integrate //depot/test/... //depot/test2/...
//depot/test2/a.txt#1 - integrate from //depot/test/a.txt#3,#4

>p4 resolve -as
c:\depot\test2\a.txt - merging //depot/test/a.txt#3,#4
Diff chunks: 0 yours + 0 theirs + 0 both + 1 conflicting

Method 2 - Integrating using the p4 integrate -Di works in isolation, but I'm trying to make this part of an automated process that will integrate thousands of files at once. Since the -Di flag can't be used in all cases, it would at minimum need to check the file history to see if the file was moved/renamed, and starts to get very messy.

Method 3 - Integrating one revision at a time works, but only if I submit each revision separately. Otherwise multiple integrations on the same file can't be opened simultaneously. This is slow if I have hundreds of changelists to integrate, and results in unnecessary integrate changes in the file history.

>p4 integrate //depot/test/a.txt#2 //depot/test2/a.txt
//depot/test2/a.txt#1 - delete from //depot/test/a.txt#2

>p4 integrate //depot/test/a.txt#3 //depot/test2/a.txt
//depot/test2/a.txt - can't integrate (already opened for delete)

Question:

Method 3 has the result I want (no conflicts), but can I achieve that while integrating all revisions in one go as in Method 1?

Upvotes: 2

Views: 186

Answers (0)

Related Questions