# HG changeset patch # User Siddharth Agarwal # Date 1430172761 25200 # Node ID 117b9a101f7181b12b510ca3c46406c0f4bc9d29 # Parent 4ec40a4db64ac46b480359e455c2cfb7b81972e8 help: also hide options marked EXPERIMENTAL Similar to DEPRECATED, add a way to indicate that options are EXPERIMENTAL. diff -r 4ec40a4db64a -r 117b9a101f71 mercurial/help.py --- 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 = '' diff -r 4ec40a4db64a -r 117b9a101f71 tests/test-help.t --- 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