mercurial/copies.py
changeset 44091 3df0bd706c40
parent 44090 2f0a44c69e07
child 44092 833210fbd900
--- a/mercurial/copies.py	Mon Jan 06 15:24:36 2020 -0800
+++ b/mercurial/copies.py	Fri Dec 27 15:14:19 2019 -0800
@@ -875,11 +875,12 @@
         # of the function is much faster (and is required for carrying copy
         # metadata across the rebase anyway).
         exclude = pathcopies(base, skip)
-    for dst, src in pycompat.iteritems(pathcopies(base, ctx)):
+    new_copies = pathcopies(base, ctx)
+    _filter(wctx.p1(), wctx, new_copies)
+    for dst, src in pycompat.iteritems(new_copies):
         if dst in exclude:
             continue
-        if dst in wctx:
-            wctx[dst].markcopied(src)
+        wctx[dst].markcopied(src)
 
 
 def computechangesetfilesadded(ctx):