706
706
# of this entry hasn't changed, so skip it.
709
is_content_changed = False
711
is_content_changed = True
709
713
if file_id in base_inventory:
710
714
base_ie = self.base_tree.inventory[file_id]
711
715
base_parent_id = base_ie.parent_id
845
def _lca_multi_way(bases, other, this):
846
"""Consider LCAs when determining whether a change has occurred.
848
If LCAS are all identical, this is the same as a _three_way comparison.
850
:param bases: value in (BASE, [LCAS])
851
:param other: value in OTHER
852
:param this: value in THIS
853
:return: 'this', 'other', or 'conflict' depending on whether an entry
857
# Either Ambiguously clean, or nothing was actually changed. We
860
base_val, lca_vals = bases
861
# Remove 'base_val' from the lca_vals, because it is not interesting
862
filtered_lca_vals = [lca_val for lca_val in lca_vals
863
if lca_val != base_val]
864
if len(filtered_lca_vals) == 0:
865
return Merge3Merger._three_way(base_val, other, this)
867
first_lca_val = filtered_lca_vals[0]
868
for lca_val in filtered_lca_vals[1:]:
869
if lca_val != first_lca_val:
871
else: # all lcas are equal, use 3-way logic
872
return Merge3Merger._three_way(first_lca_val, other, this)
873
if other in filtered_lca_vals:
874
if this in filtered_lca_vals:
875
# Each side picked a different lca, conflict
878
# This has a value which supersedes both lca values, and other
879
# only has an lca value
881
elif this in filtered_lca_vals:
882
# OTHER has a value which supersedes both lca values, and this only
886
# At this point, the lcas disagree, and the tips disagree
840
890
def scalar_three_way(this_tree, base_tree, other_tree, file_id, key):
841
891
"""Do a three-way test on a scalar.
842
892
Return "this", "other" or "conflict", depending whether a value wins.