| |||||||
Chapter 16 System Administration: Superuser Commands and Flags | |||||||
Three Perforce commands can be used only by users with Perforce superuser privileges. These commands allow the superuser to verify files using 128-bit signatures, remove all traces of file from the depot, create multiple depots on the local server, limit the number results of user commands, or provide read access to files on other servers. Additionally, a special flag (-f) available with certain commands allows the superuser to perform operations unavailable to ordinary users.
| |||||||
File Verification by Signature | |||||||
The p4 verify filenames command can be used to generate 128-bit signatures of each revision of the named files. A list of signatures generated by p4 verify can later be used to confirm proper recovery in case of a crash: if the signatures of the recovered files match the previously saved signatures, the files were recovered accurately.
To save file revisions' signatures in the Perforce database, use the -u flag. Subsequent verifications will be compared against the stored signatures; if a new signature does not match the signature in the Perforce database for that file revision, Perforce adds the characters BAD! after the signature.
| |||||||
File Obliteration | |||||||
The depot is always growing. Obviously, this is not always desirable: a branch might be performed incorrectly, creating hundreds of unneeded files; or perhaps there are simply a lot of old files around that are no longer being used. p4 delete won't help, since this command marks the file as deleted in its head revision, but leaves the old revisions intact.
p4 obliterate filename can be used by superusers to remove all traces of a file from a depot, making the file indistinguishable from one that never existed in the first place. p4 obliterate is so destructive, in fact, that we haven't even told you how it really works yet. p4 obliterate filename only reports on what it will do; to actually destroy the files, use p4 obliterate -y filename.
| |||||||
Changelist Deletion & Description Editing | |||||||
The -f flag can be used with p4 change to change the description or username of submitted changelists. The syntax is p4 change -f changenumber; this presents the standard changelist form, in which the description and/or username may be edited.
The -f flag can also be used to delete any submitted changelists that have been emptied of files with p4 obliterate. The full syntax is p4 change -d -f changenumber.
| |||||||
Server Swamp Prevention | |||||||
When the depot becomes quite large, certain commands can swamp the server, substantially slowing down other users' operations. For example, if p4 sync is typed, Perforce will attempt to sync all the files in the client workspace from the depot.
The Perforce superuser can limit the number of files that particular users are allowed to operate on within a single command. To do this, use the Maxresults: field in the p4 group form. The number in this field specifies the maximum number of rows of data that can be operated on within a single command. If a user is listed in multiple groups, the highest of the maxresults value for those groups is taken as the user's maxresults value. If the user attempts an operation that exceeds his maxresults value, the entire operation will fail, and the user will need to attempt it again using more restrictive parameters. For example, if the user has attempted to sync more files then his maxresults value allows, he can retry the sync by providing a more restrictive file specification, such as p4 sync //depot/build/... . To unlimit the number of result lines processed for a particular group, set the Maxresults: value for that group to unlimited. Since maxresults values can make life difficult for your users, do not use them unless you find that certain operations are slowing down your server. The Maxresults: value should never be less than 10K, since certain behind-the-scene operations performed by P4Win, the Perforce Windows GUI, may require a 5K - 8K Maxresults: value.
| |||||||
Distributed Depots | |||||||
Perforce distributed depots allow the p4 client program to access files from multiple depots. These other depots may reside within the p4d server normally accessed by the p4 client program, or they may reside within other, remote, p4d servers.
The p4 client's local p4d server program acts as a proxy client to the remote server programs, so the client doesn't need to know where the files are actually stored, and doesn't need direct access to the remote p4d server programs. The use of distributed depots on remote servers is currently limited to read-only operations; thus, a p4 client program may not add, edit, delete or integrate files that reside in depots on other servers. Depots sharing the same p4d server as the client are not subject to this limitation. Defining New DepotsNew depots in a server namespace are defined with the command p4 depot depotname. If called with the default depotname depot, the p4 depot command will bring up the following form:
When p4 depot depot is called, the form is filled in with values representing the state of the default depot. Its name, of course, is depot. It resides in the local p4d server namespace; so its type is local, (as opposed to remote). The Map: field indicates where the depot subdirectory is located relative to the root directory of the p4d server program; in this default case, the depot called depot starts in the depot subdirectory directly underneath the root. Defining Local DepotsTo define a new local depot (that is, a new depot in the current p4d server program namespace), p4 depot is called with the new depot name, and only the Map: field in the resulting form need be changed. For example, to create a new depot called book with the files stored in the local p4d server namespace in a root subdirectory called manual, the command p4 depot book would be typed, and the resulting form would be filled in as follows:
Defining Remote DepotsDefining a new depot on a remote p4d server is only slightly more complicated. The Type: is remote; the server address must be provided in the Address: field, and the Map: field must be given a mapping into the remote depot namespace.
| |||||||
|
Lisa is working on a GUI for Elm. She and Ed are using different p4d servers; his is on
host pine, and it's listening on port 1818. Lisa wants to grab Ed's GUI routines for her
own use; she knows that Ed's color routine files are located on his p4d server's single
depot under the subdirectory graphics/GUI. Lisa's first step towards accessing Ed's
files would be to create a new depot. She'll call this depot gui; she'd type p4 depot GUI
and fill in the form as follows:
This creates a remote depot called gui on Lisa's p4d server; this depot maps to Ed's depot's namespace under its graphics/gui subdirectory. The Mapping Field, and What it MeansThe Map: field is analogous to a client's view, except that the view may contain multiple mappings and the Map: field always contains a single mapping. This single mapping format changes depending on whether or not the depot being defined is local or remote:
Naming DepotsDepot names share the same namespace as branches, clients, and labels. For example, //foo refers unambiguously to either the depot foo, the client foo, the branch foo, or the label foo.Accessing Files In Other DepotsFiles from any remote or local depot known to the default p4d server can be accessed simply by using the depot's name wherever the default depot name depot is usually used. This means that any defined depot name can be used in the following ways:
Additionally, files from remote depots can't be used in p4 filelog or p4 describe, even though these operations are read-only. Integrating Files From Other DepotsA branch view may contain remote files in its mappings, so that files can be branched and later integrated from a remote depot into the local one. This works much as local branching and integration do, with two exceptions:
Limiting Access from Other ServersRemote depots are always accessed by a virtual user named remote, and by default, all the files on any Perforce server may be accessed remotely. To limit or eliminate remote access to a particular server, use p4 protect to set permissions for user remote on that server. For example, to eliminate remote access to all files in all depots on a particular server, set the following permission on that server:Since remote depots can only be used for read access, it is not necessary to remove write or super access. The virtual user remote does not consume a Perforce license. Deleting DepotsDepots may be deleted with p4 depot -d depotname.Depot Reporting CommandsAll depots known to the current p4d server can be listed with the p4 depots command.
| ||||||
Forcing Operations with the -f Flag | |||||||
Certain commands allow the superuser to use the -f flag to force certain operations unavailable to ordinary users. This flag can be used with p4 branch, p4 change, p4 client, p4 job, p4 label, and p4 user. The usages and meanings of this flag are as follows:
| |||||||
| |||||||
Please send comments and questions about this manual to
[email protected]. Copyright 1997, 1999 Perforce Software. All rights reserved. Last updated: September 15, 1999. Manual version 99.1.ug.4. |