Commit 95f9483c authored by Jeremy Hylton's avatar Jeremy Hylton

Fix conflict resolution bug in transactionalUndo.

The value of _loadBack() -- a pickle and a serialno -- was being
passed to tryToResolveConflict() where only a pickle was expected.

XXX _loadBack() can raise KeyError, but this wasn't handled by the
code.  Turn into UndoError() for now.
parent 23387167
...@@ -184,7 +184,7 @@ ...@@ -184,7 +184,7 @@
# may have a back pointer to a version record or to a non-version # may have a back pointer to a version record or to a non-version
# record. # record.
# #
__version__='$Revision: 1.54 $'[11:-2] __version__='$Revision: 1.55 $'[11:-2]
import struct, time, os, bpthread, string, base64, sys import struct, time, os, bpthread, string, base64, sys
from struct import pack, unpack from struct import pack, unpack
...@@ -937,8 +937,13 @@ class FileStorage(BaseStorage.BaseStorage, ...@@ -937,8 +937,13 @@ class FileStorage(BaseStorage.BaseStorage,
# we can just copy our previous-record pointer forward # we can just copy our previous-record pointer forward
return '', pre, version, snv, ipos return '', pre, version, snv, ipos
data=self.tryToResolveConflict( try:
oid, cserial, serial, _loadBack(self._file, oid, p64(pre)), cdata) # returns data, serial tuple
bdata = _loadBack(self._file, oid, p64(pre))[0]
except KeyError:
# couldn't find oid; what's the real explanation for this?
raise UndoError("_loadBack() failed for %s" % repr(oid))
data=self.tryToResolveConflict(oid, cserial, serial, bdata, cdata)
if data: if data:
return data, 0, version, snv, ipos return data, 0, version, snv, ipos
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment