There are three types of views: client views, branch views, and label views.
- Client views map files in the depot to files in the client workspace
- Branch views map files in the depot to other parts of the depot
- Label views associate groups of files in the depot with a single label.
Each type of view consists of lines which map files from the depot into the appropriate namespace. For client and branch views, the mappings consist of two file specifications. The left side of the mapping always refers to the depot namespace, and the right side of the mapping refers to the client workspace or depot namespace. For label views, only the left side (the depot namespace) of the mapping need be provided – the files are automatically associated with the desired label.
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.)
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/...
//depot/dir1/... //cws/dir2/...
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/... //cws/...
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.