[Zope-CVS] CVS: Products/ZopeVersionControl - Version.py:1.10

Shane Hathaway shane at zope.com
Fri Mar 12 16:08:10 EST 2004


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

Modified Files:
	Version.py 
Log Message:
Stopped turning ignored subobjects into None, instead creating SimpleItems.

We need to ignore some subobjects when cloning containers for the purpose
of version control, but some containers (BTreeFolder2s in particular) break
when they have None as a subobject.  The solution is to use a simple Zope
object in the place of the ignored subobject.



=== Products/ZopeVersionControl/Version.py 1.9 => 1.10 ===
--- Products/ZopeVersionControl/Version.py:1.9	Fri Jan 30 13:59:39 2004
+++ Products/ZopeVersionControl/Version.py	Fri Mar 12 16:08:10 2004
@@ -22,6 +22,7 @@
 from Globals import InitializeClass, Persistent
 from AccessControl import ClassSecurityInfo
 from BTrees.OOBTree import OOBTree
+from OFS.SimpleItem import SimpleItem
 
 from Utility import VersionControlError
 from nonversioned import listNonVersionedObjects, removeNonVersionedData
@@ -46,7 +47,11 @@
 
     def persistent_load(ref):
         assert ref == 'ignored'
-        return None
+        # Return a placeholder object that will be replaced by
+        # removeNonVersionedData().
+        placeholder = SimpleItem()
+        placeholder.id = "ignored_subobject"
+        return placeholder
 
     stream = StringIO()
     p = Pickler(stream, 1)




More information about the Zope-CVS mailing list