# HG changeset patch # User Yuya Nishihara # Date 1443237464 -32400 # Node ID 46af0adb5c375cc51ce0d29cbdcd8ba843a33425 # Parent c44b507e7c7854ac6b50c7e96769acca10c75a4d 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. diff -r c44b507e7c78 -r 46af0adb5c37 mercurial/help.py --- a/mercurial/help.py Sat Sep 26 12:11:46 2015 +0900 +++ b/mercurial/help.py Sat Sep 26 12:17:44 2015 +0900 @@ -191,7 +191,8 @@ entries = [] for name in sorted(items): text = (items[name].__doc__ or '').rstrip() - if not text: + if (not text + or not ui.verbose and any(w in text for w in _exclkeywords)): continue text = gettext(text) if dedent: diff -r c44b507e7c78 -r 46af0adb5c37 tests/test-help.t --- a/tests/test-help.t Sat Sep 26 12:11:46 2015 +0900 +++ b/tests/test-help.t Sat Sep 26 12:17:44 2015 +0900 @@ -980,6 +980,12 @@ firstline Any text. Returns the first line of text. nonempty Any text. Returns '(none)' if the string is empty. +Test deprecated items + + $ hg help -v templating | grep currentbookmark + currentbookmark + $ hg help templating | (grep currentbookmark || true) + Test help hooks $ cat > helphook1.py <