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

Class Branch



object --+    
         |    
FormObject --+
             |
            Branch

A Perforce branch object.

Instance Methods
 
__init__(self, connection, branchName)
Intialise the Branch based on the form retrieved on the connection.
 
save(self, force=False)
Save any changes made to the branch to the Perforce server.
 
delete(self, force=False)
Delete this branch from the Perforce server.

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, branchName)
(Constructor)

 
Intialise the Branch based on the form retrieved on the connection.
Parameters:
  • connection (perforce.connection.Connection) - The connection to the Perforce server to use. Must be already connected.
  • branchName (str or unicode) - The name of the branch to query.
Raises:
  • CommandError - If there was a Perforc error querying the branch.
Overrides: FormObject.__init__

save(self, force=False)

 

Save any changes made to the branch to the Perforce server.

By default only the owner of a locked branch can modify the branch. Passing force as True allows users with 'admin' access to modify locked branches owned by another user.
Parameters:
  • force (boolean) - Flag indicating whether to force saving of updates.
Raises:
  • CommandError - If the operation failed due to Perforce errors.

delete(self, force=False)

 

Delete this branch from the Perforce server.

By default, a branch cannot be deleted if it is locked. Specifying the 'force' parameter as True allows users with 'admin' access to delete locked branches.
Parameters:
  • force (boolean) - Flag indicating whether to force deletion of the branch.
Raises:
  • CommandError - If the operation failed due to Perforce errors.