diff -r 2f0a44c69e07 -r 3df0bd706c40 mercurial/copies.py --- 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):