Mercurial > public > mercurial-scm > hg-stable
diff mercurial/help.py @ 41020:e8e2a7656e83
help: hide default value for default-off flags
If we no longer show the "[no-]" for default-off flags, it also seems
unnecessary to show the "default: off" for them, since that's quite
clearly the default. It's extra confusing for action flags like `hg
bookmarks --delete`.
Differential Revision: https://phab.mercurial-scm.org/D5455
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Wed, 19 Dec 2018 09:33:42 -0800 |
parents | fcc0a7ac9ebd |
children | 9afe128f7727 |
line wrap: on
line diff
--- a/mercurial/help.py Wed Dec 19 09:20:32 2018 -0800 +++ b/mercurial/help.py Wed Dec 19 09:33:42 2018 -0800 @@ -165,14 +165,14 @@ if isinstance(default, fancyopts.customopt): default = default.getdefaultvalue() - if (default and not callable(default)) or default is False: + if default and not callable(default): # default is of unknown type, and in Python 2 we abused # the %s-shows-repr property to handle integers etc. To # match that behavior on Python 3, we do str(default) and # then convert it to bytes. defaultstr = pycompat.bytestr(default) - if isinstance(default, bool): - defaultstr = _("on") if default else _("off") + if default is True: + defaultstr = _("on") desc += _(" (default: %s)") % defaultstr if isinstance(default, list):