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