Patchwork D11542: dirstate-item: use `added` instead of `state` when moving dirstate

login
register
mail settings
Submitter phabricator
Date Oct. 1, 2021, 9:42 a.m.
Message ID <differential-rev-PHID-DREV-tpptblzmr64xmukimmwb-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49866/
State Superseded
Headers show

Comments

phabricator - Oct. 1, 2021, 9:42 a.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D11542

AFFECTED FILES
  mercurial/scmutil.py

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -1505,7 +1505,7 @@ 
     }
     # 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()