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

Class Branch



        object --+    
                 |    
objects.FormObject --+
                     |
                    Branch

A Perforce branch object.

Instance Methods
 
__init__(self, connection, branchName, form)
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 objects.FormObject: __delitem__, __getitem__, __iter__, __setitem__

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

Static Methods
Branch
__new__(cls, connection, branchName)
Intialise the Branch based on the form retrieved on the connection.
Properties

Inherited from object: __class__

Method Details

__new__(cls, connection, branchName)
Static Method

 
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.
Returns: Branch
A deferred that fires with the Branch object once the form has been retrieved.
Raises:
  • CommandError - If there was a Perforce error querying the branch.
Overrides: object.__new__

__init__(self, connection, branchName, form)
(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.
  • form (perforce.forms.Form) - The form returned from the Perforce server.
Overrides: objects.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.
Returns:
A deferred that fires when the operation is complete.
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.
Returns:
A deferred that fires when the operation is complete.
Raises:
  • CommandError - If the operation failed due to Perforce errors.