[Zodb-checkins] CVS: StandaloneZODB/Doc - storage.tex:1.2

Jeremy Hylton jeremy@zope.com
Thu, 4 Oct 2001 17:36:10 -0400


Update of /cvs-repository/StandaloneZODB/Doc
In directory cvs.zope.org:/tmp/cvs-serv473

Modified Files:
	storage.tex 
Log Message:
Add docs for abortVersion() and commitVersion().

XXX The boilerplate about being state dependent and about supporting
undo may not be necessary.


=== StandaloneZODB/Doc/storage.tex 1.1 => 1.2 ===
   \code{' '}, has something to do with copying transactions.
 
-
 \end{funcdesc}
 
 \begin{funcdesc}{store}{oid, serial, data, version, transaction}
@@ -164,6 +163,35 @@
 
 \end{funcdesc}
 
+\begin{funcdesc}{abortVersion}{version, transaction}
+Clear any changes made by the given version.  \var{version} is the version
+to be aborted; it may not be the empty string.  \var{transaction} is the
+current transaction.
+
+This method is state dependent. It is an error to call this method if
+the storage is not committing, or if the given transaction is not the
+transaction given in the most recent \method{tpc_begin()}.
+
+If undo is not supported, then version data may be simply discarded.
+If undo is supported, however, then the \method{abortVersion()}
+operation must be undoable, which implies that version data must be
+retained.
+\end{funcdesc}
+
+\begin{funcdesc}{commitVersion}{source, destination, transaction}
+Store changes made in the \var{source} version into the \var{destination}
+version.  A \exception{VersionCommitError} is raised if the \var{source}
+and \var{destination} are equal or if \var{source} is an empty string. The
+\var{destination} may be an empty string, in which case the data are saved
+to non-version storage.
+
+This method is state dependent. It is an error to call this method if
+the storage is not committing, or if the given transaction is not the
+transaction given in the most recent \method{tpc_begin()}.
+
+If the storage doesn't support undo, then the old version data may be
+discarded. If undo is supported, then this operation must be undoable
+and old transaction data may not be discarded. 
 \end{classdesc}
 
 \section{ZODB.BaseStorage implementation}