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
--- 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