newcoder
newcoder

Reputation: 11

How do remove a particular change number in perforce?

I have a perforce client which synced to a particular change number. I want to remove changes for a particular change number.

eg. lets say I have a function in a file.

void printnames() {      //M
    printf("John\n");      //M
    printf("Joseph\n");    //N
    printf("Harry\n");     //M
    printf("Mary\n");      //N
}

where M and N denote the latest change numbers which added/modified these lines. I want to remove change number N(or if I may say - unsync change number N). Is it possible to do that, and what would be the steps? (I want to this for Perforce). I know I can manually p4 edit the file, but that's not what I am looking for.

Upvotes: 0

Views: 106

Answers (1)

Samwise
Samwise

Reputation: 71517

p4 sync @(N-1)
p4 sync -k @(N)
p4 reconcile

And then optionally (if there are changes after N you want to sync to your workspace, which will be necessary if you want to submit the change that undoes N):

p4 sync
p4 resolve [-am]

Upvotes: 1

Related Questions