[Zope3-checkins] CVS: ZODB4/src/zodb/storage - bdbfull.py:1.12.4.6 bdbminimal.py:1.11.4.5 file.py:1.8.4.16 interfaces.py:1.5.4.5 mapping.py:1.3.4.4

Barry Warsaw barry@wooz.org
Thu, 13 Mar 2003 11:32:22 -0500


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

Modified Files:
      Tag: opaque-pickles-branch
	bdbfull.py bdbminimal.py file.py interfaces.py mapping.py 
Log Message:
Baby steps: all store() methods now unpack the (data, refs) tuple in
their argument lists.  This also fixes all the tests to conform.

Next step: get rid of the tuple in the argument list.


=== ZODB4/src/zodb/storage/bdbfull.py 1.12.4.5 => 1.12.4.6 ===
--- ZODB4/src/zodb/storage/bdbfull.py:1.12.4.5	Wed Mar 12 16:42:37 2003
+++ ZODB4/src/zodb/storage/bdbfull.py	Thu Mar 13 11:31:51 2003
@@ -480,8 +480,7 @@
     # Storing an object revision in a transaction
     #
 
-    def _dostore(self, txn, oid, serial, data, version):
-        data, refs = data
+    def _dostore(self, txn, oid, serial, data, refs, version):
         conflictresolved = False
         vid = nvrevid = ovid = ZERO
         # Check for conflict errors.  JF says: under some circumstances,
@@ -557,13 +556,14 @@
             return ResolvedSerial
         return newserial
 
-    def store(self, oid, serial, data, version, transaction):
+    def store(self, oid, serial, (data, refs), version, transaction):
         # Lock and transaction wrapper
         if transaction is not self._transaction:
             raise StorageTransactionError(self, transaction)
         self._lock_acquire()
         try:
-            return self._withtxn(self._dostore, oid, serial, data, version)
+            return self._withtxn(self._dostore, oid, serial,
+                                 data, refs, version)
         finally:
             self._lock_release()
 


=== ZODB4/src/zodb/storage/bdbminimal.py 1.11.4.4 => 1.11.4.5 ===
--- ZODB4/src/zodb/storage/bdbminimal.py:1.11.4.4	Wed Mar 12 16:42:56 2003
+++ ZODB4/src/zodb/storage/bdbminimal.py	Thu Mar 13 11:31:51 2003
@@ -264,8 +264,7 @@
         else:
             txn.commit()
 
-    def _dostore(self, txn, oid, serial, data):
-        data, refs = data
+    def _dostore(self, txn, oid, serial, data, refs):
         conflictresolved = False
         oserial = self._getCurrentSerial(oid)
         if oserial is not None and serial <> oserial:
@@ -295,7 +294,7 @@
             return ResolvedSerial
         return newserial
 
-    def store(self, oid, serial, data, version, transaction):
+    def store(self, oid, serial, (data, refs), version, transaction):
         if transaction is not self._transaction:
             raise StorageTransactionError(self, transaction)
         # We don't support versions
@@ -304,7 +303,7 @@
         # All updates must be done with the application lock acquired
         self._lock_acquire()
         try:
-            return self._withtxn(self._dostore, oid, serial, data)
+            return self._withtxn(self._dostore, oid, serial, data, refs)
         finally:
             self._lock_release()
 


=== ZODB4/src/zodb/storage/file.py 1.8.4.15 => 1.8.4.16 ===
--- ZODB4/src/zodb/storage/file.py:1.8.4.15	Wed Mar 12 16:53:48 2003
+++ ZODB4/src/zodb/storage/file.py	Thu Mar 13 11:31:51 2003
@@ -835,13 +835,12 @@
         finally:
             self._lock_release()
 
-    def store(self, oid, serial, data, version, transaction):
+    def store(self, oid, serial, (data, refs), version, transaction):
         if self._is_read_only:
             raise ReadOnlyError()
         if transaction is not self._transaction:
             raise StorageTransactionError(self, transaction)
 
-        data, refs = data
         self._lock_acquire()
         try:
             old = self._index.get(oid, 0)


=== ZODB4/src/zodb/storage/interfaces.py 1.5.4.4 => 1.5.4.5 ===
--- ZODB4/src/zodb/storage/interfaces.py:1.5.4.4	Wed Mar 12 16:43:49 2003
+++ ZODB4/src/zodb/storage/interfaces.py	Thu Mar 13 11:31:51 2003
@@ -109,7 +109,7 @@
     def getSerial(oid):
         """Return the current serial number for oid."""
 
-    def store(oid, serial, data, version, txn):
+    def store(oid, serial, (data, refs), version, txn):
         """Store an object and returns a new serial number.
 
         Arguments:
@@ -117,6 +117,7 @@
         serial -- the serial number of the revision read by txn, a string
         data -- a 2-tuple of the data record (string), and the oids of the
                 objects referenced by the this object, as a list
+        refs -- the list of object ids of objects referenced by the data
         version -- the version, a string, typically the empty string
         txn -- the current transaction
 


=== ZODB4/src/zodb/storage/mapping.py 1.3.4.3 => 1.3.4.4 ===
--- ZODB4/src/zodb/storage/mapping.py:1.3.4.3	Wed Mar 12 16:44:11 2003
+++ ZODB4/src/zodb/storage/mapping.py	Thu Mar 13 11:31:51 2003
@@ -54,14 +54,13 @@
         finally:
             self._lock_release()
 
-    def store(self, oid, serial, data, version, transaction):
+    def store(self, oid, serial, (data, refs), version, transaction):
         if transaction is not self._transaction:
             raise StorageTransactionError(self, transaction)
 
         if version:
             raise NotImplementedError
 
-        pckdata, refs = data
         self._lock_acquire()
         try:
             if self._index.has_key(oid):
@@ -69,7 +68,7 @@
                 if serial != oserial:
                     raise interfaces.ConflictError(serials=(oserial, serial))
             serial = self._serial
-            self._tindex.append((oid, serial, pckdata, refs))
+            self._tindex.append((oid, serial, data, refs))
         finally:
             self._lock_release()
         return serial