92
92
"""Attempt to merge the contents of a single file.
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.
935
935
For the multi-valued entries, the format will be (BASE, [lca1, lca2])
937
:return: [(file_id, changed, parents, names, executable)], where:
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,
943
* names: ((base, [name, in, lcas]), name_in_other, name_in_this)
944
* executable: ((base, [exec, in, lcas]), exec_in_other,
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
940
parents ((base, [parent_id, in, lcas]), parent_id_other,
942
names ((base, [name, in, lcas]), name_in_other, name_in_this)
943
executable ((base, [exec, in, lcas]), exec_in_other, exec_in_this)
947
945
if self.interesting_files is not None:
948
946
lookup_trees = [self.this_tree, self.base_tree]
2403
2401
class _PlanLCAMerge(_PlanMergeBase):
2405
2403
This merge algorithm differs from _PlanMerge in that:
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
2451
2448
If a line is killed and new, this indicates that the two merge
2452
2449
revisions contain differing conflict resolutions.
2454
2450
:param revision_id: The id of the revision in which the lines are
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):