Perforce 2004.2 Command Reference | ||
<< Previous Chapter File Specifications |
Table of Contents Index Perforce on the Web |
Next Chapter >> File Types |
All views construct a one-to-one mapping between files in the depot and the files in the client workspace, branch, or label. If more than one mapping line refers to the same file(s), the earlier mappings are overridden. Mappings beginning with a hyphen (-) specifically exclude any files that match that mapping. In client views, mappings beginning with a plus sign (+) overlay previous mappings. (Overlay mappings do not apply to branch or label views.)
File specifications within mappings are provided in the usual Perforce syntax, beginning with //, followed by the depot, client, or label name, and followed by the actual file name(s) within the depot or client.
File specifications within mappings may contain the usual Perforce wildcards of *, ..., and the substring positional specifiers %%1 through %%9.
The order of mappings in a client or branch view is important. For instance, in the view defined by the following two mappings:
//depot/... //cws/...
the entire depot is mapped to the client workspace, but the file //depot/dir1/file.c is mapped to //cws/dir2/file.c. If the order of the lines in the view is reversed, however:
//depot/dir1/... //cws/dir2/...
//depot/dir1/... //cws/dir2/...
then the file //depot/dir1/file.c is mapped to //cws/dir1/file.c, as the first mapping (mapping the file into //cws/dir2) is overridden by the second mapping (which maps the entire depot onto the client workspace). A later mapping in a view always overrides an earlier mapping.
//depot/... //cws/...
If a path listed in a client view contains spaces, make sure to quote the path:
//depot/dir1/... "//cws/dir one/..."
To map file and directory names that contain the characters @, #, *, or %, (that is, to interpret such characters as components of path and filenames, and not as Perforce wildcards), expand the characters to their ASCII equivalents as follows:
When files are checked out, they are copied from the depot to the locations in the client workspace to which they were mapped. Likewise, when files are submitted back into the depot, the mapping is reversed and the files are copied from the client workspace back to their proper locations in the depot.
The following table lists some examples of client views:
To create a client view, use p4 client to bring up a screen where you can specify how files in the depot are mapped to the files in your client workspace.
Branch views map existing areas of the depot (the source files) onto new areas of the depot (the target files). They are defined in a manner similar to that used for defining client views, but rather than mapping files directly into a client workspace, they merely set up mappings within the depot.
To create a branch view, use p4 branch newbranch. This will bring up a screen (similar to the one associated with p4 client) and allow you to map the donor files from the main source tree onto the target files of the new branch.
No files are copied when a branch view is first created. To copy the files, you must ensure that the newly-created files are included in any client workspace view intending to use those files. This may be done by adding the newly-mapped branch of the depot to your current client workspace view and performing a p4 sync command.
To create a label, use p4 label labelname, and enter the depot side of the view. Because a label is merely a list of files and revision levels, only the depot side (the left side) of the view needs to be specified.
Perforce 2004.2 Command Reference | ||
<< Previous Chapter File Specifications |
Table of Contents Index Perforce on the Web |
Next Chapter >> File Types |