~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge.py

  • Committer: Jelmer Vernooij
  • Date: 2011-05-16 13:39:39 UTC
  • mto: (5923.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 5925.
  • Revision ID: jelmer@samba.org-20110516133939-8u1pc9utas3uw1lt
Require a unicode prompt to be passed into all methods that prompt.

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.
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
 
 
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)
 
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)
946
944
        """
947
945
        if self.interesting_files is not None:
948
946
            lookup_trees = [self.this_tree, self.base_tree]
2403
2401
class _PlanLCAMerge(_PlanMergeBase):
2404
2402
    """
2405
2403
    This merge algorithm differs from _PlanMerge in that:
2406
 
 
2407
2404
    1. comparisons are done against LCAs only
2408
2405
    2. cases where a contested line is new versus one LCA but old versus
2409
2406
       another are marked as conflicts, by emitting the line as conflicted-a
2450
2447
 
2451
2448
        If a line is killed and new, this indicates that the two merge
2452
2449
        revisions contain differing conflict resolutions.
2453
 
 
2454
2450
        :param revision_id: The id of the revision in which the lines are
2455
2451
            unique
2456
2452
        :param unique_line_numbers: The line numbers of unique lines.
2457
 
        :return: a tuple of (new_this, killed_other)
 
2453
        :return a tuple of (new_this, killed_other):
2458
2454
        """
2459
2455
        new = set()
2460
2456
        killed = set()