问题
I have a bad integration changelist in perforce. I want to back it out, and redo it more carefully (and possibly in smaller increments).
I used Perforce's rollback
command to revert to a previous version of the files, but when I attempted to redo the Integration, Perforce claimed there was nothing to be done. Apparently, rollback simply reverts the files, but does nothing about the associated integration-related metadata. So when I try to re-integrate, Perforce thinks "you already integrated two versions ago - nothing to do now".
Is there any way I can undo a changelist that involved integration, and leave the depot in a state where I can actually do the integration over again?
It's a large project, and integration was over 2,000 files, so I really don't want to be stuck doing this manually.
回答1:
As you have seen, rolling back the changelist won't "undo" the integration. The integration records are stored once and for all after an integration happens in the perfroce database.
If you want to do the integration over, you can. You can use the '-f' flag from the command line to force an integration without regard to previous integration history. Use of this flag will, in essence, start your integration over. If you are using p4v, there is an option under "advanced options" in the integration dialog that performs the same operation.
If you want to reintegrate only a certain revision range (i.e. from a specific date), make sure that you specify that as well. Otherwise, if you are redoing all the integrations, you should be good to go. The help file on integrate does indicate that usage of -f without a revision range will force p4 resolve to perform merges without a common base, so be on the lookout for that as well. If you are starting over with a full integrate from all revisions of the source file, then this caveat won't apply I think.
HTH.
回答2:
One possibility (though it isn't recommended) is to "p4 obliterate" the head revisions of the integrated files (target files that is). It's essential that the files weren't modified yet in a subsequent change.
Only a perforce user with the appropriate rights (super I think) can do that.
Since this removes all traces of the integration (including the diffs, history, all meta-data) it is not recommended. It cannot be undone.
I just mentioned this here for the sake of completeness. If you think you need this, be very careful not to make a mistake.
回答3:
I would suggest that you hone your forced integration to just the filelist contained in the specific integration
p4 describe [ChangeList] | grep "^\.\.\."
else you could impact more files than intended (any that have changed SINCE your submission) or accidentally act on a wider scope.
来源:https://stackoverflow.com/questions/5198180/how-can-i-undo-an-integration-in-perforce-and-still-be-able-to-redo-it