~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-04-15 08:12:33 UTC
  • mfrom: (5783.2.5 2.4-merge-faster-759091)
  • Revision ID: pqm@pqm.ubuntu.com-20110415081233-mqfd5six3sqmi1sn
(jameinel) Make 'bzr merge' much faster by not walking unchanged entries.
 (John A Meinel)

Show diffs side-by-side

added added

removed removed

Lines of Context:
911
911
        """
912
912
        result = []
913
913
        iterator = self.other_tree.iter_changes(self.base_tree,
914
 
                include_unchanged=True, specific_files=self.interesting_files,
 
914
                specific_files=self.interesting_files,
915
915
                extra_trees=[self.this_tree])
916
916
        this_entries = dict((e.file_id, e) for p, e in
917
917
                            self.this_tree.iter_entries_by_dir(
1126
1126
        # 'other_tree.inventory.root' is not present in this tree. We are
1127
1127
        # calling adjust_path for children which *want* to be present with a
1128
1128
        # correct place to go.
1129
 
        for thing, child in self.other_tree.inventory.root.children.iteritems():
 
1129
        for _, child in self.other_tree.inventory.root.children.iteritems():
1130
1130
            trans_id = self.tt.trans_id_file_id(child.file_id)
1131
1131
            if not other_root_is_present:
1132
1132
                if self.tt.final_kind(trans_id) is not None:
1134
1134
                    # to go already.
1135
1135
                    continue
1136
1136
            # Move the item into the root
1137
 
            self.tt.adjust_path(self.tt.final_name(trans_id),
1138
 
                                self.tt.root, trans_id)
 
1137
            try:
 
1138
                final_name = self.tt.final_name(trans_id)
 
1139
            except errors.NoFinalPath:
 
1140
                # This file is not present anymore, ignore it.
 
1141
                continue
 
1142
            self.tt.adjust_path(final_name, self.tt.root, trans_id)
1139
1143
        if other_root_is_present:
1140
1144
            self.tt.cancel_creation(other_root)
1141
1145
            self.tt.cancel_versioning(other_root)