[Zope-Checkins] SVN: Zope/trunk/ Updated to ZODB 3.9.0a10. ZODB-level version support has been removed and ZopeUndo now is part of Zope2.

Hanno Schlichting plone at hannosch.info
Mon Feb 9 05:42:22 EST 2009


Log message for revision 96302:
  Updated to ZODB 3.9.0a10. ZODB-level version support has been removed and ZopeUndo now is part of Zope2.
  

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/src/OFS/History.py
  U   Zope/trunk/src/OFS/XMLExportImport.py
  U   Zope/trunk/src/OFS/tests/testHistory.py
  U   Zope/trunk/src/Products/TemporaryFolder/TemporaryFolder.py
  U   Zope/trunk/src/Products/TemporaryFolder/mount.py
  U   Zope/trunk/src/Products/ZODBMountPoint/tests/testMountPoint.py
  U   Zope/trunk/src/Zope2/Startup/tests/test_schema.py
  A   Zope/trunk/src/ZopeUndo/
  U   Zope/trunk/versions-zope2.cfg

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===================================================================
--- Zope/trunk/doc/CHANGES.txt	2009-02-09 10:32:17 UTC (rev 96301)
+++ Zope/trunk/doc/CHANGES.txt	2009-02-09 10:42:22 UTC (rev 96302)
@@ -9,6 +9,9 @@
 
     Restructuring
 
+      - Updated to ZODB 3.9.0a10. ZODB-level version support has been
+        removed and ZopeUndo now is part of Zope2.
+
       - The Zope2 SVN trunk is now a buildout pulling in all dependencies as
         actual released packages and not SVN externals anymore.
 

Modified: Zope/trunk/src/OFS/History.py
===================================================================
--- Zope/trunk/src/OFS/History.py	2009-02-09 10:32:17 UTC (rev 96301)
+++ Zope/trunk/src/OFS/History.py	2009-02-09 10:42:22 UTC (rev 96302)
@@ -117,8 +117,7 @@
             first=request.get('first_transaction', first)
             last=request.get('last_transaction',last)
 
-
-        r=self._p_jar.db().history(self._p_oid, None, last)
+        r=self._p_jar.db().history(self._p_oid, size=last)
         if r is None:
             # storage doesn't support history
             return ()

Modified: Zope/trunk/src/OFS/XMLExportImport.py
===================================================================
--- Zope/trunk/src/OFS/XMLExportImport.py	2009-02-09 10:32:17 UTC (rev 96301)
+++ Zope/trunk/src/OFS/XMLExportImport.py	2009-02-09 10:42:22 UTC (rev 96302)
@@ -38,7 +38,6 @@
     elif type(file) is str: file=open(file,'w+b')
     write=file.write
     write('<?xml version="1.0"?>\012<ZopeData>\012')
-    version=jar._version
     ref=referencesf
     oids=[oid]
     done_oids={}
@@ -49,8 +48,15 @@
         del oids[0]
         if done(oid): continue
         done_oids[oid]=1
-        try: p, serial = load(oid, version)
-        except: pass # Ick, a broken reference
+        try:
+            try:
+                p, serial = load(oid)
+            except TypeError:
+                # Some places inside the ZODB 3.9 still want a version
+                # argument, for example TmpStore from Connection.py
+                p, serial = load(oid, None)
+        except:
+            pass # Ick, a broken reference
         else:
             ref(p, oids)
             write(XMLrecord(oid,len(p),p))

Modified: Zope/trunk/src/OFS/tests/testHistory.py
===================================================================
--- Zope/trunk/src/OFS/tests/testHistory.py	2009-02-09 10:32:17 UTC (rev 96301)
+++ Zope/trunk/src/OFS/tests/testHistory.py	2009-02-09 10:42:22 UTC (rev 96302)
@@ -60,7 +60,7 @@
         for i in range(3):
             entry = r[i]
             # check no new keys show up without testing
-            self.assertEqual(len(entry.keys()),7)
+            self.assertEqual(len(entry.keys()),6)
             # the transactions are in newest-first order
             self.assertEqual(entry['description'],'Change %i' % (3-i))
             self.failUnless('key' in entry) 
@@ -72,8 +72,7 @@
                 # check times are increasing
                 self.failUnless(entry['time']<r[i-1]['time'])
             self.assertEqual(entry['user_name'],'')
-            self.assertEqual(entry['version'],'')
-            
+
     def test_manage_historyCopy(self):
         # we assume this works 'cos it's tested above
         r = self.ps.manage_change_history()

Modified: Zope/trunk/src/Products/TemporaryFolder/TemporaryFolder.py
===================================================================
--- Zope/trunk/src/Products/TemporaryFolder/TemporaryFolder.py	2009-02-09 10:32:17 UTC (rev 96301)
+++ Zope/trunk/src/Products/TemporaryFolder/TemporaryFolder.py	2009-02-09 10:42:22 UTC (rev 96302)
@@ -72,15 +72,9 @@
 
     manage_traceback = DTMLFile('dtml/mountfail', globals())
 
-    def _createDB(self, db=None): # huh?  db=db was original
+    def _createDB(self):
         """ Create a mounted RAM database """
