# HG changeset patch # User Yuya Nishihara # Date 2015-09-26 02:25:38 # Node ID 4799b5c4aaf4c684a77e1a62897b101bb447e973 # Parent 0224d22ef5d815c86d7ebce6644f056c406acbfd help: define list of keywords that should be excluded from non-verbose output This list will be reused by the other deprecated/experimental handling. diff --git a/mercurial/help.py b/mercurial/help.py --- a/mercurial/help.py +++ b/mercurial/help.py @@ -14,6 +14,13 @@ import encoding, util, minirst import cmdutil import hgweb.webcommands as webcommands +_exclkeywords = [ + "DEPRECATED", + "EXPERIMENTAL", + _("DEPRECATED"), + _("EXPERIMENTAL"), + ] + def listexts(header, exts, indent=1, showdeprecated=False): '''return a text listing of the given extensions''' rst = [] @@ -43,9 +50,7 @@ def optrst(header, options, verbose): shortopt, longopt, default, desc = option optlabel = _("VALUE") # default label - if not verbose and ("DEPRECATED" in desc or _("DEPRECATED") in desc or - "EXPERIMENTAL" in desc or - _("EXPERIMENTAL") in desc): + if not verbose and any(w in desc for w in _exclkeywords): continue so = ''