admin-verify: expect a number of errors to be returned stable
authorRaphaël Gomès <rgomes@octobus.net>
Mon, 06 May 2024 16:29:00 +0200
branchstable
changeset 51491 a93e60ebea09
parent 51490 2a27b921cd91
child 51492 9dbbaecfc950
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.
mercurial/admin_commands.py
tests/test-verify.t
--- 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