当前位置: 首页 > 工具软件 > P4A > 使用案例 >

[P4V]P4常用命令总结及脚本化操作

彭海阳
2023-12-01

                            P4常用命令总结及脚本化操作

       

       前言:本手册记录了每个Perforce命令、环境变量和配置。本手册适用于那些喜欢通过unix风格的手册页学习的用户,以及那些已经了解Perforce的基础知识并且需要快速查找特定命令信息的用户。下表按功能区域提供了P4命令参考的索引

一、拿到最新的文件

  1. p4 sync //data_top/...

二、P4常用命令总结

Function

Where to look

Help

p4 helpp4 info“File Specifications”“Views”“Global Options”“File Types”

Client workspace

p4 cleanp4 clientp4 clientsp4 flushp4 havep4 syncp4 updatep4 wherep4 workspacep4 workspaces

Files

p4 addp4 attributep4 copyp4 deletep4 diffp4 diff2p4 dirsp4 editp4 filesp4 fstatp4 grepp4 movep4 lockp4 printp4 reconcilep4 renamep4 revertp4 statusp4 sizesp4 unlock

Changelists

p4 changep4 changelistp4 changesp4 changelistsp4 describep4 filelogp4 openedp4 reopenp4 reviewp4 shelvep4 submitp4 unshelve

Jobs

p4 fixp4 fixesp4 jobp4 jobsp4 jobspec

Branching and Merging

p4 branchp4 branchesp4 copyp4 cstatp4 integratep4 integratedp4 interchangesp4 istatp4 labelp4 labelsp4 labelsyncp4 listp4 mergep4 populatep4 tagp4 resolvep4 resolvedp4 streamp4 streams

Administration

p4 adminp4 archivep4 cachepurgep4 configurep4 counterp4 countersp4 dbschemap4 dbstatp4 depotp4 depotsp4 diskspacep4 journalsp4 keyp4 keysp4 licensep4 lockstatp4 logappendp4 loggerp4 logparsep4 logrotatep4 logschemap4 logstatp4 logtailp4 monitorp4 obliteratep4 pingp4 propertyp4 proxyp4 pullp4 reloadp4 renameuserp4 replicatep4 restorep4 reviewsp4 serverp4 serveridp4 serversp4 triggersp4 typemapp4 unloadp4 verify

Security

p4 groupp4 groupsp4 loginp4 logoutp4 passwdp4 protectp4 protectsp4 ticketsp4 trustp4 userp4 usersP4CLIENTPATHP4SSLDIRP4TRUST

Environment

p4 set“Environment and Registry Variables”P4AUDITP4AUTHP4BROKEROPTIONSP4CHANGEP4CHARSETP4COMMANDCHARSETP4CLIENTP4CONFIGP4DEBUGP4DIFFP4DIFFUNICODEP4EDITORP4HOSTP4IGNOREP4JOURNALP4LANGUAGEP4LOGP4MERGEP4MERGEUNICODEP4NAMEP4PAGERP4PASSWDP4PCACHEP4PFSIZEP4POPTIONSP4PORTP4ROOTP4TARGETP4TICKETSP4USERPWD, 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 P4 User's 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 <manual@perforce.com>.

三、What's new in this guide for the 2015.1 update

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

 3.1 New commands

Updates the users in the specified Perforce groups to match the members in the corresponding LDAP groups. The correspondence between a Perforce group and an LDAP group is defined in the Perforce group spec. If you do not specify a group name, all groups with LDAP configurations are updated.

Creates a new personal server in a distributed versioning environment.

Clones a new personal server from a shared server in a distributed versioning environment.

Switches to a new stream, optionally creating it (in a distributed versioning environment).

Defines a connection to a shared server in a distributed versioning environment.

Lists the known shared servers in a distributed versioning environment.

Copies files from a shared server to a personal server in a distributed versioning environment.

Copies files from a personal server to a shared server in a distributed versioning environment.

Unsubmits a change, leaving the work in a shelf, in a distributed versioning environment.

Resubmits unsubmitted changes, in a distributed versioning environment.

Packages a set of files for use by the p4 unzip command in a distributed versioning environment.

Imports files from a package created with the p4 zip command in a distributed versioning environment.

 3.2 New command options and other command changes

Using wild cards with the p4 add command makes it synonymous to p4 reconcile. That is, it will open files that exist in the workspace but not in the depot for add.

Allows you to convert all existing non-super users to use LDAP authentication. The command changes the AuthMethod field in the user specification for each user from perforce to ldap. If super users want to use LDAP authentication, they must set their AuthMethod manually.

The command now also reports changes that consist solely of ignored integrations if those changes have not yet been integrated into the target.

An operator may run the p4 journalcopy -lp4 pull -l -j, and p4 pull -l -s commands. This makes it possible for an operator to confirm the state of a replica.

If you use the -O option, you must use the -P option.

An operator may run the p4 journalcopy -lp4 pull -l -j, and p4 pull -l -s commands. This makes it possible for an operator to confirm the state of a replica.

You may use p4 rec as a synonym for p4 reconcile.

Other changed behavior: files opened for delete and present in your workspace that don't have pending resolve records are reopened for edit.

If you are renaming a user authorized by means of a P4AUTH configuration, you must issue the p4 renameuser command for every server that the user is authorized to use.

The -C client option allows you to revert another user's open files.

The -a option allows you to revert files opened for add that are missing from the workspace.

A user with operator privileges may execute p4 servers and p4 servers -J.

Displays files already opened in addition to files that need to be reconciled.

If you specify no arguments for the command, the target defaults to the current stream, and the source defaults to the current stream parent. You can also specify the stream as a directory name relative to the current stream depot.

The new options mergeany and mergedown specify whether the merge flow is restricted or whether merge is permitted from any other stream. For example, the mergeany option would allow a merge from a child to a parent with no warnings.

New --parallel option specifies that multiple files should be transferred in parallel, using independent network connections from automatically-invoked child processes. In order to run a parallel submit, the configurable net.parallel.max must be set to a value greater than 1.

The new -r option reopens files that are mapped to new locations in the depot, in the new location. By default, open workspace files remain associated with the depot files that they were originally opened as.

The command now automatically resolves files where the previously synced version does not differ from the newer depot version.

The new -r option unlocks the files associated with the specified client that were locked due to a failed p4 push command.

 3.3 New specification fields

New fields include LdapConfigLdapSearchQuery, and LdapUserAttribute. These are used with the p4 ldapsync command.

New optional field ExternalAddress specifies the external address used for connections to a commit server. This field must be set for the edge server to enable parallel submits in a federated environment.

 3.4 New configurables

  • filesys.windows.lfn

Set on the server to support filenames longer than 260 characters on Windows platforms.

  • auth.ldap.userautocreate

Specifies whether to automatically create users on login. The auth.default.method configurable now only determines whether the user is authenticated against an LDAP directory or against Perforce's internal database.

  • server.allowfetch

Specifies whether changes can be fetched in a distributed versioning environment.

  • server.allowpush

Specifies whether changes can be pushed in a distributed versioning environment.

  • server.allowrewrite

Specifies whether submitted changes can be rewritten.

 3.5 Deprecated configurables

  • rpl.forward.all

Has been deprecated.

 类似资料: