Commit 5aa55c96 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Fix two bugs in client/app.py :

* undo() fail when trying to undo a transaction where there is the first
revision of an object. Those transaction are now considered as non-undoable as
in FileStorage.
* in undoLog() node list was filtered with cell state values.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@395 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 7c980e50
......@@ -690,12 +690,11 @@ class Application(object):
# Second get object data from storage node using loadBefore
data_dict = {}
for oid in oid_list:
try:
data, start, end = self.loadBefore(oid, transaction_id)
except NEOStorageNotFoundError:
# Object created by transaction, so no previous record
data_dict[oid] = None
continue
result = self.loadBefore(oid, transaction_id)
# no previous revision, can't undo
if result is None:
raise UndoError("non-undoable transaction", oid)
data, start, end = result
# end must be TID we are going to undone otherwise it means
# a later transaction modify the object
if end != transaction_id:
......@@ -725,8 +724,13 @@ class Application(object):
last = first - last
# First get a list of transactions from all storage nodes.
storage_node_list = [x for x in self.pt.getNodeList() if x.getState() \
in (UP_TO_DATE_STATE, FEEDING_STATE)]
#storage_node_list = [x for x in self.pt.getNodeList() if x.getState() \
# in (UP_TO_DATE_STATE, FEEDING_STATE)]
storage_node_list = []
for cell in self.pt.getCellList(0): # FIXME: check the argument
if cell.getState() in (UP_TO_DATE_STATE, FEEDING_STATE):
storage_node_list.append(cell.getNode())
self.local_var.node_tids = {}
for storage_node in storage_node_list:
conn = self.cp.getConnForNode(storage_node)
......
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