About This Manual

This manual documents every Perforce command, environment variable, and configurable. This manual is intended for users who prefer to learn by means of Unix-style man pages, and for users who already understand the basics of Perforce and need to quickly find information on a specific command. This manual is divided into the following parts:

  • The first part lists commands in alphabetical order. The table below provides a function-based grouping of this same set of commands.
  • The second part lists environment and registry variables in alphabetical order.
  • The third part contains miscellaneous reference information about global options, file specifications, views, file types, and configurables.

The following table provides an index to the commands documented in this manual by functional area:

Function Where to look

Help

p4 help, p4 info, “File Specifications”, “Views”, “Global Options”, “File Types”

Client workspace

p4 clean, p4 client, p4 clients, p4 flush, p4 have, p4 ignores, p4 sync, p4 update, p4 where, p4 workspace, p4 workspaces

Files

p4 add, p4 attribute, p4 copy, p4 delete, p4 diff, p4 diff2, p4 dirs, p4 edit, p4 files, p4 fstat, p4 grep, p4 move, p4 lock, p4 print, p4 reconcile, p4 rename, p4 revert, p4 status, p4 sizes, p4 unlock

Changelists

p4 change, p4 changelist, p4 changes, p4 changelists, p4 describe, p4 filelog, p4 opened, p4 reopen, p4 review, p4 shelve, p4 submit, p4 unshelve

Jobs

p4 fix, p4 fixes, p4 job, p4 jobs, p4 jobspec

Branching and Merging

p4 branch, p4 branches, p4 copy, p4 cstat, p4 integrate, p4 integrated, p4 interchanges, p4 istat, p4 label, p4 labels, p4 labelsync, p4 list, p4 merge, p4 populate, p4 tag, p4 resolve, p4 resolved, p4 stream, p4 streams

Administration

p4 admin, p4 archive, p4 cachepurge, p4 configure, p4 counter, p4 counters, p4 dbschema, p4 dbstat, p4 depot, p4 depots, p4 diskspace, p4 journals, p4 key, p4 keys, p4 license, p4 lockstat, p4 logappend, p4 logger, p4 logparse, p4 logrotate, p4 logschema, p4 logstat, p4 logtail, p4 monitor, p4 obliterate, p4 ping, p4 property, p4 proxy, p4 pull, p4 reload, p4 renameuser, p4 replicate, p4 restore, p4 reviews, p4 server, p4 serverid, p4 servers, p4 triggers, p4 typemap, p4 unload, p4 verify

Security

p4 group, p4 groups, p4 login, p4 logout, p4 passwd, p4 protect, p4 protects, p4 tickets, p4 trust, p4 user, p4 users, P4CLIENTPATH, P4SSLDIR, P4TRUST

Environment

p4 set, “Environment and Registry Variables”, P4AUDIT, P4AUTH, P4BROKEROPTIONS, P4CHANGE, P4CHARSET, P4COMMANDCHARSET, P4CLIENT, P4CONFIG, P4DEBUG, P4DIFF, P4DIFFUNICODE, P4EDITOR, P4HOST, P4IGNORE, P4JOURNAL, P4LANGUAGE, P4LOG, P4MERGE, P4MERGEUNICODE, P4NAME, P4PAGER, P4PASSWD, P4PCACHE, P4PFSIZE, P4POPTIONS, P4PORT, P4ROOT, P4TARGET, P4TICKETS, P4USER, PWD, TMP, TEMP

If you’d prefer to learn the concepts on which Perforce is based, or you prefer a style featuring more examples and tutorials than what you find here, see the Helix Versioning Engine User Guide, available from our web site at: http://www.perforce.com/documentation.

If there’s anything we’ve left out that you think should be included, let us know. Please send your comments to [email protected].

What’s new in this guide for the 2016.1 release

This section provides a summary of the notable changes in this guide for the 2016.1 release. For a list of all new functionality and major bug fixes in Perforce Server 2016.1, see the Release Notes.

Features

Custom command alias
You can define your own aliases for commands, and these can range from simple word substitutions to what might be called light scripting. For more information see Command aliases

New and changed configurables and environment variables

New configurables are described in “Configurables”.

