Patchwork [3,of,4] verify: introduce an experimental --full flag

login
register
mail settings
Submitter Pierre-Yves David
Date April 16, 2019, 11:38 p.m.
Message ID <9bec7491e9b4cabdfa4d.1555457921@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/39678/
State Superseded
Headers show

Comments

Pierre-Yves David - April 16, 2019, 11:38 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1555456269 -7200
#      Wed Apr 17 01:11:09 2019 +0200
# Node ID 9bec7491e9b4cabdfa4d264e5213b1f416ec2607
# Parent  55bd98999c25b10e220477fd4cc446a7c9c1f8ca
# EXP-Topic verify
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 9bec7491e9b4
verify: introduce an experimental --full flag

The flag currently has no effect, see next changeset for details. We introduce
the flag as experimental to keep the freedom of changing our mind on the final
UI.

Note: this patch highlight a small but in `hg help`. An option section is
generated even if no option are visible.

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -63,6 +63,7 @@  from . import (
     tags as tagsmod,
     ui as uimod,
     util,
+    verify as verifymod,
     wireprotoserver,
 )
 from .utils import (
@@ -6147,8 +6148,10 @@  def update(ui, repo, node=None, **opts):
                 ui.warn("(%s)\n" % obsfatemsg)
         return ret
 
-@command('verify', [], helpcategory=command.CATEGORY_MAINTENANCE)
-def verify(ui, repo):
+@command('verify',
+         [('', 'full', False, 'perform more checks (EXPERIMENTAL)')],
+         helpcategory=command.CATEGORY_MAINTENANCE)
+def verify(ui, repo, **opts):
     """verify the integrity of the repository
 
     Verify the integrity of the current repository.
@@ -6164,7 +6167,10 @@  def verify(ui, repo):
 
     Returns 0 on success, 1 if errors are encountered.
     """
-    return hg.verify(repo)
+    level = None
+    if opts['full']:
+        level = verifymod.VERIFY_FULL
+    return hg.verify(repo, level)
 
 @command(
     'version', [] + formatteropts, helpcategory=command.CATEGORY_HELP,
diff --git a/mercurial/verify.py b/mercurial/verify.py
--- a/mercurial/verify.py
+++ b/mercurial/verify.py
@@ -23,6 +23,7 @@  from . import (
 )
 
 VERIFY_DEFAULT = 0
+VERIFY_FULL = 1
 
 def verify(repo, level=None):
     with repo.lock():
diff --git a/tests/test-completion.t b/tests/test-completion.t
--- a/tests/test-completion.t
+++ b/tests/test-completion.t
@@ -347,7 +347,7 @@  Show all commands + options
   tip: patch, git, style, template
   unbundle: update
   update: clean, check, merge, date, rev, tool
-  verify: 
+  verify: full
   version: template
 
   $ hg init a
diff --git a/tests/test-help.t b/tests/test-help.t
--- a/tests/test-help.t
+++ b/tests/test-help.t
@@ -615,6 +615,8 @@  Test command without options
   
       Returns 0 on success, 1 if errors are encountered.
   
+  options:
+  
   (some details hidden, use --verbose to show complete help)
 
   $ hg help diff