mercurial/debugcommands.py
branchstable
changeset 47817 855463b5fe49
parent 47815 b30a53ffbf9b
child 47875 0fb328bb2459
--- a/mercurial/debugcommands.py	Thu Aug 05 17:00:03 2021 +0200
+++ b/mercurial/debugcommands.py	Fri Aug 06 12:10:36 2021 +0200
@@ -1470,6 +1470,12 @@
             _(b'repair revisions listed in this report file'),
             _(b'FILE'),
         ),
+        (
+            b'',
+            b'paranoid',
+            False,
+            _(b'check that both detection methods do the same thing'),
+        ),
     ]
     + cmdutil.dryrunopts,
 )
@@ -1491,6 +1497,11 @@
     Note that this does *not* mean that this repairs future affected revisions,
     that needs a separate fix at the exchange level that hasn't been written yet
     (as of 5.9rc0).
+
+    There is a `--paranoid` flag to test that the fast implementation is correct
+    by checking it against the slow implementation. Since this matter is quite
+    urgent and testing every edge-case is probably quite costly, we use this
+    method to test on large repositories as a fuzzing method of sorts.
     """
     cmdutil.check_incompatible_arguments(
         opts, 'to_report', ['from_report', 'dry_run']
@@ -1498,6 +1509,7 @@
     dry_run = opts.get('dry_run')
     to_report = opts.get('to_report')
     from_report = opts.get('from_report')
+    paranoid = opts.get('paranoid')
     # TODO maybe add filelog pattern and revision pattern parameters to help
     # narrow down the search for users that know what they're looking for?
 
@@ -1506,7 +1518,12 @@
         raise error.Abort(_(msg))
 
     rewrite.repair_issue6528(
-        ui, repo, dry_run=dry_run, to_report=to_report, from_report=from_report
+        ui,
+        repo,
+        dry_run=dry_run,
+        to_report=to_report,
+        from_report=from_report,
+        paranoid=paranoid,
     )