admin-verify: expect a number of errors to be returned
It's the responsibility of the check to handle errors, we only care about
the total count to sum up the check's work.
We use `admin::verify -c dirstate` to test this path at least somewhat.
--- a/mercurial/admin_commands.py Mon May 06 16:16:15 2024 +0200
+++ b/mercurial/admin_commands.py Mon May 06 16:29:00 2024 +0200
@@ -47,4 +47,4 @@
ui.status(_(b"running %s\n") % name)
errors = func()
if errors:
- ui.warn(_(b"found %d errors\n") % len(errors))
+ ui.warn(_(b"found %d errors\n") % errors)
--- a/tests/test-verify.t Mon May 06 16:16:15 2024 +0200
+++ b/tests/test-verify.t Mon May 06 16:29:00 2024 +0200
@@ -132,6 +132,16 @@
dirstate inconsistent with current parent's manifest
1 dirstate errors
[1]
+
+We can check the dirstate in isolation
+ $ hg admin::verify -c dirstate
+ running 1 checks
+ running working-copy.dirstate
+ checking dirstate
+ warning: ignoring unknown working parent c5ddb05ab828!
+ file marked as tracked in p1 (000000000000) but not in manifest1
+ found 1 errors
+
$ cp -R .hg/store-full/. .hg/store
Entire changelog and filelog missing