Commit 862b0ba4 authored by Julien Muchembled's avatar Julien Muchembled

Fix 2 bugs in 'undo' implementation

- make 'undo' compatible with ZODB 3.9.x
- fix load of original version of object

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2765 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 769d309d
...@@ -860,9 +860,9 @@ class Application(object): ...@@ -860,9 +860,9 @@ class Application(object):
# object. This is an undo conflict, try to resolve it. # object. This is an undo conflict, try to resolve it.
try: try:
# Load the latest version we are supposed to see # Load the latest version we are supposed to see
data = self.load(oid, current_serial, snapshot_tid)[0] data = self.load(oid, current_serial)[0]
# Load the version we were undoing to # Load the version we were undoing to
undo_data = self.load(oid, undo_serial, snapshot_tid)[0] undo_data = self.load(oid, undo_serial)[0]
except NEOStorageNotFoundError: except NEOStorageNotFoundError:
raise UndoError('Object not found while resolving undo ' raise UndoError('Object not found while resolving undo '
'conflict') 'conflict')
...@@ -878,6 +878,8 @@ class Application(object): ...@@ -878,6 +878,8 @@ class Application(object):
undo_serial = None undo_serial = None
self._store(txn_context, oid, current_serial, data, undo_serial) self._store(txn_context, oid, current_serial, data, undo_serial)
return None, () # required for ZODB < 3.10
def _insertMetadata(self, txn_info, extension): def _insertMetadata(self, txn_info, extension):
for k, v in loads(extension).items(): for k, v in loads(extension).items():
txn_info[k] = v txn_info[k] = v
......
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