auth.id
An alphanumeric identifier that must be set for all servers in a distributed configuration if you want to implement single login to the master, which is then valid across all replica instances.
auth.ldap.pagesize
Specifies the paging limit in bytes for LDAP searches with paged results.
dm.shelve.accessupdate
Updates a shelve access time when the shelf is viewed or modified access time if its last access time was longer than the limit specified by the value of dm.shelve.accessupdate.
lbr.retry.max
The number of times a replica will try to retrieve a file if a file transfer fails.
server.locks.archive
Set to disable server locks when running the p4 archive or p4 restore commands.
P4ALIASES
Location of the directory that holds your .p4aliases file.
P4IGNORE
Now allows you to escape the # character (which normally denotes a comment) with the backslash (\) character.

New specification fields

p4 remote

The remote spec invoked by the p4 remote command contains a new entry in the Options field: *copyrcs/nocopyrcs. This option determines whether the p4 fetch and p4 push commands transfer entire Revision Control System (RCS) archive files when possible, or never transfer entire RCS archive files.

The remote spec invoked by the p4 remote command contains a new field: ArchiveLimits:. This field governs how many, if any, revisions of file archives are stored on the server to which the files are fetched. For more information, see the section "Configure server to limit storage of archive revisions" in the "Fetching and Pushing" chapter of Using Helix for Distributed Versioning.

New commands

p4 aliases
Display command aliases that are currently defined in a .p4aliases file.
p4 reshelve
Reshelve files.

New command options and other command changes

p4 annotate
New -T option allows you to specify tab stops.
p4 archive
Use the server.locks.archive configurable to disable server locks when running the p4 archive command.
p4 branches
Use the new option --me as an abbreviation for -u $P4USER.
p4 change
Use the option -Ztag change -o to display, along with other information, the access time for a shelved file.
p4 changes
Use the new option --me as an abbreviation for -u $P4USER.
p4 client
Use the new option --me as an abbreviation for -u $P4USER.
p4 clone

When specifying a filespec, you no longer need to precede the filespec with a -f.

The -p option is optional. If not specified, p4 clone uses the remote server specified by the P4PORT environment variable.

p4 counter

Uses three new options:

  • --from and --to set the specified counter to the new value only if the current value of the counter matches the specified old value.
  • -v displays the previous value of the specified counter after it has been set or incremented.
p4 counters
Documentation has been updated to reflect the current list of counters that this command displays.
p4 dbstat
New -f option displays a page count, free pages, and percent free data for the specified table(s).
p4 delete
This command has a new --remote option, which — if the specified file is of type +l — takes a global exclusive lock on the file in the shared server from which you cloned the file.
p4 dirs
Specify new -i option to ignore the case of the directory argument when listing directories in a case-sensitive server.
p4 diskspace
Value displayed for used space in the Size column for Unix file systems now excludes reserved space.
p4 edit
This command has a new --remote option, which — if the specified file is of type +l — takes a global exclusive lock on the file in the shared server from which you cloned the file.
p4 fetch

This command has new options to refine the level of verbosity in its output: they are -Oc, -Of, and -Oi, which restrict output to information about every changelist, every file in every changelist, and every integration of every file in every changelist, respectively.

This command has a new -s option, which specifies a shelved changelist to be fetched, instead of one or more submitted changelists.

p4 files
A new -i option allows the server to ignore the case of the file argument when listing files in a case sensitive server.
p4 fstat
Now displays the working revision for opened files.
p4 group

New MaxOpenFiles field allows you to specify the maximum number of files a user in a given group can open as a result of a given command.

New -F option removes a group from the protections table and from all groups.

p4 integrate
The p4 integrate -v command has been deprecated. Use the p4 populate command instead.
p4 key

Uses three new options:

  • --from and --to set the specified key to the new value only if the current value of the key matches the specified old value.
  • -v displays the previous value of the specified key after it has been set or incremented.
p4 labels
Use the new option --me as an abbreviation for -u $P4USER.
p4 ldap
You can now enclose values for the SearchPasswd field of the LDAP spec in quotation marks. This allows you to use special characters like # if needed.
p4 obliterate
Documentation has been updated to note that this command does not obliterate a shelve of the file (archive or metadata). When you attempt to unshelve a file that has been obliterated, you will get an error. To recover the content of that file, print the file. To get rid of the shelve, delete the shelf.
p4 protect
You may now include comments in a p4 protect spec.
p4 protects
  • The new -m option displays a one word summary of the maximum applicable access level.
  • The new -M option displays a one-word summary of the maximum access level, taking into account exclusions against the specified file path.
