Commit 9c175d11 authored by Barry Warsaw's avatar Barry Warsaw

history(): The storage interface API documents the third argument (not

including self) to be called `size' not `length'.  This should be
considered part of the contract of this method, so the keyword
argument name has been changed.
parent 52fd3e26
...@@ -184,7 +184,7 @@ ...@@ -184,7 +184,7 @@
# may have a back pointer to a version record or to a non-version # may have a back pointer to a version record or to a non-version
# record. # record.
# #
__version__='$Revision: 1.59 $'[11:-2] __version__='$Revision: 1.60 $'[11:-2]
import struct, time, os, bpthread, string, base64, sys import struct, time, os, bpthread, string, base64, sys
from struct import pack, unpack from struct import pack, unpack
...@@ -1132,7 +1132,7 @@ class FileStorage(BaseStorage.BaseStorage, ...@@ -1132,7 +1132,7 @@ class FileStorage(BaseStorage.BaseStorage,
return r return r
def history(self, oid, version=None, length=1, filter=None): def history(self, oid, version=None, size=1, filter=None):
self._lock_acquire() self._lock_acquire()
try: try:
r=[] r=[]
...@@ -1143,7 +1143,7 @@ class FileStorage(BaseStorage.BaseStorage, ...@@ -1143,7 +1143,7 @@ class FileStorage(BaseStorage.BaseStorage,
wantver=version wantver=version
while 1: while 1:
if len(r) >= length: return r if len(r) >= size: return r
seek(pos) seek(pos)
h=read(42) h=read(42)
doid,serial,prev,tloc,vlen,plen = unpack(">8s8s8s8sH8s", h) doid,serial,prev,tloc,vlen,plen = unpack(">8s8s8s8sH8s", h)
......
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