I invented the term Object-Oriented, and I can tell you I did not have C++ in mind.
-- Alan Kay

Tales from Perforce Hades.

Towards the end of God of War III, we were spending time in the office at odd hours, often coming in late due to midnight oil debugging sessions. It's always somewhat unsettling when you've got people standing at your desk when you arrive in the morning and want help before you even had your first cup of coffee (I know, they do this at their own peril, coffee mellows me out). This particular day apparently someone had managed to check out the entire repository for edit and since we've got a exclusive lock policy in place for our maya binary files [1], this caused the entire studio to grind to a halt. Not good. Now would be a good time to panic. Meanwhile, the poor guy who unwittingly managed to do this was desperately trying to undo the damage, but a revert in the normal perforce UI will also cause a refresh of the actual data file from the server -- which equals to a full force sync on the entire repository! Since our repository takes about 4-5h to sync, this would cause us considerable downtime in a time of significant stress.

Luckily, there is a way to tell perforce to undo the open for edit and the lock while not refreshing the actual data. This will of course cause potential inconsistencies on the one client that you're doing this to, but for the price of one force sync to fix this (or manual repair if you have enough info on which files are messed with), you can unlock 100+ people, that's oh 20-ish man days worth of work saved. The magic lies in the -k switch to a whole host of perforce commands. For example, this saved the day twice on GoW3 (yeah, the above situation was repeated):

 
	p4 revert -k //src/... > nul
   

Now, the mystery still remains how the heck the artists manage to do the full checkout of the entire repository -- perforce actually has a warning dialog if you attempt to check out more than N number of files, so they must have done the standard yes click without reading ...

What's your horror story from the trenches with perforce?













[1] By giving the filemapping type +l to any maya files, we make sure that anyone checking out a file for edit also automatically locks the file, preventing anyone else from opening the file for edit at the same time. See more at perforce documentation.

Comments