comparison mercurial/copies.py @ 45976:cf04af3a5ef1

copies: fast path no-op merge If the two sides of the merge are the same (they come an unaltered common ancestors) we don't need any merging. Differential Revision: https://phab.mercurial-scm.org/D9415
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 20 Nov 2020 10:49:32 +0100
parents 8b99c473aae2
children 7d3c51c728c9
comparison
equal deleted inserted replaced
45975:2367937982ba 45976:cf04af3a5ef1
364 newcopies = copies.copy() 364 newcopies = copies.copy()
365 newcopies[f] = (c, None) 365 newcopies[f] = (c, None)
366 othercopies = all_copies.get(c) 366 othercopies = all_copies.get(c)
367 if othercopies is None: 367 if othercopies is None:
368 all_copies[c] = newcopies 368 all_copies[c] = newcopies
369 elif newcopies is othercopies:
370 # nothing to merge:
371 pass
369 else: 372 else:
370 # we are the second parent to work on c, we need to merge our 373 # we are the second parent to work on c, we need to merge our
371 # work with the other. 374 # work with the other.
372 # 375 #
373 # In case of conflict, parent 1 take precedence over parent 2. 376 # In case of conflict, parent 1 take precedence over parent 2.