[Zodb-checkins] CVS: Zope3/src/zodb/storage - file.py:1.7 base.py:1.11

Jeremy Hylton jeremy@zope.com
Mon, 3 Feb 2003 18:00:50 -0500


Update of /cvs-repository/Zope3/src/zodb/storage
In directory cvs.zope.org:/tmp/cvs-serv22548

Modified Files:
	file.py base.py 
Log Message:
Call yagni on the history() method.


=== Zope3/src/zodb/storage/file.py 1.6 => 1.7 ===
--- Zope3/src/zodb/storage/file.py:1.6	Fri Jan 24 18:20:52 2003
+++ Zope3/src/zodb/storage/file.py	Mon Feb  3 18:00:45 2003
@@ -1434,55 +1434,6 @@
 
         return r
 
-    def history(self, oid, version=None, size=1, filter=None):
-        self._lock_acquire()
-        try:
-            r=[]
-            file=self._file
-            seek=file.seek
-            read=file.read
-            pos=self._index[oid]
-            wantver=version
-
-            while 1:
-                if len(r) >= size:
-                    return r
-                h = self._read_data_header(pos)
-                if h.version:
-                    if wantver is not None and h.version != wantver:
-                        if h.prev:
-                            pos = h.prev
-                            continue
-                        else:
-                            return r
-                else:
-                    wantver = None
-
-                seek(h.tloc)
-                th=read(TRANS_HDR_LEN)
-                tid, tl, status, ul, dl, el = unpack(TRANS_HDR,th)
-                user_name=read(ul)
-                description=read(dl)
-                if el: d=loads(read(el))
-                else: d={}
-
-                d['time'] = TimeStamp(h.serial).timeTime()
-                d['user_name'] = user_name
-                d['description'] = description
-                d['serial'] = h.serial
-                d['version'] = h.version
-                d['size'] = h.plen
-
-                if filter is None or filter(d):
-                    r.append(d)
-
-                if h.prev:
-                    pos = h.prev
-                else:
-                    return r
-        finally:
-            self._lock_release()
-
     def pack(self, t):
         """Copy data from the current database file to a packed file
 


=== Zope3/src/zodb/storage/base.py 1.10 => 1.11 ===
--- Zope3/src/zodb/storage/base.py:1.10	Fri Jan 24 18:20:52 2003
+++ Zope3/src/zodb/storage/base.py	Mon Feb  3 18:00:45 2003
@@ -110,9 +110,6 @@
     def setVersion(self, version):
         self._version = version
 
-    def history(self, oid, version, length=1):
-        pass
-
     def modifiedInVersion(self, oid):
         return ''
 
@@ -239,7 +236,7 @@
         # Subclasses should define this to supply transaction finish actions.
         pass
 
-    # XXX One of these two should go
+    # XXX should remove undoLog() and only export undoInfo()
 
     def undoInfo(self, first=0, last=-20, specification=None):
         """Return a list of transaction descriptions for use with undo.