changeset 51615:a93e60ebea09 stable

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.
author Raphaël Gomès <rgomes@octobus.net>
date Mon, 06 May 2024 16:29:00 +0200
parents 2a27b921cd91
children 9dbbaecfc950
files mercurial/admin_commands.py tests/test-verify.t
diffstat 2 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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