[Zope-CVS] SVN: zversioning/trunk/src/versioning/ ?

Grégoire Weber zope.org at incept.ch
Thu Oct 14 08:32:15 EDT 2004


Log message for revision 28171:
  ?

Changed:
  U   zversioning/trunk/src/versioning/README.txt
  U   zversioning/trunk/src/versioning/repository.py
  U   zversioning/trunk/src/versioning/storage.py

-=-
Modified: zversioning/trunk/src/versioning/README.txt
===================================================================
--- zversioning/trunk/src/versioning/README.txt	2004-10-14 12:25:29 UTC (rev 28170)
+++ zversioning/trunk/src/versioning/README.txt	2004-10-14 12:32:14 UTC (rev 28171)
@@ -41,28 +41,17 @@
         to ensure that the changing versions can be accessed later on. 
         We use the abstract term ticket to describe the fact that different
         storages use quite different reference schemes, e.g. global unique ids,
-        paths and revision numbers like SVN, python references in the ZODB etc.
+        paths and revision numbers, python pointers, the _p_oid in the ZODB etc.
         to retrieve and access parts of the history of an object.
         
-        In the long run we want to be able to plug in
-        other versioning systems like Subversion or relational databases as
-        other backends.
-        
-        
-    2.  IVersionableAspects. A plugin for the replication process that determines
-        what is versioned and how it stored. This is implemented as multiadapter
-        from IVersionable to IHistoriesStorage because only the combination
-        of both is able to determine what is stored in which way.
+    2.  IVersionableAspects. 
     
    
-    3.  INameChooser. A plugin for different labelling schemes, e.g. version 1, 
-        version 2, ... vs. v1.0, v1.1, v.1.1.1 etc.
+    3.  INameChooser.
     
     
-    4.  ICheckoutAware. A plugin that adds the ability to mark items as checked out
-        to data storages that do not provide this functionality themselves.    
-
-
+    4.  ICheckoutAware.
+    
     XXX
     
     5.  IMergeStrategies 
@@ -243,6 +232,12 @@
   >>> repo.checkin(sample)
   >>> sample.text
   'text version 2 of sample'
+
+  >>> repo.revertToVersion(sample, u'001')
+  >>> db_root['sample'].text
+  'text version 1 of sample'
+  >>> sample.text
+  'text version 1 of sample'
   
   >>> len(repo.listVersions(sample))
   2

Modified: zversioning/trunk/src/versioning/repository.py
===================================================================
--- zversioning/trunk/src/versioning/repository.py	2004-10-14 12:25:29 UTC (rev 28170)
+++ zversioning/trunk/src/versioning/repository.py	2004-10-14 12:32:14 UTC (rev 28171)
@@ -95,7 +95,7 @@
         """
         versionable_state = zapi.getMultiAdapter(
             (obj, self.histories), interfaces.IVersionableAspects)
-        versionable_state.updateAspects(specifier)
+        versionable_state.updateAspects(selector)
         
     def getTicket(self, obj):
         return self.histories.getTicket(obj)

Modified: zversioning/trunk/src/versioning/storage.py
===================================================================
--- zversioning/trunk/src/versioning/storage.py	2004-10-14 12:25:29 UTC (rev 28170)
+++ zversioning/trunk/src/versioning/storage.py	2004-10-14 12:32:14 UTC (rev 28171)
@@ -26,7 +26,6 @@
 from zope.app.container.interfaces import INameChooser
 from zope.app.annotation.interfaces import IAnnotations
 from zope.app.uniqueid.interfaces import IUniqueIdUtility
-from zope.app.servicenames import Authentication
 
 from versioning.interfaces import IVersionHistory
 from versioning.interfaces import IHistoryStorage
@@ -34,11 +33,6 @@
 from versioning.interfaces import ICheckoutAware
 
 
-class VersionPrincipalNotFound(Exception):
-    pass
-    
-
-
 class VersionHistory(Folder) :
     """ A simple folder implementation where each version
         is labeled '001', '002' etc.
@@ -158,17 +152,11 @@
     def getName(self):
         return 'Version %d' % int(self.getLabel())
         
-        
     def getComment(self):
         return 'no comment'
     
     def getPrincipal(self):
-        """ Returns the id of the principal that is versioning the data. """  
-        auth = zapi.getService(Authentication)
-        for principal in auth.getPrincipals('') :
-            return principal.getLogin()
-        return VersionPrincipalNotFound
- 
+        raise NotImplementedError
     
     data = property(getData)
     timestamp = property(getTimestamp)



More information about the Zope-CVS mailing list