p4 client (graph)

Create or edit a client workspace specification

The command p4 workspace is an alias for p4 client.

Syntax

p4 client -T graph [graphClientName]

Description

To modify Graph Depot files using p4 commands, your workspace must obey several additional rules, beyond those described in p4 client:

  • Specify Type: graph
  • Specify View: map, where map describes the files in the repos that are to be used by this client

Mixed client that maps to both classic and graph depots

You can create a client spec that maps solely to a classic depot, solely to a graph depot, or to a combination of both.

If you create a "mixed client" workspace, the options are:

  • a client of a classic depot in which graph depot files are read-only and classic files are editable - see the first example below
  • a client of a graph depot in which classic files are read-only and graph depot files are editable - see the second example below
  • a read-only client in which both classic and graph depot files are read-only

Examples

classic client spec that includes a mapping to a graph directory

Client:   mixed_client1
Update:   2017/04/04 09:51:30
Access:   2017/04/04 09:51:48
Owner:    bruno
Host:     laptop153
Description:
    Created by bruno for a writable "classic" depot with read-only access to a graph depot.
Root:     /home/user/mixed_client1
Options:  noallwrite noclobber nocompress unlocked nomodtime normdir
SubmitOptions:    submitunchanged
LineEnd:  local
View:
    //depot/main/projectA/... //mixed_client1/depot/main/projectA/...
    //repo/projectB/... //mixed_client1/repo/projectB/...
Note

depot is the default name for a writable "classic" depot.

repo is the default name for a depot of type graph.

This client spec provides write access to projectA, which belongs to a writable "classic" depot, and read-only access to projectB, which belongs to a depot of type graph. One use case for such a client is to support including files from both kinds of projects into a single software build.

With this client spec, p4 sync results in:

//depot/main/projectA/projA.txt#1 - added as /home/user/mixed_client1/depot/main/projectA/projA.txt
//depot/main/projectA/readme.txt#1 - added as /home/user/mixed_client1/depot/main/projectA/readme.txt
//repo/projectB/projB.txt - added as /home/user/mixed_client1/repo/projectB/projB.txt
//repo/projectB/readme.txt - added as /home/user/mixed_client1/repo/projectB/readme.txt
Tip

If this client attempts to edit a file in a graph depot, an error message appears. For example,

$ p4 edit aRepoFile.c
//repo/projectB/aRepoFile.c - can only edit file in a local depot

graph depot client spec that includes a mapping to a classic directory

The client spec associated with a graph depot spec MUST include a line that specifies "Type: graph".

Client:   mixed_client2
Update:   2018/05/16 19:01:30
Access:   2018/05/16 19:01:59
Owner:    bruno
Host:     laptop153
Description:
Created by bruno for a writable graph depot, with read-only access to a classic depot.
Root:     /home/user/mixed_client2
Options:  noallwrite noclobber nocompress unlocked nomodtime normdir
SubmitOptions:    submitunchanged
LineEnd:  local
Type:    graph
View:
   //repo/projectB/... //mixed_client2/repo/projectB/...
   //depot/main/projectA/... //mixed_client2/depot/main/classicProjectA/...
Tip

If this client attempts to edit a file in a classic depot, an error message appears. For example,

$ p4 edit aClassicFile.c
aClassicFile.c - no such file(s).