dirstate-item: use item's property instead of `state` in addremove
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 29 Sep 2021 15:39:33 +0200
changeset 48110 ba79d99ec1ae
parent 48109 d86875b75838
child 48111 e0d566f3ffce
dirstate-item: use item's property instead of `state` in addremove Differential Revision: https://phab.mercurial-scm.org/D11535
mercurial/scmutil.py
--- a/mercurial/scmutil.py	Wed Sep 29 15:26:30 2021 +0200
+++ b/mercurial/scmutil.py	Wed Sep 29 15:39:33 2021 +0200
@@ -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