Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determine perforce users that have a file checked out

Tags:

perforce

I have read these questions:

  • List of checked out files by others in Perforce
  • Perforce File Locked By Departed User

However these both deal with finding all the checked out files for a user. This is very useful, but I need to go the other way; what I really want to do is see who has checked out a particular file. Having read the P4 docs, I see no way to do this.

Is there a way in P4 I can check who all has checked out a particular file?

like image 425
Gutblender Avatar asked Oct 08 '14 17:10

Gutblender


1 Answers

Stupid me found it as soon as I asked.

With P4 in Windows, navigate to the file (it's easy with Ctrl + Shift + S in the P4 Workspace view). Right-click it -> Perforce -> Properties. Look under the "Checked Out By" tab. You can also mouse-over the file icon to invoke a tooltip which will reveal this.

Turns out the same docs I linked to also show how to do it with the command line (p4 opened -a filename), even if not explicitly offered. The docs say

To determine whether or not another user already has a particular file opened, use p4 opened -a file.

This is a bit of a headscratcher. While you can use this to check if a user has checked out a file, it more specifically lists the users and workspaces in which this file is checked out.

like image 102
Gutblender Avatar answered Nov 06 '22 10:11

Gutblender