Commit 9c35ba71 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Switch undoLog to private and accept a parameter to retreive or not OIDs about

each transaction in the log. So use it as before for undoLog() API
implementation and for the iterator that requires the OID list.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@1162 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent ac9d6bc9
......@@ -864,7 +864,7 @@ class Application(object):
data = data)
return self.local_var.tid, oid_list
def undoLog(self, first, last, filter=None, block=0):
def __undoLog(self, first, last, filter=None, block=0, with_oids=False):
if last < 0:
# See FileStorage.py for explanation
last = first - last
......@@ -927,9 +927,8 @@ class Application(object):
'be found' % (tid, )
if filter is None or filter(self.local_var.txn_info):
# XXX: oids entry is not needed by undoLog but required for the
# iterator, this code should be splited then specialized
#self.local_var.txn_info.pop("oids")
if not with_oids:
self.local_var.txn_info.pop("oids")
append(self.local_var.txn_info)
if len(undo_info) >= last - first:
break
......@@ -939,6 +938,12 @@ class Application(object):
undo_info = self.undoLog(first=first, last=last*5, filter=filter, block=1)
return undo_info
def undoLog(self, first, last, filter=None, block=0):
return self.__undoLog(self, first, last, filter, block)
def transactionLog(self, first, last):
return self.__undoLog(self, first, last, with_oids=True)
def history(self, oid, version=None, length=1, filter=None, object_only=0):
# Get history informations for object first
cell_list = self._getCellListForOID(oid, readable=True)
......
......@@ -89,7 +89,7 @@ class Iterator(object):
app = self.app
if not self.txn_list:
# ask some transactions
self.txn_list = app.undoLog(self.index, self.index + 100)
self.txn_list = app.transactionLog(self.index, self.index + 100)
if not self.txn_list:
# scan finished
raise StopIteration
......
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