summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2011-05-31 14:15:26 +0100
committerJelmer Vernooij <jelmer@samba.org>2011-05-31 14:15:26 +0100
commit8b1853adb80ab3bd4e573520e01a8e301e613a03 (patch)
treecdbeec79771b90aec003094f9c1776757571a6cf
parent8d3d73ff6f860f394495d2d59ed6fe02db0070a8 (diff)
downloadbzr-fastimport-8b1853adb80ab3bd4e573520e01a8e301e613a03.tar.gz
Fix deleteall handler.
-rw-r--r--bzr_commit_handler.py13
1 files 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)