mercurial/copies.py
changeset 46162 6b9d65298484
parent 46161 3a0c41336961
child 46183 ee63c1173c1b
equal deleted inserted replaced
46161:3a0c41336961 46162:6b9d65298484
   474             if pick == PICK_MAJOR:
   474             if pick == PICK_MAJOR:
   475                 minor[dest] = value
   475                 minor[dest] = value
   476     return minor
   476     return minor
   477 
   477 
   478 
   478 
   479 def _compare_values(changes, isancestor, dest, other, value):
   479 def _compare_values(changes, isancestor, dest, minor, major):
   480     """compare two value within a _merge_copies_dict loop iteration"""
   480     """compare two value within a _merge_copies_dict loop iteration"""
   481     new_tt = value[0]
   481     major_tt = major[0]
   482     other_tt = other[0]
   482     minor_tt = minor[0]
   483 
   483 
   484     if value[1] == other[1]:
   484     if major[1] == minor[1]:
   485         return PICK_EITHER
   485         return PICK_EITHER
   486     # content from "major" wins, unless it is older
   486     # content from "major" wins, unless it is older
   487     # than the branch point or there is a merge
   487     # than the branch point or there is a merge
   488     if new_tt == other_tt:
   488     if major_tt == minor_tt:
   489         return PICK_MAJOR
   489         return PICK_MAJOR
   490     elif changes is not None and value[1] is None and dest in changes.salvaged:
   490     elif changes is not None and major[1] is None and dest in changes.salvaged:
   491         return PICK_MINOR
   491         return PICK_MINOR
   492     elif changes is not None and other[1] is None and dest in changes.salvaged:
   492     elif changes is not None and minor[1] is None and dest in changes.salvaged:
   493         return PICK_MAJOR
   493         return PICK_MAJOR
   494     elif changes is not None and dest in changes.merged:
   494     elif changes is not None and dest in changes.merged:
   495         return PICK_MAJOR
   495         return PICK_MAJOR
   496     elif not isancestor(new_tt, other_tt):
   496     elif not isancestor(major_tt, minor_tt):
   497         if value[1] is not None:
   497         if major[1] is not None:
   498             return PICK_MAJOR
   498             return PICK_MAJOR
   499         elif isancestor(other_tt, new_tt):
   499         elif isancestor(minor_tt, major_tt):
   500             return PICK_MAJOR
   500             return PICK_MAJOR
   501     return PICK_MINOR
   501     return PICK_MINOR
   502 
   502 
   503 
   503 
   504 def _revinfo_getter_extra(repo):
   504 def _revinfo_getter_extra(repo):