How do I get a list of the files checked out by users (including the usernames) using P4V or P4?
I want to provide a depot location and see a list of any files under that location (including sub folders) that are checked out.
Perforce allows you to check out the head revision or any previous revision of a file. To enforce the IDEs' check-in and check-out procedures, Perforce controls the read-write permissions of files. When files are checked out for edit, their permissions are set to read-write.
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.
Description. A Perforce client workspace is a set of files on a user's machine that mirror a subset of the files in the depot. More precisely, it is a named mapping of depot files to workspace files.
The p4v Perforce GUI client has an 'Actions > Remove from Workspace' menu command which removes all files from the workspace that are under version control and were not opened for edit or delete.
From the command line:
p4 opened -a //depot/Your/Location/...
The ... indicates that sub folders should be included.
Seeing as you also asked about P4V and only had command line answers so far, here's what you do for P4V. The "Pending" pane gets you part way to what you want. Ensure the "User" and "Workspace" filters are cleared, and you'll get a list of all files grouped by changelist and client spec. Not as clean as the straight list of files you get when using the P4 command line as suggested by Iain and Mark, but may help in some situations.
An alternative is to create a custom menu in P4V that uses one of the command line solutions suggested. For example:
I'm sure you could fancy this up a bit if needed to filter the output.
You can also restrict the output of p4 opened like so:
p4 opened -C <client-spec> //depot/...
to get a list of files opened on that client-spec
p4 opened //depot/...
will give you a list of files opened by the current P4USER
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With