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

Class Change



object --+    
         |    
FormObject --+
             |
            Change

The change class wraps the Perforce changelist concept.

Instance Methods
 
__init__(self, connection, change=None, client=None)
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 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, change=None, client=None)
(Constructor)

 
Initialise the Change based on the form retrieved on the connection.
Parameters:
  • connection (perforce.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.
Raises:
  • CommandError - If the operation failed due to Perforce errors.
Overrides: 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.
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.
Raises:
  • CommandError - If the operation fails due to Perforce errors.

refresh(self)

 
Reload the changelist contents from the Perforce server, discarding any unsaved changes.
Raises:
  • CommandError - If the operation fails due to Perforce errors.