copies: fast path no-op merge
authorPierre-Yves David <pierre-yves.david@octobus.net>
Fri, 20 Nov 2020 10:49:32 +0100
changeset 45976 cf04af3a5ef1
parent 45975 2367937982ba
child 45977 7d3c51c728c9
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
mercurial/copies.py
--- 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.