changeset 42255:00e065fb1469

copies: remove redundant filtering of ping-pong renames in _chain() We already handle the ping-pong rename case in the filtering step, so there's very little point in doing it in the chaining loop (ping-pong renames are very rare, so I'm not worried about the cost of adding it and then removing it again). Differential Revision: https://phab.mercurial-scm.org/D6344
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 18 Apr 2019 00:34:45 -0700
parents d811f17090a3
children 9421d7e12888
files mercurial/copies.py
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/copies.py	Fri May 03 15:43:44 2019 -0400
+++ b/mercurial/copies.py	Thu Apr 18 00:34:45 2019 -0700
@@ -130,10 +130,8 @@
     t = a.copy()
     for k, v in b.iteritems():
         if v in t:
-            # found a chain, i.e. cases 3 & 4.
-            if t[v] != k:
-                # file wasn't renamed back to itself (i.e. case 4, not 3)
-                t[k] = t[v]
+            # Found a chain, i.e. cases 3 & 4. We'll remove case 3 later.
+            t[k] = t[v]
         else:
             # Renamed only in 'b', i.e. cases 5 & 6. We'll remove case 5 later.
             t[k] = v