Perforce Protocol Levels

Compatibility when using -G and -Ztag

SUMMARY

Perforce client and server applications are forward and backward compatible. This compatibility is achieved by identifying the level at which the client application is communicating, so the server can phrase its responses accordingly.


DETAILS

As part of the initial communication, the client protocol level is passed between the client application and the Perforce Server. This protocol level, defined in the Perforce API, determines the communication protocol level that the Perforce client can understand. All subsequent responses from the Perforce Server are tailored to meet the requirements of that client protocol level.

The client levels are as follows:

  • client protocol 1: 97.1
  • client protocol 2: 97.2
  • client protocol 3: 97.3
  • client protocol 4: 98.1
  • client protocol 5: 98.2
  • client protocol 6: 99.1
  • client protocol 7: 99.1
  • client protocol 8: 99.2
  • client protocol 51: 2001.1
  • client protocol 52: 2001.2
  • client protocol 54: 2002.1
  • client protocol 55: 2002.2
  • client protocol 56: 2003.2
  • client protocol 57: 2004.1
  • client protocol 58: 2005.2
  • client protocol 59: 2006.1
  • client protocol 60: 2006.2
  • client protocol 61: 2007.2
  • client protocol 62: 2007.3
  • client protocol 63: 2008.1
  • client protocol 64: 2008.2

A later client protocol might provide information in a format that earlier client applications are unable to handle without additional parsing or translation. When using the Perforce API, you can set this value to your required protocol level using

ClientAPI::SetProtocol("api","<value>");

On the command line, setting the protocol level is achieved using the global flag -Zapi= followed by the protocol level required.

Tagged output for the p4 depots command is available from client protocol 58 onwards; a client request where the client protocol level is earlier does not provide the tagged output.

Example without -Zapi

Requesting output for p4 depots, showing standard behaviour:

p4 depots
Depot spec 2007/03/12 spec .p4s spec/... 'spec depot '
Depot depot 2006/03/16 local depot/... 'main test depot '

Example with -Zapi unsupported

Attempting to obtain tagged output (-Ztag) for p4 depots using client protocol level 57 (-Zapi=57). Note that this output is not in the tagged format, as client protocol level 57 does not support tagged output.

p4 -Ztag -Zapi=57 depots
Depot spec 2007/03/12 spec .p4s spec/... 'spec depot '
Depot depot 2006/03/16 local depot/... 'main test depot '

Example with -Zapi supported

Requesting tagged output for p4 depots using client protocol level 58 (-Zapi=58), which does support tagged output:

p4 -Ztag -Zapi=58 depots
... name depot
... time 1142524096
... type local
... map depot/...
... desc main depot
... name spec
... time 1173697080
... type spec
... extra .p4s
... map spec/...
... desc spec depot

Example with -G marshalled output

Requesting marshalled output for p4 depots using Perforce 2005.1 format

p4 -Zapi=57 -G depots