/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 breezy/merge.py

  • Committer: Jelmer Vernooij
  • Date: 2020-07-05 12:50:01 UTC
  • mfrom: (7490.40.46 work)
  • mto: (7490.40.48 work)
  • mto: This revision was merged to the branch mainline in revision 7519.
  • Revision ID: jelmer@jelmer.uk-20200705125001-7s3vo0p55szbbws7
Merge lp:brz/3.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
780
780
 
781
781
    def _compute_transform(self):
782
782
        if self._lca_trees is None:
783
 
            entries = self._entries3()
 
783
            entries = list(self._entries3())
784
784
            resolver = self._three_way
785
785
        else:
786
 
            entries = self._entries_lca()
 
786
            entries = list(self._entries_lca())
787
787
            resolver = self._lca_multi_way
788
788
        # Prepare merge hooks
789
789
        factories = Merger.hooks['merge_file_content']
791
791
        hooks = [factory(self) for factory in factories] + [self]
792
792
        self.active_hooks = [hook for hook in hooks if hook is not None]
793
793
        with ui.ui_factory.nested_progress_bar() as child_pb:
794
 
            for num, (trans_id, file_id, changed, paths3, parents3, names3,
 
794
            for num, (file_id, changed, paths3, parents3, names3,
795
795
                      executable3) in enumerate(entries):
 
796
                trans_id = self.tt.trans_id_file_id(file_id)
796
797
                # Try merging each entry
797
798
                child_pb.update(gettext('Preparing file merge'),
798
799
                                num, len(entries))
833
834
        other and this.  names3 is a tuple of names for base, other and this.
834
835
        executable3 is a tuple of execute-bit values for base, other and this.
835
836
        """
836
 
        result = []
837
837
        iterator = self.other_tree.iter_changes(self.base_tree,
838
838
                                                specific_files=self.interesting_files,
839
839
                                                extra_trees=[self.this_tree])
861
861
            names3 = change.name + (this_name,)
862
862
            paths3 = change.path + (this_path, )
863
863
            executable3 = change.executable + (this_executable,)
864
 
            trans_id = self.tt.trans_id_file_id(file_id)
865
 
            result.append(
866
 
                (trans_id, change.file_id, change.changed_content, paths3,
 
864
            yield (
 
865
                (change.file_id, change.changed_content, paths3,
867
866
                 parents3, names3, executable3))
868
 
        return result
869
867
 
870
868
    def _entries_lca(self):
871
869
        """Gather data about files modified between multiple trees.
894
892
                self.interesting_files, lookup_trees)
895
893
        else:
896
894
            interesting_files = None
897
 
        result = []
898
895
        from .multiwalker import MultiWalker
899
896
        walker = MultiWalker(self.other_tree, self._lca_trees)
900
897
 
1038
1035
                    raise AssertionError('unhandled kind: %s' % other_ie.kind)
1039
1036
 
1040
1037
            # If we have gotten this far, that means something has changed
1041
 
            trans_id = self.tt.trans_id_file_id(file_id)
1042
 
            result.append((trans_id, file_id, content_changed,
 
1038
            yield (file_id, content_changed,
1043
1039
                           ((base_path, lca_paths),
1044
1040
                            other_path, this_path),
1045
1041
                           ((base_ie.parent_id, lca_parent_ids),
1048
1044
                            other_ie.name, this_ie.name),
1049
1045
                           ((base_ie.executable, lca_executable),
1050
1046
                            other_ie.executable, this_ie.executable)
1051
 
                           ))
1052
 
        return result
 
1047
                           )
1053
1048
 
1054
1049
    def write_modified(self, results):
1055
1050
        if not self.working_tree.supports_merge_modified():