[Zope-Checkins] CVS: ZODB3/ZODB - DemoStorage.py:1.13 FileStorage.py:1.96

Jim Fulton jim@zope.com
Wed, 28 Aug 2002 09:28:18 -0400


Update of /cvs-repository/ZODB3/ZODB
In directory cvs.zope.org:/tmp/cvs-serv24587/ZODB

Modified Files:
	DemoStorage.py FileStorage.py 
Log Message:
Added a test to check that abortVersion and commitVersion assign new
serials. Modified FileStorage and DemoStorage to pass this test.


=== ZODB3/ZODB/DemoStorage.py 1.12 => 1.13 ===
--- ZODB3/ZODB/DemoStorage.py:1.12	Wed Aug 14 18:07:09 2002
+++ ZODB3/ZODB/DemoStorage.py	Wed Aug 28 09:28:17 2002
@@ -137,6 +137,7 @@
             v=self._vindex.get(src, None)
             if not v: return
 
+            newserial = self._serial
             tindex=self._tindex
             oids=[]
             for r in v.values():
@@ -144,7 +145,7 @@
                 if nv:
                     oids.append(oid)
                     oid, serial, pre, vdata, p = nv
-                    tindex.append([oid, serial, r, None, p])
+                    tindex.append([oid, newserial, r, None, p])
                 else:
                     # effectively, delete the thing
                     tindex.append([oid, None, r, None, None])
@@ -168,6 +169,7 @@
             v=self._vindex.get(src, None)
             if v is None: return
 
+            newserial = self._serial
             tindex=self._tindex
             oids=[]
             for r in v.values():
@@ -178,7 +180,7 @@
                     new_vdata = dest, vdata[1]
                 else:
                     new_vdata = None
-                tindex.append([oid, serial, r, new_vdata, p])
+                tindex.append([oid, newserial, r, new_vdata, p])
 
 
             return oids


=== ZODB3/ZODB/FileStorage.py 1.95 => 1.96 ===
--- ZODB3/ZODB/FileStorage.py:1.95	Wed Aug 14 18:07:09 2002
+++ ZODB3/ZODB/FileStorage.py	Wed Aug 28 09:28:17 2002
@@ -483,6 +483,7 @@
         current_oids = {}
         t = None
         tstatus = ' '
+        newserial = self._serial
 
         while srcpos:
             self._file.seek(srcpos)
@@ -494,7 +495,7 @@
                 # This is a current record!
                 self._tindex[oid] = here
                 oids.append(oid)
-                self._tfile.write(h[:16] + spos + middle)
+                self._tfile.write(oid + newserial + spos + middle)
                 if dest:
                     self._tvindex[dest] = here
                     self._tfile.write(pnv + sd + dest)