comparison mercurial/help.py @ 26415:46af0adb5c37

help: hide deprecated filesets, revsets and template items if not verbose This allows us to hide {branches} template keyword in a better way. Currently it is achieved by copying keywords table and deleting 'branches' from it.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 26 Sep 2015 12:17:44 +0900
parents c44b507e7c78
children a2291c9c85a1
comparison
equal deleted inserted replaced
26414:c44b507e7c78 26415:46af0adb5c37
189 single documentation block and use it to overwrite the marker in doc. 189 single documentation block and use it to overwrite the marker in doc.
190 """ 190 """
191 entries = [] 191 entries = []
192 for name in sorted(items): 192 for name in sorted(items):
193 text = (items[name].__doc__ or '').rstrip() 193 text = (items[name].__doc__ or '').rstrip()
194 if not text: 194 if (not text
195 or not ui.verbose and any(w in text for w in _exclkeywords)):
195 continue 196 continue
196 text = gettext(text) 197 text = gettext(text)
197 if dedent: 198 if dedent:
198 text = textwrap.dedent(text) 199 text = textwrap.dedent(text)
199 lines = text.splitlines() 200 lines = text.splitlines()