# HG changeset patch # User Pierre-Yves David # Date 2021-09-29 16:37:54 # Node ID 207df24a31f6b698a6966ef2b05787caed8b3598 # Parent e8d6261513b99ea73c12ef3da8900d79d17bf430 dirstate-item: use `added` instead of `state` when moving dirstate Differential Revision: https://phab.mercurial-scm.org/D11542 diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py --- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -1505,7 +1505,7 @@ def movedirstate(repo, newctx, match=Non } # Adjust the dirstate copies for dst, src in pycompat.iteritems(copies): - if src not in newctx or dst in newctx or ds[dst] != b'a': + if src not in newctx or dst in newctx or not ds.get_entry(dst).added: src = None ds.copy(src, dst) repo._quick_access_changeid_invalidate()