Commit 21c17f1e authored by Julien Muchembled's avatar Julien Muchembled

Zope 2.8: fix manage_change_history_page with DemoStorage

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35771 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5d29d570
...@@ -156,6 +156,8 @@ else: # Zope 2.8 ...@@ -156,6 +156,8 @@ else: # Zope 2.8
DemoStorage.loadBefore = loadBefore DemoStorage.loadBefore = loadBefore
from persistent.TimeStamp import TimeStamp
def history(self, oid, version=None, length=1, filter=None): def history(self, oid, version=None, length=1, filter=None):
assert not version assert not version
self._lock_acquire() self._lock_acquire()
...@@ -165,12 +167,18 @@ else: # Zope 2.8 ...@@ -165,12 +167,18 @@ else: # Zope 2.8
while length and pre: while length and pre:
oid, pre, vdata, p, tid = pre oid, pre, vdata, p, tid = pre
assert vdata is None assert vdata is None
d = {'tid': tid, 'size': len(p), 'version': ''} d = {'tid': tid, 'size': len(p), 'version': '',
'time': TimeStamp(tid).timeTime()}
if filter is None or filter(d): if filter is None or filter(d):
r.append(d) r.append(d)
length -= 1 length -= 1
if length: if length:
r += self._base.history(oid, version, length, filter) try:
self._base.modifiedInVersion(oid)
except POSException.POSKeyError:
pass
else:
r += self._base.history(oid, version, length, filter)
return r return r
finally: finally:
self._lock_release() self._lock_release()
......
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