changeset 49821:8f200511cdc7

dirstate: stop using `entry.state()` for logic in `verify` Use the new API instead of the deprecated one. The next changeset will remove the use of `state` in this method altogether (currently still in the messages)
author Raphaël Gomès <rgomes@octobus.net>
date Mon, 02 May 2022 11:42:23 +0200
parents 3eac92509484
children 1d8721be2428
files mercurial/dirstate.py
diffstat 1 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dirstate.py	Mon May 02 11:40:33 2022 +0200
+++ b/mercurial/dirstate.py	Mon May 02 11:42:23 2022 +0200
@@ -1548,13 +1548,14 @@
         missing_from_ds = b"%s in manifest1, but listed as state %s\n"
         for f, entry in self.items():
             state = entry.state
-            if state in b"nr" and f not in m1:
-                yield (missing_from_p1, f, state)
-            if state in b"a" and f in m1:
+            if entry.p1_tracked:
+                if entry.modified and f not in m1 and f not in m2:
+                    yield (missing_from_ps, f, state)
+                elif f not in m1:
+                    yield (missing_from_p1, f, state)
+            if entry.added and f in m1:
                 yield (unexpected_in_p1, f, state)
-            if state in b"m" and f not in m1 and f not in m2:
-                yield (missing_from_ps, f, state)
         for f in m1:
-            state = self.get_entry(f).state
-            if state not in b"nrm":
-                yield (missing_from_ds, f, state)
+            entry = self.get_entry(f)
+            if not entry.p1_tracked:
+                yield (missing_from_ds, f, entry.state)