~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge.py

  • Committer: Vincent Ladeuil
  • Date: 2011-05-26 20:30:53 UTC
  • mfrom: (5920 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5924.
  • Revision ID: v.ladeuil+lp@free.fr-20110526203053-hbjn6yuzwg03wnuv
MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
92
92
        """Attempt to merge the contents of a single file.
93
93
        
94
94
        :param merge_params: A bzrlib.merge.MergeHookParams
95
 
        :return : A tuple of (status, chunks), where status is one of
 
95
        :return: A tuple of (status, chunks), where status is one of
96
96
            'not_applicable', 'success', 'conflicted', or 'delete'.  If status
97
97
            is 'success' or 'conflicted', then chunks should be an iterable of
98
98
            strings for the new file contents.
888
888
                self.tt.iter_changes(), self.change_reporter)
889
889
        self.cook_conflicts(fs_conflicts)
890
890
        for conflict in self.cooked_conflicts:
891
 
            trace.warning(conflict)
 
891
            trace.warning(unicode(conflict))
892
892
 
893
893
    def _entries3(self):
894
894
        """Gather data about files modified between three trees.
933
933
        it then compares with THIS and BASE.
934
934
 
935
935
        For the multi-valued entries, the format will be (BASE, [lca1, lca2])
936
 
        :return: [(file_id, changed, parents, names, executable)]
937
 
            file_id     Simple file_id of the entry
938
 
            changed     Boolean, True if the kind or contents changed
939
 
                        else False
940
 
            parents     ((base, [parent_id, in, lcas]), parent_id_other,
941
 
                         parent_id_this)
942
 
            names       ((base, [name, in, lcas]), name_in_other, name_in_this)
943
 
            executable  ((base, [exec, in, lcas]), exec_in_other, exec_in_this)
 
936
 
 
937
        :return: [(file_id, changed, parents, names, executable)], where:
 
938
 
 
939
            * file_id: Simple file_id of the entry
 
940
            * changed: Boolean, True if the kind or contents changed else False
 
941
            * parents: ((base, [parent_id, in, lcas]), parent_id_other,
 
942
                        parent_id_this)
 
943
            * names:   ((base, [name, in, lcas]), name_in_other, name_in_this)
 
944
            * executable: ((base, [exec, in, lcas]), exec_in_other,
 
945
                        exec_in_this)
944
946
        """
945
947
        if self.interesting_files is not None:
946
948
            lookup_trees = [self.this_tree, self.base_tree]
2401
2403
class _PlanLCAMerge(_PlanMergeBase):
2402
2404
    """
2403
2405
    This merge algorithm differs from _PlanMerge in that:
 
2406
 
2404
2407
    1. comparisons are done against LCAs only
2405
2408
    2. cases where a contested line is new versus one LCA but old versus
2406
2409
       another are marked as conflicts, by emitting the line as conflicted-a
2447
2450
 
2448
2451
        If a line is killed and new, this indicates that the two merge
2449
2452
        revisions contain differing conflict resolutions.
 
2453
 
2450
2454
        :param revision_id: The id of the revision in which the lines are
2451
2455
            unique
2452
2456
        :param unique_line_numbers: The line numbers of unique lines.
2453
 
        :return a tuple of (new_this, killed_other):
 
2457
        :return: a tuple of (new_this, killed_other)
2454
2458
        """
2455
2459
        new = set()
2456
2460
        killed = set()