Mercurial > public > mercurial-scm > hg
comparison mercurial/help.py @ 26369:4799b5c4aaf4
help: define list of keywords that should be excluded from non-verbose output
This list will be reused by the other deprecated/experimental handling.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 26 Sep 2015 11:25:38 +0900 |
parents | 69da16b366ad |
children | 44cc9f63a2f1 |
comparison
equal
deleted
inserted
replaced
26368:0224d22ef5d8 | 26369:4799b5c4aaf4 |
---|---|
11 import extensions, revset, fileset, templatekw, templatefilters, filemerge | 11 import extensions, revset, fileset, templatekw, templatefilters, filemerge |
12 import templater | 12 import templater |
13 import encoding, util, minirst | 13 import encoding, util, minirst |
14 import cmdutil | 14 import cmdutil |
15 import hgweb.webcommands as webcommands | 15 import hgweb.webcommands as webcommands |
16 | |
17 _exclkeywords = [ | |
18 "DEPRECATED", | |
19 "EXPERIMENTAL", | |
20 _("DEPRECATED"), | |
21 _("EXPERIMENTAL"), | |
22 ] | |
16 | 23 |
17 def listexts(header, exts, indent=1, showdeprecated=False): | 24 def listexts(header, exts, indent=1, showdeprecated=False): |
18 '''return a text listing of the given extensions''' | 25 '''return a text listing of the given extensions''' |
19 rst = [] | 26 rst = [] |
20 if exts: | 27 if exts: |
41 shortopt, longopt, default, desc, optlabel = option | 48 shortopt, longopt, default, desc, optlabel = option |
42 else: | 49 else: |
43 shortopt, longopt, default, desc = option | 50 shortopt, longopt, default, desc = option |
44 optlabel = _("VALUE") # default label | 51 optlabel = _("VALUE") # default label |
45 | 52 |
46 if not verbose and ("DEPRECATED" in desc or _("DEPRECATED") in desc or | 53 if not verbose and any(w in desc for w in _exclkeywords): |
47 "EXPERIMENTAL" in desc or | |
48 _("EXPERIMENTAL") in desc): | |
49 continue | 54 continue |
50 | 55 |
51 so = '' | 56 so = '' |
52 if shortopt: | 57 if shortopt: |
53 so = '-' + shortopt | 58 so = '-' + shortopt |