/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to processors/generic_processor.py

  • Committer: Ian Clatworthy
  • Date: 2009-02-20 03:24:15 UTC
  • mto: (0.64.124 trunk)
  • mto: This revision was merged to the branch mainline in revision 6631.
  • Revision ID: ian.clatworthy@canonical.com-20090220032415-xyrq8o11ofihfuh8
file/symlink <-> directory rename tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
668
668
        old_path = filecmd.old_path
669
669
        new_path = filecmd.new_path
670
670
        self.debug("renaming %s to %s", old_path, new_path)
671
 
        file_id = self.bzr_file_id(old_path)
672
 
        basename, new_parent_ie = self._ensure_directory(new_path)
 
671
        old_file_id = self.inventory.path2id(old_path)
 
672
        old_ie = self.inventory[old_file_id]
 
673
        new_file_id = self.inventory.path2id(new_path)
 
674
        if new_file_id is not None:
 
675
            self.inventory.remove_recursive_id(new_file_id)
 
676
 
 
677
        # Why are these lines needed?
 
678
        old_lines = self.loader._get_lines(old_file_id, old_ie.revision)
 
679
        self.lines_for_commit[old_file_id] = old_lines
 
680
        self.inventory[old_file_id].revision = self.revision_id
 
681
 
 
682
        new_basename, new_parent_ie = self._ensure_directory(new_path)
673
683
        new_parent_id = new_parent_ie.file_id
674
 
        existing_id = self.inventory.path2id(new_path)
675
 
        if existing_id is not None:
676
 
            self.inventory.remove_recursive_id(existing_id)
677
 
        ie = self.inventory[file_id]
678
 
        lines = self.loader._get_lines(file_id, ie.revision)
679
 
        self.lines_for_commit[file_id] = lines
680
 
        self.inventory.rename(file_id, new_parent_id, basename)
 
684
        self.inventory.rename(old_file_id, new_parent_id, new_basename)
681
685
        self.cache_mgr.rename_path(old_path, new_path)
682
 
        self.inventory[file_id].revision = self.revision_id
683
686
 
684
687
    def deleteall_handler(self, filecmd):
685
688
        self.debug("deleting all files (and also all directories)")