822
822
self.warning("ignoring delete of %s as not in parent inventories", path)
824
824
def copy_handler(self, filecmd):
825
raise NotImplementedError(self.copy_handler)
825
src_path = filecmd.src_path
826
dest_path = filecmd.dest_path
827
self.debug("copying %s to %s", src_path, dest_path)
829
self.warning("ignoring copy of %s to %s - no parent revisions",
832
file_id = self.inventory.path2id(src_path)
834
self.warning("ignoring copy of %s to %s - source does not exist",
837
ie = self.inventory[file_id]
840
content = self._get_content_from_repo(self.parents[0], file_id)
841
self._modify_inventory(dest_path, kind, ie.executable, content)
842
elif kind == 'symlink':
843
self._modify_inventory(dest_path, kind, False, ie.symlink_target)
845
self.warning("ignoring copy of %s %s - feature not yet supported",
848
def _get_content_from_repo(self, revision_id, file_id):
849
"""Get the content of a file for a revision-id."""
850
revtree = self.repo.revision_tree(revision_id)
851
return revtree.get_file_text(file_id)
827
853
def rename_handler(self, filecmd):
828
854
old_path = filecmd.old_path