Package perforce :: Module objects :: Class Client
[frames] | no frames]

Class Client



object --+    
         |    
FormObject --+
             |
            Client

A Perforce client/workspace object.

Instance Methods
 
__init__(self, connection, clientName)
Initialises the Client based on the form retrieved on the connection.
 
save(self, force=False)
Save any changes made to the client on the Perforce server.
perforce.results.Results
sync(self, *fileRevisions, **options)
Sync the client workspace to the specified file revisions.
 
delete(self, force=False)
Delete this client workspace from the Perforce repository.

Inherited from FormObject: __delitem__, __getitem__, __iter__, __setitem__

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties

Inherited from object: __class__

Method Details

__init__(self, connection, clientName)
(Constructor)

 
Initialises the Client based on the form retrieved on the connection.
Parameters:
  • connection (perforce.connection.Connection) - The connection to the Perforce server to use to query the client details.
  • clientName (str or unicode) - The name of the Perforce client to query.
Raises:
  • CommandError - If there was a Perforce error querying the client.
Overrides: FormObject.__init__

save(self, force=False)

 
Save any changes made to the client on the Perforce server.
Parameters:
  • force (boolean) - Pass as True to force saving the client specification when doing so would otherwise be disallowed (eg if you are not the owner of the client). Requires 'admin' privileges.
Raises:
  • CommandError - If there was a Perforce error saving the client.

sync(self, *fileRevisions, **options)

 

Sync the client workspace to the specified file revisions.

If no file revisions are specified, then sync the entire workspace to the latest revision.
Parameters:
  • fileRevisions (tuple of str or unicode) - The file revisions to sync in this workspace. If no fileRevisions were specified then all files in the workspace are synced to the #head revision.
  • force (boolean) - Pass as True to force all named file revisions to be retransmitted rather than just those that are out of date.
Returns: perforce.results.Results
The results of performing the sync operation
Raises:
  • CommandError - If there was a Perforce error syncing the client.

delete(self, force=False)

 

Delete this client workspace from the Perforce repository.

The client cannot normally be deleted when the client is locked. Passing force=True will allow the client owner or a Perforce user with admin privileges to forcibly delete a locked client.
Raises:
  • CommandError - If there was a Perforce error deleting the client.

Note: This operation will not delete the files from the client's directory.