From 8b1853adb80ab3bd4e573520e01a8e301e613a03 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 31 May 2011 14:15:26 +0100 Subject: [PATCH] Fix deleteall handler. --- bzr_commit_handler.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/bzr_commit_handler.py b/bzr_commit_handler.py index 15b050a..a3c0896 100644 --- a/bzr_commit_handler.py +++ b/bzr_commit_handler.py @@ -509,8 +509,11 @@ class GenericCommitHandler(processor.CommitHandler): self.data_for_commit[file_id] = ''.join(lines) def _delete_all_items(self, inv): - for name, root_item in inv.root.children.iteritems(): - inv.remove_recursive_id(root_item.file_id) + if len(inv) == 0: + return + for path, ie in inv.iter_entries_by_dir(): + if path != "": + self.record_delete(path, ie) def _warn_unless_in_merges(self, fileid, path): if len(self.parents) <= 1: @@ -905,10 +908,4 @@ class InventoryDeltaCommitHandler(GenericCommitHandler): def deleteall_handler(self, filecmd): self.debug("deleting all files (and also all directories)") - # I'm not 100% sure this will work in the delta case. - # But clearing out the basis inventory so that everything - # is added sounds ok in theory ... - # We grab a copy as the basis is likely to be cached and - # we don't want to destroy the cached version - self.basis_inventory = copy_inventory(self.basis_inventory) self._delete_all_items(self.basis_inventory) -- 2.11.4.GIT