Commit ec33162f authored by Vincent Pelletier's avatar Vincent Pelletier

Delete whole object when its last revision is deleted.

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

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2461 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent bd3b9cfd
...@@ -422,13 +422,14 @@ class BTreeDatabaseManager(DatabaseManager): ...@@ -422,13 +422,14 @@ class BTreeDatabaseManager(DatabaseManager):
except KeyError: except KeyError:
pass pass
else: else:
if serial is None: if serial is not None:
del obj[oid]
else:
try: try:
del tserial[serial] del tserial[serial]
except KeyError: except KeyError:
pass pass
if serial is None or not tserial:
prune(obj[oid])
del obj[oid]
def getTransaction(self, tid, all=False): def getTransaction(self, tid, all=False):
tid = util.u64(tid) tid = util.u64(tid)
......
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