Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Perforce File Locked By Departed User

Tags:

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".

like image 219
Barry-Jon Avatar asked Oct 06 '10 17:10

Barry-Jon


People also ask

How do you unlock p4 files?

To unlock those files: p4 [g-opts] unlock [-c change | -s shelvedchange | -x] [-f] [file ...] This releases locks that were created explicitly using the p4 lock command, or implicitly during the course of a submit operation.

How do you unlock a file?

Right-click on the file. In the menu that appears, select Lock File. To unlock, right-click the file and select Unlock File.

What is exclusive checkout in perforce?

By default, Perforce does not do an exclusive check out, which means that other members of your team may be working on the same files at the same time. Communication is key to avoid merge conflicts that can be time-consuming and difficult to resolve.

How do I unlock files that have been locked by failed push?

To unlock those files on the commit server, either the user who issued the failing command unlocks them: specifying the name of the workspace the files are locked in as the -c global flag to p4. DVCS: Files might be locked on a remote sever from a failed p4 push.

How do I unlock files locked in P4?

specifying the name of the workspace the files are locked in as the -c global flag to p4. If p4 unlock is called from an Edge Server, any corresponding files locked globally via p4 lock -g by that client will be unlocked on the Commit Server. Unlock files in pending changelist changelist.

Why are my files locked on a remote server?

specifying the name of the workspace the files are locked in as the -c global flag to p4. DVCS: Files might be locked on a remote sever from a failed p4 push. To unlock those files on the remote server, either the user who issued the failed push command unlocks them:

How to unlock a file checked by another user?

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


2 Answers

Ask your perforce admin to remove the lock by issuing

p4 unlock -f <file> 

PS: To reuse the departed user's license, your perforce admin might also want clean up the files left opened by him. He can revert the pending edits if they are useless or transfer them to another user via "p4 reopen".

The "reopen" and "revert after reopen" can also be performed by ordinary users.

like image 142
Peter G. Avatar answered Sep 29 '22 03:09

Peter G.


"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

like image 30
raven Avatar answered Sep 29 '22 03:09

raven