[SCM] source code management-commands required by the perforce Administrator

Source: Internet
Author: User
Tags perforce

 

1 P4 configure

It is used to manage server configuration variables, and modifications take effect immediately without restarting the server.

After we create and run a new p4server, we generally need to modify the following Configuration:

* Start server process monitoring: P4 configure set monitor = 1 or P4 configure set monitor = 2;

* Enable ticket-based authentication: P4 configure set security = 3;

* Prevent Users From creating their own accounts: P4 configure set DM. User. autocreate = 2;

Other common options:

* Set the lowest Client Version: P4 congigure set minclient = version;

* Message displayed when the client version is earlier than the minimum version: P4 configure set minclientmessage = message;

* View all p4server configurations: P4 configure show;

* View the common configuration of all p4servers on the local machine: P4 configure show allservers;

* View the value of a variable configured by p4server: P4 configure variable;

* View the configuration of a certain name p4server (when started, the-in p4name parameter or the environment variable p4name is set): P4 configure show p4name;

 

2 P4 counter and counters

P4 counters displays a list of long-term variables used by perforce or related scripts. For example, change stores the latest changelist (including uncommitted pending changelist), Journal stores the journal name, and review stores the chagnelist as of the last review. For example:

P4 counters

Change = 92
Job = 2
Journal = 5
Minclientmessage = Please use new version 2010.2.
Monitor = 1
Upgrade = 22

Counter can be used in an automatic script, for example, to record the changelist information of the last successful build.

* Set counter value: P4 counter mycounter 123;

* Display the counter value (0 if it does not exist): P4 counter mycounter;

* Delete counter: P4 counter-D countername;

* The Counter of the integer increases by 1: P4 counter-I countername;

 

3 P4 depot and Depots

P4 depot is used to create, edit, and delete depot. A p4server can have multiple depots (which can be simply understood as the root directory ). The depot type can be local, remote, spec, or archive.

* Lcoal is a general depot,CodeThe local p4server. You can use P4 depot depotname to modify the storage of depot to different locations. The default value is in the p4root environment variable;

* Remote is only a read-only link to the depot of the remote p4server. It is used to share code among multiple p4servers;

* Spec, a specific depot of p4server, records the modification history of the database of P4 server, such as user, group, and client;

* Archive, which is a specific depot of p4server and stores infrequently used code. You need to use the command P4 archive + P4 restore to convert the common depot to archive depot, which is generally not commonly used;

 

4 P4 flush = P4 sync-K

Only the version information of the files contained in the workspace recorded in the new DB. Have.

Assume that 10 new Dev nodes need to establish the environment, but it takes a lot of time to sync the first code. In this case, P4 flush can be used to save time. The process is as follows:

* Dev1 runs P4 sync files based on firstworkspace;

* Other Devs copy the dev1 sync files to their own client workspaces;

* Other Devs run P4 flush files @ firstworkspace to sync the status of their client workspace to the same as firstworkspace.

If this command is used incorrectly, the P4 database may be in an incorrect state, so it is generally not used.

You can use P4 have to view the status of all files in your workspace.

 

5 P4 logtail

View the latest error log.

 

6 P4 Monitor

View the Process status of p4server.

* P4 Monitor show-El: View All p4server processes.

* P4 monitor ternminate ID: ends a p4server process.

 

7 P4 obliterate

Delete the history of files and files from p4server. Be sure to use it with caution.

 

8 P4 Ping

Check the network performance. Sometimes the sync code on some machines is slow. You can use this command to compare the result with other machines.

 

9 P4 set-S

Set the perforce variable in the Windows registry. In other systems, perforce uses environment variables. Environment variables can also be used in windows. If the environment variables are defined, the registry key is overwritten.

Set environment variables to the Windows registry:

* Available only to current users: P4 set p4port = Tea: 1666;

* All users are available: P4 set-s p4port = Tea: 1666;

* For the NT service, set P4 set-s p4svc p4port = 1666;

* Delete the value of a variable in the Registry: P4 set p4merge =

You can also define Windows environment variables:

* Set p4port = Tea: 1666

For other systems such as Linux, set environment variables:

* P4port = Tea: 1666;

You can also use the configuration file to replace the registry or environment variable. If you use the configuration file, you need to set the configuration file name to the p4config environment variable. The configuration file format is as follows:

P4client = joes_client
P4user = Joe
P4port = IDA: 3548

P4 set allows you to view all environment variables and registry variables.

 

10 P4 triggers

Used to manage all triggers of p4server.

 

11 P4 replicate and P4 pull

Used to create a replicated server.

Complete!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.