changeset 45991: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 2367937982ba
children 7d3c51c728c9
files mercurial/copies.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/copies.py	Mon Oct 05 01:49:04 2020 +0200
+++ b/mercurial/copies.py	Fri Nov 20 10:49:32 2020 +0100
@@ -366,6 +366,9 @@
             othercopies = all_copies.get(c)
             if othercopies is None:
                 all_copies[c] = newcopies
+            elif newcopies is othercopies:
+                # nothing to merge:
+                pass
             else:
                 # we are the second parent to work on c, we need to merge our
                 # work with the other.