[Zodb-checkins] CVS: ZODB4/ZODB - FileStorage.py:1.106

Jeremy Hylton jeremy@zope.com
Mon, 2 Dec 2002 17:46:37 -0500


Update of /cvs-repository/ZODB4/ZODB
In directory cvs.zope.org:/tmp/cvs-serv25102

Modified Files:
	FileStorage.py 
Log Message:
Do not raise exception on redudant pack.

And whitespace normalization.


=== ZODB4/ZODB/FileStorage.py 1.105 => 1.106 ===
--- ZODB4/ZODB/FileStorage.py:1.105	Tue Nov 26 17:49:33 2002
+++ ZODB4/ZODB/FileStorage.py	Mon Dec  2 17:46:37 2002
@@ -1365,9 +1365,9 @@
 
     def _redundant_pack(self, file, pos):
         assert pos > 8, pos
-        file.seek(pos-8)
+        file.seek(pos - 8)
         p=u64(file.read(8))
-        file.seek(pos-p+8)
+        file.seek(pos - p + 8)
         return file.read(1) not in ' u'
 
     def _pack_index(self, file, index):
@@ -1394,11 +1394,9 @@
     def pack(self, t):
         """Copy data from the current database file to a packed file
 
-
         Non-current records from transactions with time-stamp strings less
         than packtss are ommitted. As are all undone records.
 
-
         Also, data back pointers that point before packtss are resolved and
         the associated data are copied, since the old records are not copied.
         """
@@ -1439,9 +1437,7 @@
             if packpos == 4:
                 return
             if self._redundant_pack(file, packpos):
-                raise FileStorageError, (
-                    'The database has already been packed to a later time\n'
-                    'or no changes have been made since the last pack')
+                return
 
             pindex = self._pack_index(file, index)