Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Perforce, how do I get a list of checked out files?

Tags:

perforce

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.

like image 513
Iain Avatar asked Sep 25 '08 13:09

Iain


People also ask

What does checkout do Perforce?

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.

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.

What is Perforce client view?

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.

What does Perforce Remove from workspace do?

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.


3 Answers

From the command line:

p4 opened -a //depot/Your/Location/... 

The ... indicates that sub folders should be included.

like image 57
Iain Avatar answered Sep 18 '22 07:09

Iain


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:

  1. Tools->Manage Custom Tools
  2. New
  3. Call it something e.g. Open files by user
  4. Check the "Add to applicable context menus"
  5. In Application field, browse to p4.exe
  6. In Arguments, type opened -a %D (the latter takes the currently selected depot path)
  7. Check the box to run in a console.

I'm sure you could fancy this up a bit if needed to filter the output.

like image 39
Greg Whitfield Avatar answered Sep 17 '22 07:09

Greg Whitfield


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

like image 35
Mark Avatar answered Sep 21 '22 07:09

Mark