summaryrefslogtreecommitdiff
path: root/bzr_commit_handler.py
diff options
context:
space:
mode:
authorIan Clatworthy <ian.clatworthy@canonical.com>2009-08-24 12:55:06 +1000
committerIan Clatworthy <ian.clatworthy@canonical.com>2009-08-24 12:55:06 +1000
commit0e5215cb9e7c820b13d7375fbabed73016315f5c (patch)
tree5d3bf5cdd807e3faa13bc8786484e9231fef39a1 /bzr_commit_handler.py
parent0a96bba6d05474435daf02ef0a3b4fceb3ef34d7 (diff)
downloadbzr-fastimport-0e5215cb9e7c820b13d7375fbabed73016315f5c.tar.gz
Handle copy of a file/symlink already modified in this commit
Diffstat (limited to 'bzr_commit_handler.py')
-rw-r--r--bzr_commit_handler.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/bzr_commit_handler.py b/bzr_commit_handler.py
index 74264fe..1a5ab5b 100644
--- a/bzr_commit_handler.py
+++ b/bzr_commit_handler.py
@@ -352,10 +352,11 @@ class GenericCommitHandler(processor.CommitHandler):
self.record_delete(path, ie)
def _copy_item(self, src_path, dest_path, inv):
- newly_added = self._new_file_ids.get(src_path)
- if newly_added:
- # We've only just added this path earlier in this commit.
- file_id = newly_added
+ newly_changed = self._new_file_ids.get(src_path) or \
+ self._modified_file_ids.get(src_path)
+ if newly_changed:
+ # We've only just added/changed this path earlier in this commit.
+ file_id = newly_changed
# note: delta entries look like (old, new, file-id, ie)
ie = self._delta_entries_by_fileid[file_id][3]
else:
@@ -367,7 +368,7 @@ class GenericCommitHandler(processor.CommitHandler):
ie = inv[file_id]
kind = ie.kind
if kind == 'file':
- if newly_added:
+ if newly_changed:
content = ''.join(self.lines_for_commit[file_id])
else:
content = self.rev_store.get_file_text(self.parents[0], file_id)