mercurial/debugcommands.py
changeset 49826 c84844cd523a
parent 49824 fdd227585d5a
child 49896 88b81dc2d82b
--- a/mercurial/debugcommands.py	Mon May 02 17:47:38 2022 +0200
+++ b/mercurial/debugcommands.py	Mon May 02 11:27:20 2022 +0200
@@ -87,6 +87,7 @@
     upgrade,
     url as urlmod,
     util,
+    verify,
     vfs as vfsmod,
     wireprotoframing,
     wireprotoserver,
@@ -554,15 +555,9 @@
 @command(b'debugcheckstate', [], b'')
 def debugcheckstate(ui, repo):
     """validate the correctness of the current dirstate"""
-    parent1, parent2 = repo.dirstate.parents()
-    m1 = repo[parent1].manifest()
-    m2 = repo[parent2].manifest()
-    errors = 0
-    for err in repo.dirstate.verify(m1, m2):
-        ui.warn(err)
-        errors += 1
+    errors = verify.verifier(repo)._verify_dirstate()
     if errors:
-        errstr = _(b".hg/dirstate inconsistent with current parent's manifest")
+        errstr = _(b"dirstate inconsistent with current parent's manifest")
         raise error.Abort(errstr)