Back to index

plone3  3.1.7
Public Member Functions
ZopeVersionControl.IVersionControl.IVersionControl Class Reference
Inheritance diagram for ZopeVersionControl.IVersionControl.IVersionControl:
Inheritance graph
[legend]
Collaboration diagram for ZopeVersionControl.IVersionControl.IVersionControl:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def isAVersionableResource
def isUnderVersionControl
def isResourceUpToDate
def isResourceChanged
def getVersionInfo
def applyVersionControl
def checkoutResource
def checkinResource
def uncheckoutResource
def updateResource
def labelResource
def getVersionOfResource
def getVersionIds
def getLabelsForResource
def getLogEntries

Detailed Description

The version control interface serves as the main API for version 
   control operations. The interface hides most of the details of
   version data storage and retrieval.

   In Zope 3, the version control interface will probably be implemented
   by a version control service. In the meantime, it may be implemented
   directly by repository implementations (or other things, like CMF
   tools).

   The goal of this version of the version control interface is to
   support simple linear versioning with support for labelled versions.
   Future versions or extensions of this interface will likely support 
   more advanced version control features such as concurrent lines of
   descent (activities) and collection versioning.

Definition at line 19 of file IVersionControl.py.


Member Function Documentation

Place the given object under version control. A VersionControlError
will be raised if the object is already under version control.

After being placed under version control, the resource is logically
in the 'checked-in' state.

If no message is passed the 'Initial checkin.' message string is 
written as the message log entry.

Permission: Use version control

Definition at line 81 of file IVersionControl.py.

00081 
00082     def applyVersionControl(object, message=None):
00083         """
00084         Place the given object under version control. A VersionControlError
00085         will be raised if the object is already under version control.
00086 
00087         After being placed under version control, the resource is logically
00088         in the 'checked-in' state.
00089 
00090         If no message is passed the 'Initial checkin.' message string is 
00091         written as the message log entry.
00092 
00093         Permission: Use version control
00094         """

Check-in (create a new version) of the given object, updating the
state and bookkeeping information of the given object. The optional
message should describe the changes being committed. If the object
is not under version control or is already in the checked-in state,
a VersionControlError will be raised.

Permission: Use version control

Definition at line 105 of file IVersionControl.py.

00105 
00106     def checkinResource(object, message=''):
00107         """
00108         Check-in (create a new version) of the given object, updating the
00109         state and bookkeeping information of the given object. The optional
00110         message should describe the changes being committed. If the object
00111         is not under version control or is already in the checked-in state,
00112         a VersionControlError will be raised.
00113 
00114         Permission: Use version control
00115         """

Put the given version-controlled object into the 'checked-out'
state, allowing changes to be made to the object. If the object is
not under version control or the object is already checked out, a
VersionControlError will be raised.

Permission: Use version control

Definition at line 95 of file IVersionControl.py.

00095 
00096     def checkoutResource(object):
00097         """
00098         Put the given version-controlled object into the 'checked-out'
00099         state, allowing changes to be made to the object. If the object is
00100         not under version control or the object is already checked out, a
00101         VersionControlError will be raised.
00102 
00103         Permission: Use version control
00104         """

Return a sequence of the (string) labels corresponding to the
versions of the given object that have been associated with a
label. This should be used by UI elements to populate version
selection widgets, etc.

Permission: Use version control

Definition at line 165 of file IVersionControl.py.

00165 
00166     def getLabelsForResource(object):
00167         """
00168         Return a sequence of the (string) labels corresponding to the
00169         versions of the given object that have been associated with a
00170         label. This should be used by UI elements to populate version
00171         selection widgets, etc.
00172 
00173         Permission: Use version control
00174         """

Return a sequence of LogEntry objects (most recent first) that
are associated with a version-controlled object.

Permission: Use version control

Definition at line 175 of file IVersionControl.py.

00175 
00176     def getLogEntries(object):
00177         """
00178         Return a sequence of LogEntry objects (most recent first) that
00179         are associated with a version-controlled object.
00180 
00181         Permission: Use version control
00182         """

Return a sequence of the (string) version ids corresponding to the
available versions of an object. This should be used by UI elements
to populate version selection widgets, etc.

Permission: Use version control

Definition at line 156 of file IVersionControl.py.

00156 
00157     def getVersionIds(object):
00158         """
00159         Return a sequence of the (string) version ids corresponding to the
00160         available versions of an object. This should be used by UI elements
00161         to populate version selection widgets, etc.
00162 
00163         Permission: Use version control
00164         """

Return the VersionInfo associated with the given object. The
VersionInfo object contains version control bookkeeping information.
If the object is not under version control, a VersionControlError
will be raised.

