/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

Fix merging of copy operations.

Merged from https://code.launchpad.net/~jelmer/brz/merge-copy/+merge/389688

Show diffs side-by-side

added added

removed removed

Lines of Context:
794
794
        self.active_hooks = [hook for hook in hooks if hook is not None]
795
795
        with ui.ui_factory.nested_progress_bar() as child_pb:
796
796
            for num, (file_id, changed, paths3, parents3, names3,
797
 
                      executable3) in enumerate(entries):
 
797
                      executable3, copied) in enumerate(entries):
 
798
                if copied:
 
799
                    # Treat copies as simple adds for now
 
800
                    paths3 = (None, paths3[1], None)
 
801
                    parents3 = (None, parents3[1], None)
 
802
                    names3 = (None, names3[1], None)
 
803
                    executable3 = (None, executable3[1], None)
 
804
                    changed = True
 
805
                    copied = False
798
806
                trans_id = self.tt.trans_id_file_id(file_id)
799
807
                # Try merging each entry
800
808
                child_pb.update(gettext('Preparing file merge'),
865
873
            executable3 = change.executable + (this_executable,)
866
874
            yield (
867
875
                (change.file_id, change.changed_content, paths3,
868
 
                 parents3, names3, executable3))
 
876
                 parents3, names3, executable3, change.copied))
869
877
 
870
878
    def _entries_lca(self):
871
879
        """Gather data about files modified between multiple trees.
875
883
 
876
884
        For the multi-valued entries, the format will be (BASE, [lca1, lca2])
877
885
 
878
 
        :return: [(file_id, changed, paths, parents, names, executable)], where:
 
886
        :return: [(file_id, changed, paths, parents, names, executable, copied)], where:
879
887
 
880
888
            * file_id: Simple file_id of the entry
881
889
            * changed: Boolean, True if the kind or contents changed else False
1045
1053
                           ((base_ie.name, lca_names),
1046
1054
                            other_ie.name, this_ie.name),
1047
1055
                           ((base_ie.executable, lca_executable),
1048
 
                            other_ie.executable, this_ie.executable)
 
1056
                            other_ie.executable, this_ie.executable),
 
1057
                           # Copy detection is not yet supported, so nothing is
 
1058
                           # a copy:
 
1059
                           False
1049
1060
                           )
1050
1061
 
1051
1062
    def write_modified(self, results):