Is there an easy way to revert an entire P4 changelist?

Marc Novakowski picture Marc Novakowski · Dec 1, 2008 · Viewed 16.7k times · Source

Let's say I checked in a changelist (in Perforce) with lots of files and I'd like to revert the entire changelist. Is there an easy way to "revert" the entire changelist in one fell swoop?

Currently I do something like this for each file in the changelist:

  • p4 sync //path/to/file#n (where "n" is the previous version of the file)
  • cp file file#n
  • p4 sync //path/to/file
  • p4 edit //path/to/file
  • cp file#n file
  • rm file#n

As you can imagine, this is quite cumbersome for a large changelist.

Answer

Greg Whitfield picture Greg Whitfield · Dec 1, 2008

The posted answers provide correct answers, but note also that there is an actual menu option in P4V to do this for you now. It's in the latest 2008.2 Beta, and so should be officially released the the next week or three.

This link gives details.

It should be a lot simpler to use than the earlier answers, but I've not had the opportunity to try it myself yet.

Update This has now been fully released. See Perforce downloads.