comparison mercurial/help.py @ 26371:51b309ce6c7d

help: unify handling of DEPRECATED/EXPERIMENTAL keywords This fixes listexts() to exclude translated "(DEPRECATED)" marker correctly. On the other hand, help_() doesn't need translated keywords, but I don't think it's worth to separate untranslated keywords just for it.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 26 Sep 2015 11:50:47 +0900
parents 44cc9f63a2f1
children e0c572d4d112
comparison
equal deleted inserted replaced
26370:44cc9f63a2f1 26371:51b309ce6c7d
27 '''return a text listing of the given extensions''' 27 '''return a text listing of the given extensions'''
28 rst = [] 28 rst = []
29 if exts: 29 if exts:
30 rst.append('\n%s\n\n' % header) 30 rst.append('\n%s\n\n' % header)
31 for name, desc in sorted(exts.iteritems()): 31 for name, desc in sorted(exts.iteritems()):
32 if '(DEPRECATED)' in desc and not showdeprecated: 32 if not showdeprecated and any(w in desc for w in _exclkeywords):
33 continue 33 continue
34 rst.append('%s:%s: %s\n' % (' ' * indent, name, desc)) 34 rst.append('%s:%s: %s\n' % (' ' * indent, name, desc))
35 return rst 35 return rst
36 36
37 def extshelp(): 37 def extshelp():
339 continue 339 continue
340 f = f.lstrip("^") 340 f = f.lstrip("^")
341 if not ui.debugflag and f.startswith("debug") and name != "debug": 341 if not ui.debugflag and f.startswith("debug") and name != "debug":
342 continue 342 continue
343 doc = e[0].__doc__ 343 doc = e[0].__doc__
344 if doc and '(DEPRECATED)' in doc and not ui.verbose: 344 if not ui.verbose and doc and any(w in doc for w in _exclkeywords):
345 continue 345 continue
346 doc = gettext(doc) 346 doc = gettext(doc)
347 if not doc: 347 if not doc:
348 doc = _("(no help text available)") 348 doc = _("(no help text available)")
349 h[f] = doc.splitlines()[0].rstrip() 349 h[f] = doc.splitlines()[0].rstrip()