p4 push

This command has new options to refine the level of verbosity in its output: they are -Oc, -Of, and -Oi, which restrict output to information about every changelist, every file in every changelist, and every integration of every file in every changelist, respectively.

p4 push also has a new -s option, which specifies a shelved changelist to be pushed, instead of one or more submitted changelists

p4 remote

A new ArchiveLimits: field allows you to specify how many revisions of file archives to store locally when the files are fetched.

A new entry in the Options field, copyrcs/nocopyrcs, determines whether the p4 fetch and p4 push commands transfer the entire RCS archive files when possible.

p4 renameuser
A new -f option forces the command to execute without checking for accidental merge checks that might have happened if the new user had already been used in this server.
p4 restore
You can now set the server.locks.archive configurable to disable server locks when running the p4 restore command.
p4 revert
This command has a new --remote option, which — if the specified file is of type +l — releases the global exclusive lock on the file in the shared server from which you cloned the file.
p4 server
A new -c option allows you to set or change configuration values used to set up the distributed environment on an edge or commit server.
p4 shelve
This command displays the working revision for the files being shelved, rather than the current depot revision.
p4 submit
If the net.parallel.max configuration variable is not set, or if the requested number of parallel threads exceeds the value set for net.parallel.max, the command will execute without using parallel threads or will use the maximum number of allowed threads.
p4 switch
The new -Rx option controls how files are reconciled when switching between streams.
p4 sync
If the net.parallel.max configuration variable is not set, or if the requested number of parallel threads exceeds the value set for net.parallel.max, the command will execute without using parallel threads or will use the maximum number of allowed threads.
p4 user
New -F option forces the deletion of the specified user, and also removes the user from the protections table and from all groups.
p4 unzip
This command has new options to refine the level of verbosity in its output: they are -Oc, -Of, and -Oi, which restrict output to information about every changelist, every file in every changelist, and every integration of every file in every changelist, respectively.
p4 verify
A new -A option allows you to verify that files in the archive depot have not become corrupted before you restore them with the p4 restore command.
p4 zip
This command has a new -s option, which specifies a shelved changelist to be zipped, instead of one or more submitted changelists.

Helix documentation

The following table lists and describes key documents for Helix users, developers, and administrators. For complete information see the following:

http://www.perforce.com/documentation

For specific information about…​ See this documentation…​

Introduction to version control concepts and workflows; Helix architecture, and related products.

Introducing Helix

Using the command-line interface to perform software version management and codeline management; working with Helix streams; jobs, reporting, scripting, and more.

Helix Versioning Engine User Guide

Basic workflows using P4V, the cross-platform Helix desktop client.

P4V User Guide

Working with personal and shared servers and understanding the distributed versioning features of the Helix Versioning engine.

Using Helix for Distributed Versioning

p4 command line (reference).

P4 Command Reference, p4 help

Installing and administering the Helix versioning engine, including user management, security settings.

Helix Versioning Engine Administrator Guide: Fundamentals

Installing and configuring Helix servers (proxies, replicas, and edge servers) in a distributed environment.

Helix Versioning Engine Administrator Guide: Multi-site Deployment

Helix plug-ins and integrations.

IDEs: Using IDE Plug-ins
Defect trackers: Defect Tracking Gateway Guide
Others: online help from the Helix menu or web site

Developing custom Helix applications using the Helix C/C++ API.

C/C++ API User Guide

Working with Helix in Ruby, Perl, Python, and PHP.

APIs for Scripting

Syntax conventions

Helix documentation uses the following syntax conventions to describe command line syntax.

Notation Meaning

literal

Monospace font indicates a word or other notation that must be used in the command exactly as shown.

italics

Italics indicate a parameter for which you must supply specific information. For example, for a serverid parameter, you must supply the id of the server.

[-f]

Square brackets indicate that the enclosed elements are optional. Omit the brackets when you compose the command.

Elements that are not bracketed are required.

…​

Ellipses (…​) indicate that the preceding element can be repeated as often as needed.

element1 | element2

A vertical bar ( | ) indicates that either element1 or element2 is required.

Please give us feedback

We are interested in receiving opinions on this manual from our users. In particular, we’d like to hear from users who have never used Perforce before. Does this guide teach the topic well? Please let us know what you think; we can be reached at [email protected].

If you need assistance, or wish to provide feedback about any of our products, contact [email protected].