diff options
author | Ian Clatworthy <ian.clatworthy@internode.on.net> | 2009-03-24 14:27:33 +1000 |
---|---|---|
committer | Ian Clatworthy <ian.clatworthy@internode.on.net> | 2009-03-24 14:27:33 +1000 |
commit | b464024dfbb8e1cea007c2fa395886c4c7db4d53 (patch) | |
tree | 66e925d52f7861d65c6e980cffb41e758dd05489 /bzr_commit_handler.py | |
parent | 915cf0a004b09d567acdda81b39ce21123412826 (diff) | |
download | bzr-fastimport-b464024dfbb8e1cea007c2fa395886c4c7db4d53.tar.gz |
handle adding a file to a dir deleted in the same commit
Diffstat (limited to 'bzr_commit_handler.py')
-rw-r--r-- | bzr_commit_handler.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/bzr_commit_handler.py b/bzr_commit_handler.py index 5608daa..b6e1fe1 100644 --- a/bzr_commit_handler.py +++ b/bzr_commit_handler.py @@ -223,7 +223,12 @@ class GenericCommitHandler(processor.CommitHandler): self.record_delete(path, old_ie) self.record_changed(path, ie, parent_id) else: - self.record_new(path, ie) + try: + self.record_new(path, ie) + except: + print "failed to add path '%s' with entry '%s'" % (path, ie) + print "directory entries are:\n%r\n" % (self.directory_entries,) + raise def _ensure_directory(self, path, inv): """Ensure that the containing directory exists for 'path'""" @@ -429,6 +434,11 @@ class InventoryCommitHandler(GenericCommitHandler): isinstance(inv[fileid], inventory.InventoryDirectory)): for child_path in inv[fileid].children.keys(): self._delete_item(osutils.pathjoin(path, child_path), inv) + # We need to clean this out of the directory entries as well + try: + del self.directory_entries[path] + except KeyError: + pass try: if self.inventory.id2path(fileid) == path: del inv[fileid] |