Reputation: 16168
I have following changelists in perforce:
1 - some work on //depot/A/file
2 - some work on //depot/A/file
3 - branching of //depot/A to //depot/B
4 .... - some work on //depot/A/file
And I want to backout changelist 2
on //depot/B
.
I've tried following:
p4 sync //depot/B/file@1
p4 edit //depot/B/file
p4 sync //depot/B/file@2
....
but error occured on first line.
//depot/B/file@1 - no file(s) at that changelist number.
Is there any way how to achieve this without submitting into //depot/A
branch?
Upvotes: 1
Views: 780
Reputation: 71424
Here's what I'd do:
p4 copy //depot/A/...@1 //depot/B/...
p4 submit
p4 merge //depot/A/...@2 //depot/B/...
p4 resolve -ay
p4 submit
p4 merge //depot/A/... //depot/B/...
p4 resolve -am
p4 resolve
p4 submit
You could potentially do this all within a single changelist as well, but it gets a little trickier then -- the above keeps it simple and leaves a history that is easy to follow (i.e. each revision is clearly "copied from this change," "ignored this change", or "merged these changes" rather than a single revision that mushes those actions all together).
Upvotes: 3
Reputation: 1696
Based on your attempt to sync to //depot/B/file@1, I'm assuming the file did not previously exist on //depot/B/...?
If my assumption is correct, you'll want to delete the file:
p4 delete //depot/B/file
and submit it.
If my assumption is incorrect and your newly-branched file is @2 or higher, then:
p4 edit //depot/B/file@1
p4 resolve -ay //depot/B/file
p4 submit
Upvotes: 0
Reputation: 3249
You can't simply take out 2 from B because it came together from A as one change (1 & 2).
I think the only way to achieve this is:
p4 edit //depot/B/file; p4 sync //depot/B/file#0; p4 submit //depot/B/file
or p4 delete //depot/B/file; p4 submit //depot/B/file
)Having said that, this has two drawbacks:
So, even though it's more elaborate, the only correct way to revert an integration is exactly what you don't want to do:
Upvotes: 0