[Zodb-checkins] CVS: Zope3/src/zodb/storage - bdbfull.py:1.18

Barry Warsaw barry@wooz.org
Fri, 14 Mar 2003 15:44:50 -0500


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

Modified Files:
	bdbfull.py 
Log Message:
_dostore(), _undo_to_same_pickle(): Conflict resolution now returns a
2-tuple of the data and the refs (as a list of oids).

_doundo(): We have to join the list of oids in refs for storage.


=== Zope3/src/zodb/storage/bdbfull.py 1.17 => 1.18 ===
--- Zope3/src/zodb/storage/bdbfull.py:1.17	Fri Mar 14 12:18:52 2003
+++ Zope3/src/zodb/storage/bdbfull.py	Fri Mar 14 15:44:50 2003
@@ -497,7 +497,7 @@
             # given in the call is not the same as the last stored serial
             # number.  First, attempt application level conflict
             # resolution, and if that fails, raise a ConflictError.
-            data = self._conflict.resolve(oid, oserial, serial, data)
+            data, refs = self._conflict.resolve(oid, oserial, serial, data)
             conflictresolved = True
         # Do we already know about this version?  If not, we need to record
         # the fact that a new version is being created.  version will be the
@@ -1145,11 +1145,8 @@
         else:
             # Attempt application level conflict resolution
             try:
-                # XXX this needs to be converted to opaque pickles
-                data = self._conflict.resolve(
+                data, refs = self._conflict.resolve(
                     oid, ctid, tid, self._pickles[oid+target_lrevid])
-                from zodb.serialize import findrefs
-                refs = ''.join(findrefs(data))
             except ConflictError:
                 raise UndoError, 'Cannot undo transaction'
             return oid, target_metadata, data, refs
@@ -1197,7 +1194,7 @@
                 # data and refs go hand in hand
                 assert refs is not None
                 self._pickles.put(revid, data, txn=txn)
-                self._references.put(revid, refs, txn=txn)
+                self._references.put(revid, EMPTYSTRING.join(refs), txn=txn)
                 metadata = vid+nvrevid+newserial+prevrevid
             else:
                 # data and refs go hand in hand