[Neo-report] r2461 vincent - /trunk/neo/storage/database/btree.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Nov 17 14:05:16 CET 2010


Author: vincent
Date: Wed Nov 17 14:05:16 2010
New Revision: 2461

Log:
Delete whole object when its last revision is deleted.

Also, call prune() when deleting object, to reuse its btree instance.

Modified:
    trunk/neo/storage/database/btree.py

Modified: trunk/neo/storage/database/btree.py
==============================================================================
--- trunk/neo/storage/database/btree.py [iso-8859-1] (original)
+++ trunk/neo/storage/database/btree.py [iso-8859-1] Wed Nov 17 14:05:16 2010
@@ -422,13 +422,14 @@ class BTreeDatabaseManager(DatabaseManag
         except KeyError:
             pass
         else:
-            if serial is None:
-                del obj[oid]
-            else:
+            if serial is not None:
                 try:
                     del tserial[serial]
                 except KeyError:
                     pass
+            if serial is None or not tserial:
+                prune(obj[oid])
+                del obj[oid]
 
     def getTransaction(self, tid, all=False):
         tid = util.u64(tid)





More information about the Neo-report mailing list