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

Class Change



        object --+    
                 |    
objects.FormObject --+
                     |
                    Change

The change class wraps the Perforce changelist concept.

Instance Methods
 
__init__(self, connection, change, client, form)
Initialise the Change based on the form retrieved on the connection.
 
save(self, force=False)
Save any changes made to the changelist on the Perforce server.
 
delete(self, force=False)
Delete a pending changelist on the Perforce server.
 
submit(self)
Save any changes made to the changelist and submit the changelist to the Perforce server.
 
refresh(self)
Reload the changelist contents from the Perforce server, discarding any unsaved changes.

Inherited from objects.FormObject: __delitem__, __getitem__, __iter__, __setitem__

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

Static Methods
 
__new__(cls, connection, change=None, client=None)
Initialise the Change based on the form retrieved on the connection.
Properties

Inherited from object: __class__

Method Details

__new__(cls, connection, change=None, client=None)
Static Method

 
Initialise the Change based on the form retrieved on the connection.
Parameters:
  • connection (perforce.connection.Connection or perforce.async.connection.Connection) - The connection to the Perforce server to use. Must already be connected.
  • change (int, str, unicode or None) - The number of the changelist to retrieve. If not specified then open the default changelist on the connection's current client. Saving the default changelist will create a new named changelist.
  • client (str or unicode) - The name of the Perforce client to use for retrieving default changelists and submitting files. The client used to submit the changelist must be the same as the client the changelist was created on.
Returns:
A deferred that fires with a Change object once the form has been retrieved.
Raises:
  • CommandError - If the operation failed due to Perforce errors.
Overrides: object.__new__

__init__(self, connection, change, client, form)
(Constructor)

 
Initialise the Change based on the form retrieved on the connection.
Parameters:
  • connection (perforce.connection.Connection or perforce.async.connection.Connection) - The connection to the Perforce server to use. Must already be connected.
  • change (int, str, unicode or None) - The number of the changelist to retrieve. If not specified then open the default changelist on the connection's current client. Saving the default changelist will create a new named changelist.
  • client (str, unicode) - The name of the Perforce client to use for retrieving default changelists and submitting files. The client used to submit the changelist must be the same as the client the changelist was created on.
  • form (perforce.forms.Form) - The form retrieved from the Perforce server.
Overrides: objects.FormObject.__init__

save(self, force=False)

 
Save any changes made to the changelist on the Perforce server.
Parameters:
  • force (boolean) - Flag indicating whether or not to force update of other users' pending changelists or 'Update' and 'Description' fields of submitted changelists. The user must have 'admin' privileges to force modification of changelists.
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 a pending changelist on the Perforce server.
Parameters:
  • force (boolean) - Force deletion of another user's changelist or a submitted changelist (once all files on the changelist have been obliterated). The user must have 'admin' privileges to force deletion of changelists.
Raises:
  • CommandError - If the operation failed due to Perforce errors.

Note: The default changelist cannot be deleted.

submit(self)

 

Save any changes made to the changelist and submit the changelist to the Perforce server.

This will atomically commit changes to files associated with this changelist.
Returns:
A deferred that fires when the operation is complete.
Raises:
  • CommandError - If the operation fails due to Perforce errors.

refresh(self)

 
Reload the changelist contents from the Perforce server, discarding any unsaved changes.
Returns:
A deferred that fires when the operation is complete.
Raises:
  • CommandError - If the operation fails due to Perforce errors.