p4 client (graph)

Create or edit a client workspace specification

The command p4 workspace is an alias for p4 client.

Syntax

p4 [g-opts] client [-f] [-t template] -T graph [graphClientName]
p4 [g-opts] client -o [-f] [-t template] -T graph [graphClientName]

Syntax conventions

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

Hybrid 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 hybrid clientClosed A client workspace that supports both repos of type graph (see 'Git Connector') and the classic Helix Core file revision model. that combines both.

If you create a hybrid client, the options are:

For more information about depots of type graph, see:

Options

-f

Allows the last modification date, which is normally read-only, to be set. Administrators can use the -f option to delete or modify locked workspaces owned by other users.

Use of this option requires admin access granted by p4 protect.

-o

Write the client workspace specification to standard output.

-T type

By default, clients are writeable. You can also set type to:

  • readonly, which prevents files from being opened or submitted
  • partitioned, which allows files to be opened and submitted

g-opts

See Global options.

Usage Notes

  • there is no distinct graph version of the client command, but the client spec has a Type field that can be set to graph

  • to map a graph depot path (depot or repo), the user must have at least read permission on that graph path (either the individual repo, or the whole depot)

Examples

classic client spec that includes a mapping to a graph directory

This client spec associated with a graph depot spec does not include a line that specifies "Type: graph", so updates to Graph Depot paths are prohibited.

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).