help: also hide options marked EXPERIMENTAL stable
authorSiddharth Agarwal <sid0@fb.com>
Mon, 27 Apr 2015 15:12:41 -0700
branchstable
changeset 24871 117b9a101f71
parent 24870 4ec40a4db64a
child 24872 3510ec97ffdc
help: also hide options marked EXPERIMENTAL Similar to DEPRECATED, add a way to indicate that options are EXPERIMENTAL.
mercurial/help.py
tests/test-help.t
--- a/mercurial/help.py	Tue Apr 28 10:19:46 2015 -0700
+++ b/mercurial/help.py	Mon Apr 27 15:12:41 2015 -0700
@@ -43,7 +43,9 @@
             shortopt, longopt, default, desc = option
             optlabel = _("VALUE") # default label
 
-        if not verbose and ("DEPRECATED" in desc or _("DEPRECATED") in desc):
+        if not verbose and ("DEPRECATED" in desc or _("DEPRECATED") in desc or
+                            "EXPERIMENTAL" in desc or
+                            _("EXPERIMENTAL") in desc):
             continue
 
         so = ''
--- a/tests/test-help.t	Tue Apr 28 10:19:46 2015 -0700
+++ b/tests/test-help.t	Mon Apr 27 15:12:41 2015 -0700
@@ -629,6 +629,7 @@
   >     'hg nohelp',
   >     norepo=True)
   > @command('debugoptDEP', [('', 'dopt', None, 'option is DEPRECATED')])
+  > @command('debugoptEXP', [('', 'eopt', None, 'option is EXPERIMENTAL')])
   > def nohelp(ui, *args, **kwargs):
   >     pass
   > 
@@ -788,6 +789,7 @@
    debugobsolete
                  create arbitrary obsolete marker
    debugoptDEP   (no help text available)
+   debugoptEXP   (no help text available)
    debugpathcomplete
                  complete part or all of a tracked path
    debugpushkey  access the pushkey key/value protocol
@@ -822,7 +824,7 @@
   (use "hg help -v helpext" to show built-in aliases and global options)
 
 
-test deprecated option is hidden in command help
+test deprecated and experimental options are hidden in command help
   $ hg help debugoptDEP
   hg debugoptDEP
   
@@ -832,9 +834,20 @@
   
   (some details hidden, use --verbose to show complete help)
 
-test deprecated option is shown with -v
+  $ hg help debugoptEXP
+  hg debugoptEXP
+  
+  (no help text available)
+  
+  options:
+  
+  (some details hidden, use --verbose to show complete help)
+
+test deprecated and experimental options is shown with -v
   $ hg help -v debugoptDEP | grep dopt
     --dopt option is DEPRECATED
+  $ hg help -v debugoptEXP | grep eopt
+    --eopt option is EXPERIMENTAL
 
 #if gettext
 test deprecated option is hidden with translation with untranslated description