I have a file that is locked/checked out exclusively by a user who is no longer with the company. I need to make changes and want to know how to "steal the lock".
+6
A:
Ask your perforce admin to remove the lock by issuing
p4 unlock -f <file>
Peter G.
2010-10-06 17:38:56
+2
A:
"Locked" and "checked out" are two different things which require two different operations to undo. As Peter G. said, an admin can unlock a file with the unlock command:
p4 unlock -f <file>
However, to revert a file checked out by another user, you need to impersonate that user by passing their client (workspace name), host (computer name) and user names to the revert command, like so:
p4 -c theirclient -H theirhost -u theiruser revert filename
So if a Perforce user named jdoe has file foo.txt checked out in workspace ws1 on a host named joesPC, an admin can revert it with the following command:
p4 -c ws1 -H joesPC -u jdoe revert foo.txt
raven
2010-10-06 19:20:49