[Zope-CVS] SVN: zversioning/trunk/src/versioning/ fixed Gregs
broken tests
Uwe Oestermeier
uwe_oestermeier at iwm-kmrc.de
Wed Oct 13 19:25:32 EDT 2004
Log message for revision 28142:
fixed Gregs broken tests
Changed:
U zversioning/trunk/src/versioning/MOTIVATION.txt
U zversioning/trunk/src/versioning/README.txt
U zversioning/trunk/src/versioning/storage.py
-=-
Modified: zversioning/trunk/src/versioning/MOTIVATION.txt
===================================================================
--- zversioning/trunk/src/versioning/MOTIVATION.txt 2004-10-13 23:16:25 UTC (rev 28141)
+++ zversioning/trunk/src/versioning/MOTIVATION.txt 2004-10-13 23:25:30 UTC (rev 28142)
@@ -2,7 +2,6 @@
Motivation for a new Versioning Scheme
======================================
-
We start by testing some of the existing infrastructure from zope.app.versioncontrol
and try to apply the existing versioning to sample data. We take a simple
folder tree with the following structure as our sample :
Modified: zversioning/trunk/src/versioning/README.txt
===================================================================
--- zversioning/trunk/src/versioning/README.txt 2004-10-13 23:16:25 UTC (rev 28141)
+++ zversioning/trunk/src/versioning/README.txt 2004-10-13 23:25:30 UTC (rev 28142)
@@ -2,6 +2,38 @@
Versioning
==========
+Versioning means different things to different people and there is no common optimal
+solution for all the problems that are related to the history of evolving data.
+Therefore we want to provide a flexible framework that is pluggable in its
+most important parts and reduces the problem of different versioning schemes
+to a few reusable patterns. These patterns are implemented in versioning.repository.
+The main API is defined in versioning.interfaces.IVersionControl.
+
+The pattern common to all implementation variants is roughly as follows:
+
+ 1. Versioning can only be applied to a set of objects
+ if the objects have been registered and have been accepted
+ by the versioning system (or more precisely the version history storage).
+
+ 2. Creating a version means that the original object is copied into
+ a storage that defines the evolving history of this object by means
+ of a succession of replicated data.
+
+ What excactly is meant by a copy is a matter of the use case and not
+ prescribed by the framework. Some storages may be able to store metadata,
+ others only content data, sometimes one wants complete replicas, sometimes
+ only some important aspects of an object etc.
+
+ A few simple examples can be found in policies.py. The implementation of
+ more complex variants is left as an exercise to the reader.
+
+ 3. Reverting to a version means that the saved state of an object is somehow
+ reconstructed in the present context. For some contexts a substitution
+ of the original with a saved copy is sufficient, sometimes references
+ to the originl objects must remain intact. These different variants
+ are also defined in policies.py
+
+
General Setup Stuff
-------------------
Modified: zversioning/trunk/src/versioning/storage.py
===================================================================
--- zversioning/trunk/src/versioning/storage.py 2004-10-13 23:16:25 UTC (rev 28141)
+++ zversioning/trunk/src/versioning/storage.py 2004-10-13 23:25:30 UTC (rev 28142)
@@ -72,14 +72,6 @@
"""
implements(IHistoryStorage)
-
- def getTicket(self, obj) :
- """ Returns the persistent oid of an object as
- a ticket that remains stable across time.
- """
- if obj._p_oid is None :
- raise RuntimeError("cannot version uncommited objects")
- return str(obj._p_oid)
def register(self, obj):
""" Register an obj for version control.
@@ -88,12 +80,29 @@
ticket = self.getTicket(obj)
self[ticket] = history
return ticket
-
+
+ def getTicket(self, obj) :
+ """ Returns the persistent oid of an object as
+ a ticket that remains stable across time.
+ """
+ if obj._p_oid is None :
+ raise RuntimeError("cannot version uncommited objects")
+ return str(obj._p_oid)
+
+ def getVersion(self, obj, selector) :
+ """ Returns the version of an object that is specified by selector. """
+ history = self.getVersionHistory(obj)
+ return history[selector]
+
def getVersionHistory(self, obj):
""" Returns a version history given a version history id."""
ticket = self.getTicket(obj)
return self[ticket]
-
+
+ def getMetadataHistory(self, obj) :
+ """ Returns a version history given a version history id."""
+ NotImplementedError("metadata support not implemented")
+
def listVersions(self, obj) :
""" Returns the versions of an object. The versions are
returned sorted in the order of appearance. """
@@ -101,14 +110,6 @@
list.sort()
return list
- def getMetadataHistory(self, obj) :
- """ Returns a version history given a version history id."""
- NotImplementedError("metadata support not implemented")
-
- def getVersion(self, obj, selector) :
- """ Returns the version of an object that is specified by selector. """
- history = self.getHistory(obj)
- return history[selector]
class DefaultCheckoutAware(object):
More information about the Zope-CVS
mailing list