comparison mercurial/help.py @ 40966:05abb5fb146a

help: use "default: on" instead of "default: True" "True" feels like a Python thing and not something that users should see. Differential Revision: https://phab.mercurial-scm.org/D5430
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 14 Dec 2018 13:20:00 -0800
parents 419d703115b0
children 8604f130eb43
comparison
equal deleted inserted replaced
40965:811f772b44aa 40966:05abb5fb146a
166 if default and not callable(default): 166 if default and not callable(default):
167 # default is of unknown type, and in Python 2 we abused 167 # default is of unknown type, and in Python 2 we abused
168 # the %s-shows-repr property to handle integers etc. To 168 # the %s-shows-repr property to handle integers etc. To
169 # match that behavior on Python 3, we do str(default) and 169 # match that behavior on Python 3, we do str(default) and
170 # then convert it to bytes. 170 # then convert it to bytes.
171 desc += _(" (default: %s)") % pycompat.bytestr(default) 171 defaultstr = pycompat.bytestr(default)
172 if default is True:
173 defaultstr = _("on")
174 desc += _(" (default: %s)") % defaultstr
172 175
173 if isinstance(default, list): 176 if isinstance(default, list):
174 lo += " %s [+]" % optlabel 177 lo += " %s [+]" % optlabel
175 multioccur = True 178 multioccur = True
176 elif (default is not None) and not isinstance(default, bool): 179 elif (default is not None) and not isinstance(default, bool):