[Zope3-checkins] CVS: ZODB4/src/zodb - connection.py:1.7.4.9 db.py:1.7.4.4 export.py:1.4.4.2

Barry Warsaw barry@wooz.org
Thu, 13 Mar 2003 14:40:12 -0500


Update of /cvs-repository/ZODB4/src/zodb
In directory cvs.zope.org:/tmp/cvs-serv9877

Modified Files:
      Tag: opaque-pickles-branch
	connection.py db.py export.py 
Log Message:
> Next step: get rid of the tuple in the argument list.

Completed.

Also, reorder the arguments to restore() so that data and refs are
buddies again, just like in the store() call.

I believe we're ready to merge back to the head.


=== ZODB4/src/zodb/connection.py 1.7.4.8 => 1.7.4.9 ===
--- ZODB4/src/zodb/connection.py:1.7.4.8	Thu Mar 13 11:12:50 2003
+++ ZODB4/src/zodb/connection.py	Thu Mar 13 14:39:42 2003
@@ -470,8 +470,9 @@
                 self._inv_lock.release()
             self._modified.add(oid)
 
-        s = self._storage.store(oid, serial, writer.getState(pobject),
-                                self._version, transaction)
+        data, refs = writer.getState(pobject)
+        s = self._storage.store(oid, serial, data, refs, self._version,
+                                transaction)
         # Put the object in the cache before handling the
         # response, just in case the response contains the
         # serial number for a newly created object
@@ -494,7 +495,7 @@
 
         for oid in tmp._index:
             data, refs, serial = tmp.loadrefs(oid, tmp._bver)
-            s = self._storage.store(oid, serial, (data, refs),
+            s = self._storage.store(oid, serial, data, refs,
                                     self._version, txn)
             self._handle_serial(s, oid, change=False)
         tmp.close()
@@ -609,7 +610,7 @@
     def newObjectId(self):
         return self._storage.newObjectId()
 
-    def store(self, oid, serial, (data, refs), version, transaction):
+    def store(self, oid, serial, data, refs, version, transaction):
         if transaction is not self._transaction:
             raise interfaces.StorageTransactionError(self, transaction)
         self._file.seek(self._pos)


=== ZODB4/src/zodb/db.py 1.7.4.3 => 1.7.4.4 ===
--- ZODB4/src/zodb/db.py:1.7.4.3	Wed Mar 12 16:51:39 2003
+++ ZODB4/src/zodb/db.py	Thu Mar 13 14:39:42 2003
@@ -86,7 +86,10 @@
             # Create the database's root in the storage if it doesn't exist
             t = Transaction(description="initial database creation")
             storage.tpcBegin(t)
-            storage.store(ZERO, None, getDBRoot(), '', t)
+            # Because this is the initial root object, we know it can't have
+            # any references, so include a longer comment then it would take
+            # to unpack getDBRoot()'s return value.
+            storage.store(ZERO, None, getDBRoot()[0], [], '', t)
             storage.tpcVote(t)
             storage.tpcFinish(t)
 


=== ZODB4/src/zodb/export.py 1.4.4.1 => 1.4.4.2 ===
--- ZODB4/src/zodb/export.py:1.4.4.1	Mon Feb 10 17:47:47 2003
+++ ZODB4/src/zodb/export.py	Thu Mar 13 14:39:42 2003
@@ -127,5 +127,6 @@
             else:
                 newObjectId = new_ref[0]
 
-            new = copier.copy(p)
-            self._storage.store(newObjectId, None, new, self._version, txn)
+            data, refs = copier.copy(p)
+            self._storage.store(newObjectId, None, data, refs,
+                                self._version, txn)