Permission: public

Definition at line 71 of file IVersionControl.py.

00071 
00072     def getVersionInfo(object):
00073         """
00074         Return the VersionInfo associated with the given object. The
00075         VersionInfo object contains version control bookkeeping information.
00076         If the object is not under version control, a VersionControlError
00077         will be raised.
00078 
00079         Permission: public
00080         """

Here is the caller graph for this function:

Given a version history id and a version selector, return the
object as of that version. Note that the returned object has no
acquisition context. The selector must be a string (version id,
activity id, label or date) that is used to select a version
from the version history.

Permission: Use version control

Definition at line 145 of file IVersionControl.py.

00145 
00146     def getVersionOfResource(history_id, selector):
00147         """
00148         Given a version history id and a version selector, return the
00149         object as of that version. Note that the returned object has no
00150         acquisition context. The selector must be a string (version id,
00151         activity id, label or date) that is used to select a version
00152         from the version history.
00153 
00154         Permission: Use version control
00155         """

Returns true if the given object is a versionable resource.

Permission: public

Definition at line 35 of file IVersionControl.py.

00035 
00036     def isAVersionableResource(object):
00037         """
00038         Returns true if the given object is a versionable resource.
00039 
00040         Permission: public
00041         """

Here is the caller graph for this function:

Return true if the state of a resource has changed in a transaction
*after* the version bookkeeping was saved. Note that this method is 
not appropriate for detecting changes within a transaction!

Permission: public

Definition at line 62 of file IVersionControl.py.

00062 
00063     def isResourceChanged(object):
00064         """
00065         Return true if the state of a resource has changed in a transaction
00066         *after* the version bookkeeping was saved. Note that this method is 
00067         not appropriate for detecting changes within a transaction!
00068 
00069         Permission: public
00070         """

Returns true if a resource is based on the latest version. Note
that the latest version is in the context of any activity (branch).

If the require_branch flag is true, this method returns false if
the resource is updated to a particular version, label, or date.
Useful for determining whether a call to checkoutResource()
will succeed.

Permission: public

Definition at line 49 of file IVersionControl.py.

00049 
00050     def isResourceUpToDate(object, require_branch=0):
00051         """
00052         Returns true if a resource is based on the latest version. Note
00053         that the latest version is in the context of any activity (branch).
00054 
00055         If the require_branch flag is true, this method returns false if
00056         the resource is updated to a particular version, label, or date.
00057         Useful for determining whether a call to checkoutResource()
00058         will succeed.
00059 
00060         Permission: public
00061         """

Here is the caller graph for this function:

Returns true if the given object is under version control.

Permission: public

Definition at line 42 of file IVersionControl.py.

00042 
00043     def isUnderVersionControl(object):
00044         """
00045         Returns true if the given object is under version control.
00046 
00047         Permission: public
00048         """

Here is the caller graph for this function:

def ZopeVersionControl.IVersionControl.IVersionControl.labelResource (   object,
  label,
  force = None 
)
Associate the given resource with a label. If force is true, then
any existing association with the given label will be removed and
replaced with the new association. If force is false and there is
an existing association with the given label, a VersionControlError
will be raised.

Permission: Use version control

Definition at line 134 of file IVersionControl.py.

00134 
00135     def labelResource(object, label, force=None):
00136         """
00137         Associate the given resource with a label. If force is true, then
00138         any existing association with the given label will be removed and
00139         replaced with the new association. If force is false and there is
00140         an existing association with the given label, a VersionControlError
00141         will be raised.
00142 
00143         Permission: Use version control
00144         """

Discard changes to the given object made since the last checkout.
If the object is not under version control or is not checked out,
a VersionControlError will be raised.

Definition at line 116 of file IVersionControl.py.

00116 
00117     def uncheckoutResource(object):
00118         """
00119         Discard changes to the given object made since the last checkout.
00120         If the object is not under version control or is not checked out,
00121         a VersionControlError will be raised.
00122         """

Update the state of the given object to that of a specific version
of the object. The object must be in the checked-in state to be
updated. The selector must be a string (version id, activity id,
label or date) that is used to select a version from the version
history.

Permission: Use version control

Definition at line 123 of file IVersionControl.py.

00123 
00124     def updateResource(object, selector=None):
00125         """
00126         Update the state of the given object to that of a specific version
00127         of the object. The object must be in the checked-in state to be
00128         updated. The selector must be a string (version id, activity id,
00129         label or date) that is used to select a version from the version
00130         history.
00131 
00132         Permission: Use version control
00133         """


The documentation for this class was generated from the following file: