[Zope-CVS] CVS: Products/ZopeVersionControl - Repository.py:1.8 container.py:1.4

Shane Hathaway cvs-admin at zope.org
Thu Nov 13 18:09:07 EST 2003


Update of /cvs-repository/Products/ZopeVersionControl
In directory cvs.zope.org:/tmp/cvs-serv17419

Modified Files:
	Repository.py container.py 
Log Message:
Made ZopeVersionControl look for a moniker that prevents versioning.

Useful for indicating objects to be versioned inside their containers.
This should be replaced by some kind of "IVersionability" adapter
lookup someday.



=== Products/ZopeVersionControl/Repository.py 1.7 => 1.8 ===
--- Products/ZopeVersionControl/Repository.py:1.7	Mon Oct 27 15:19:15 2003
+++ Products/ZopeVersionControl/Repository.py	Thu Nov 13 18:09:06 2003
@@ -91,10 +91,12 @@
     #####################################################################
 
     security.declarePublic('isAVersionableResource')
-    def isAVersionableResource(self, object):
+    def isAVersionableResource(self, obj):
         # For now, an object must be persistent (have its own db record)
         # in order to be considered a versionable resource.
-        return hasattr(object, '_p_oid')
+        if not getattr(obj, '_versionable', 1):
+            return 0
+        return hasattr(obj, '_p_oid')
 
     security.declarePublic('isUnderVersionControl')
     def isUnderVersionControl(self, object):


=== Products/ZopeVersionControl/container.py 1.3 => 1.4 ===
--- Products/ZopeVersionControl/container.py:1.3	Thu Oct 30 12:06:52 2003
+++ Products/ZopeVersionControl/container.py	Thu Nov 13 18:09:06 2003
@@ -100,6 +100,9 @@
         res = {}
         for name, value in self.obj.objectItems():
             if value is not None and isProxy is not None:
+                if not getattr(value, '_versionable', 1):
+                    # Version non-versionable objects in their containers.
+                    continue
                 if isProxy(value):
                     # Version references in their containers.
                     continue




More information about the Zope-CVS mailing list