p4 opened

Synopsis

List files that are open in pending changelists.

Syntax


p4 [g-opts] opened [-a -s] [-c change] [-C workspace] [-u user] [-m max] [file …]
p4 [g-opts] opened [-a -x] [-m max] [file …]

Description

Use p4 opened to list files that are currently open via p4 add, p4 edit, p4 delete, or p4 integrate. By default, all open files in the current client workspace are listed. You can use command line arguments to list only those files in a particular pending changelist, or to show open files in all pending changelists, and to limit the number of files displayed.

If file specifications are provided as arguments to p4 opened, only those files that match the file specifications are included in the report.

The information displayed for each opened file includes the file's name, its location in the depot, the revision number that the file was last synced to, the number of the changelist under which the file was opened, the operation it is opened for (add, edit, delete, branch, move/add, move/delete, integrate, import, purge, or archive), and the type of the file. The output for each file looks like this:

depot-file#rev - action chnum change (type) [lock-status]

where:

  • depot-file is the path in depot syntax;

  • rev is the revision number;

  • action is the operation the file was open for: add, edit, delete, branch, or integrate;

  • chnum is the number of the submitting changelist; and

  • type is the type of the file at the given revision.

  • If the file is locked (see p4 lock), a warning that it is *locked* appears at the line's end.

  • Files with filetypes that use the +l modifier are exclusively-locked (see the example for p4 typemap) and are displayed with a lock status of *exclusive*.

You can use the -s option to provide shortened output that omits the #rev number and the (type) of the file. This form of the command typically runs faster than the default.

Options

-a

List opened files in all client workspaces.

In distributed environments, this option lists only those files opened in other workspaces on your edge server; files opened on other edge servers do not appear.

-c change

List the files in pending changelist change. To list files in the default changelist, use p4 opened -c default.

-C workspace

List only files that are open in the specified client workspace.

-m max

List only the first max open files.

-s

Short output; do not output the revision number or file type. This option is more efficient, particularly when using the -a (all-workspaces) option at large sites.

-u user

List only those files that were opened by user.

-x

In distributed environments, list all files that have the +l filetype (exclusive open) over all servers. This option implies the -a option.

g-opts

See “Global Options”.

Usage Notes

Can File Arguments Use Revision Specifier?

Can File Arguments Use Revision Range?

Minimal Access Level Required

No

No

list

  • Perforce does not prevent users from opening already open files; its default scheme is to allow multiple users to edit the file simultaneously, and then resolve file conflicts with p4 resolve. To determine whether or not another user already has a particular file opened, use p4 opened -a file.

  • Locked files appear in the output of p4 opened with an indication of *locked*. On UNIX, you can find all locked files you have open with the following command:

    p4 opened | grep "*locked*"

    This lists all open files you have locked with p4 lock.

  • p4 opened -a can have a performance impact on large sites; unless you need the exact revision number or file type of an opened file, best practice is to use p4 opened -as.

  • p4 opened does not show files in shelved changelists. To display shelved changelists, use p4 changes -s shelved, and then use p4 describe -s -S changelist to display the files in the selected changelist(s).

Examples

p4 opened -c 35 //depot/main/...

List all files in pending changelist 35 that lie under the depot's main subdirectory.

p4 opened -a -c default

List all opened files in the default changelists for all client workspaces.

Related Commands

To open a file in a client workspace and list it in a changelist

To move a file from one changelist to another

p4 reopen

To remove a file from all changelists, reverting it to its previous state

p4 revert

To create a new, numbered changelist

p4 change

To view a list of changelists that meet particular criteria

p4 changes