[Zodb-checkins] CVS: Zope2/lib/python/ZODB - ConflictResolution.py:1.4
Jim Fulton
jim@digicool.com
Thu, 12 Apr 2001 15:46:08 -0400 (EDT)
Update of /cvs-repository/Zope2/lib/python/ZODB
In directory korak:/tmp/cvs-serv22010
Modified Files:
ConflictResolution.py
Log Message:
Added an optional argument to allow you to pass the
committed state in. This is needed wheh the "committed" state,
um, hasn't been committed yet, such as when you are undoing
multiple transactions transactionally.
--- Updated File ConflictResolution.py in package Zope2/lib/python/ZODB --
--- ConflictResolution.py 2001/04/10 23:13:28 1.3
+++ ConflictResolution.py 2001/04/12 19:46:07 1.4
@@ -98,8 +98,8 @@
return getattr(__import__(location, _globals, _globals, _silly),
name)
-def state(self, oid, serial, prfactory):
- p=self.loadSerial(oid, serial)
+def state(self, oid, serial, prfactory, p=''):
+ p=p or self.loadSerial(oid, serial)
file=StringIO(p)
unpickler=Unpickler(file)
unpickler.persistent_load=prfactory
@@ -142,7 +142,8 @@
return None
return object.data
-def tryToResolveConflict(self, oid, committedSerial, oldSerial, newpickle):
+def tryToResolveConflict(self, oid, committedSerial, oldSerial, newpickle,
+ committedData=''):
#class_tuple, old, committed, newstate = ('',''), 0, 0, 0
try:
file=StringIO(newpickle)
@@ -168,7 +169,7 @@
return 0
old=state(self, oid, oldSerial, prfactory)
- committed=state(self, oid, committedSerial, prfactory)
+ committed=state(self, oid, committedSerial, prfactory, committedData)
resolved=resolve(old, committed, newstate)