/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

Split out git and bzr-specific transforms.

Merged from https://code.launchpad.net/~jelmer/brz/transform-file-id/+merge/386859

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
    revision as _mod_revision,
32
32
    textfile,
33
33
    trace,
34
 
    transform,
35
34
    tree as _mod_tree,
36
35
    tsort,
37
36
    ui,
48
47
    errors,
49
48
    hooks,
50
49
    registry,
 
50
    transform,
51
51
    )
52
52
from .sixish import (
53
53
    viewitems,
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']
794
794
            for num, (file_id, changed, paths3, parents3, names3,
795
795
                      executable3) in enumerate(entries):
796
796
                trans_id = self.tt.trans_id_file_id(file_id)
797
 
 
798
797
                # Try merging each entry
799
798
                child_pb.update(gettext('Preparing file merge'),
800
799
                                num, len(entries))
835
834
        other and this.  names3 is a tuple of names for base, other and this.
836
835
        executable3 is a tuple of execute-bit values for base, other and this.
837
836
        """
838
 
        result = []
839
837
        iterator = self.other_tree.iter_changes(self.base_tree,
840
838
                                                specific_files=self.interesting_files,
841
839
                                                extra_trees=[self.this_tree])
863
861
            names3 = change.name + (this_name,)
864
862
            paths3 = change.path + (this_path, )
865
863
            executable3 = change.executable + (this_executable,)
866
 
            result.append(
 
864
            yield (
867
865
                (change.file_id, change.changed_content, paths3,
868
866
                 parents3, names3, executable3))
869
 
        return result
870
867
 
871
868
    def _entries_lca(self):
872
869
        """Gather data about files modified between multiple trees.
895
892
                self.interesting_files, lookup_trees)
896
893
        else:
897
894
            interesting_files = None
898
 
        result = []
899
895
        from .multiwalker import MultiWalker
900
896
        walker = MultiWalker(self.other_tree, self._lca_trees)
901
897
 
1039
1035
                    raise AssertionError('unhandled kind: %s' % other_ie.kind)
1040
1036
 
1041
1037
            # If we have gotten this far, that means something has changed
1042
 
            result.append((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():