Previous Table of Contents Index Next
Perforce 2009.1: Command Reference



p4 depot
Synopsis
Create or edit a depot specification.
Syntax
p4 [g-opts] depot depotname
p4 [g-opts] depot -d depotname
p4 [g-opts] depot -o depotname
p4 [g-opts] depot -i
Description
The files on a Perforce server are stored in a depot. By default, there is one depot on every Perforce server, and its name is depot.
To create or edit a depot, use p4 depot depotname and edit the fields in the form. Depots may be of type local, remote, or spec.
Other local depots work the same way the default depot is used. For example, to sync a file README in the rel2 directory of the depot new, add //new/rel2/... to the left-hand side of your client workspace mapping, and run p4 sync //new/rel2/README.
If you are using remote depots, your Perforce server (that is, the machine specified in P4PORT) is configured to permit your Perforce client program to read files from a different Perforce server. Remote depots are restricted to read-only access; Perforce client programs cannot add, edit, delete, or integrate files in the depots on the other servers. For more information about remote depots, see the Perforce System Administrator's Guide.
The spec depot, if present, tracks changes to user-edited forms such as client workspace specifications, jobs, branch specifications, and so on. There can be only one spec depot per server. Files in the spec depot are automatically generated by the server, and are represented in Perforce syntax as follows:
//specdepotname/formtype/objectname[suffix]
For instance, if the spec depot is present and named spec, and uses the default suffix of .p4s, you can obtain the history of changes to job000123 by typing:
p4 filelog //spec/job/job000123.p4s
For more information about setting up a spec depot, see the System Administrator's Guide.
After you have created the spec depot, use p4 admin updatespecdepot to pre-populate it with current set of client, depot, branch, label, typemap, group, user, and job forms.
Form Fields
local, remote, or spec. Local depots are writable; remote depots are proxies for depots residing on other servers, and cannot be written to. The spec depot, if present, archives edited forms.
If the Type: is remote, the address should be the P4PORT address of the remote server.
If the Type: is local or spec, this field is ignored.
If the Type: is spec, this field holds an optional suffix for generated paths to objects in the spec depot.
The default suffix is .p4s. You do not need a suffix to use the spec depot, but supplying a file extension to your Perforce server's versioned specs enables users of GUI client software to associate Perforce specifications with a preferred text editor.
If the Type: is local or remote, this field is ignored.
If the Type: is local or spec, set the map to point to the relative location of the depot subdirectory relative to the Perforce server's P4ROOT. The map must contain the ... wildcard; for example, a local depot new might have a Map: of new/... .
If the Type: is remote, set the map to point to a location in the remote depot's physical namespace, for example, //depot/new/rel2/... . This directory will be the root of the local representation of the remote depot.
Options
-d depotname
Delete the depot depotname. The depot must not contain any files; the Perforce superuser can remove files with p4 obliterate.
If the depot is remote, p4 obliterate must still be run: no files are deleted, but any outstanding client or label records referring to that depot are eliminated.
-o depotname
Usage Notes
Can File Arguments Use
Revision Specifier?
A depot created with p4 depot is not physically created in the server until files have been added to it with p4 add.
Users are not able to access a new depot created with p4 depot until permission to access the depot is granted with p4 protect.
Remote depots are always accessed by a virtual user named remote, and by default, all 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:
read user remote * -//...
Because 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.
By default, the Map: field on a local depot points to a depot directory matching the depot name, relative to the server root (P4ROOT) setting for your server. To store a depot's versioned files on another volume or drive, specify an absolute path in the Map: field. This path need not be under P4ROOT.
Related Commands
 


Previous Table of Contents Index Next

Perforce 2009.1: Command Reference
Copyright 1999-2009 Perforce Software.