Patchwork D11535: dirstate-item: use item's property instead of `state` in addremove

login
register
mail settings
Submitter phabricator
Date Oct. 1, 2021, 9:42 a.m.
Message ID <differential-rev-PHID-DREV-2m3qpfwb7mspzktmnliz-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49859/
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/D11535

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
@@ -1327,17 +1327,17 @@ 
         full=False,
     )
     for abs, st in pycompat.iteritems(walkresults):
-        dstate = dirstate[abs]
-        if dstate == b'?' and audit_path.check(abs):
+        entry = dirstate.get_entry(abs)
+        if (not entry.any_tracked) and audit_path.check(abs):
             unknown.append(abs)
-        elif dstate != b'r' and not st:
+        elif (not entry.removed) and not st:
             deleted.append(abs)
-        elif dstate == b'r' and st:
+        elif entry.removed and st:
             forgotten.append(abs)
         # for finding renames
-        elif dstate == b'r' and not st:
+        elif entry.removed and not st:
             removed.append(abs)
-        elif dstate == b'a':
+        elif entry.added:
             added.append(abs)
 
     return added, unknown, deleted, removed, forgotten