-        db = DB(TemporaryStorage())
-        # the connection in 2.5.X - 2.6.1 was a "low conflict connection",
-        # but this caused synchronization problems.  For 2.6.2, we want
-        # to reenable read conflict errors, so we use a default connection
-        # type.
-        #db.klass = LowConflictConnection
-        return db
+        return DB(TemporaryStorage())
 
     def _getMountRoot(self, root):
         sdc = root.get('folder', None)

Modified: Zope/trunk/src/Products/TemporaryFolder/mount.py
===================================================================
--- Zope/trunk/src/Products/TemporaryFolder/mount.py	2009-02-09 10:32:17 UTC (rev 96301)
+++ Zope/trunk/src/Products/TemporaryFolder/mount.py	2009-02-09 10:42:22 UTC (rev 96302)
@@ -139,7 +139,7 @@
         if jar is None:
             # Get _p_jar from parent.
             self._p_jar = jar = parent._p_jar
-        conn = db.open(version=jar.getVersion())
+        conn = db.open()
 
         # Add an attribute to the connection which
         # makes it possible for us to find the primary

Modified: Zope/trunk/src/Products/ZODBMountPoint/tests/testMountPoint.py
===================================================================
--- Zope/trunk/src/Products/ZODBMountPoint/tests/testMountPoint.py	2009-02-09 10:32:17 UTC (rev 96301)
+++ Zope/trunk/src/Products/ZODBMountPoint/tests/testMountPoint.py	2009-02-09 10:42:22 UTC (rev 96302)
@@ -37,7 +37,7 @@
     def __init__(self, fname, mpoints):
         self.fname = fname
         self.mpoints = mpoints
-        
+
     def getDB(self):
         from ZODB.config import DemoStorage
         from ZODB.Connection import Connection
@@ -45,18 +45,25 @@
         self.name = self.fname
         self.base = None
         self.path = os.path.join(os.path.dirname(__file__),  self.fname)
+        self.cache_size = 5000
+        self.cache_size_bytes = 0
+        self.class_factory = None
+        self.connection_class = Connection
+        self.container_class = None
         self.create = None
+        self.factories = ()
+        self.historical_pool_size = 3
+        self.historical_cache_size = 1000
+        self.historical_cache_size_bytes = 0
+        self.historical_timeout = 300
+        self.mount_points = self.mpoints
+        self.pool_size = 7
+        self.pool_timeout = 1<<31
+        self.quota = None
         self.read_only = None
-        self.quota = None
-        self.cache_size = 5000
-        self.pool_size = 7
+        self.storage = DemoStorage(self)
+        self.version_cache_size = 100
         self.version_pool_size = 3
-        self.version_cache_size = 100
-        self.mount_points = self.mpoints
-        self.connection_class = Connection
-        self.class_factory = None
-        self.storage = DemoStorage(self)
-        self.container_class = None
         return ZopeDatabase(self)
 
     def getSectionName(self):

Modified: Zope/trunk/src/Zope2/Startup/tests/test_schema.py
===================================================================
--- Zope/trunk/src/Zope2/Startup/tests/test_schema.py	2009-02-09 10:32:17 UTC (rev 96301)
+++ Zope/trunk/src/Zope2/Startup/tests/test_schema.py	2009-02-09 10:42:22 UTC (rev 96302)
@@ -30,6 +30,7 @@
 
 TEMPNAME = tempfile.mktemp()
 TEMPPRODUCTS = os.path.join(TEMPNAME, "Products")
+TEMPVAR = os.path.join(TEMPNAME, "var")
 
 def getSchema():
     startup = os.path.dirname(os.path.realpath(Zope2.Startup.__file__))
@@ -57,10 +58,12 @@
             text.replace("<<INSTANCE_HOME>>", TEMPNAME))
         os.mkdir(TEMPNAME)
         os.mkdir(TEMPPRODUCTS)
+        os.mkdir(TEMPVAR)
         try:
             conf, handler = ZConfig.loadConfigFile(schema, sio)
         finally:
             os.rmdir(TEMPPRODUCTS)
+            os.rmdir(TEMPVAR)
             os.rmdir(TEMPNAME)
         self.assertEqual(conf.instancehome, TEMPNAME)
         return conf, handler
@@ -198,8 +201,6 @@
                 mount-point                    /
                 cache-size                     5000
                 pool-size                      7
-                version-pool-size              3
-                version-cache-size             100
             </zodb_db>
             """)
         self.assertEqual(conf.databases[0].config.connection_class.__name__,

Modified: Zope/trunk/versions-zope2.cfg
===================================================================
--- Zope/trunk/versions-zope2.cfg	2009-02-09 10:32:17 UTC (rev 96301)
+++ Zope/trunk/versions-zope2.cfg	2009-02-09 10:42:22 UTC (rev 96302)
@@ -11,8 +11,6 @@
 Persistence = 2.11.1
 tempstorage = 2.11.1
 zLOG = 2.11.1
-ZODB3 = 3.8.1
-# ZODB3 = 3.9.0a10 - this causes some errors for the removed versions support
 zc.lockfile = 1.0
 transaction = 1.0a1
 zope.broken = 3.5.0



More information about the Zope-Checkins mailing list