Mercurial > hg
changeset 41415:873a28d7e962
githelp: format with %d if an integer
Python 3 doesn't allow us to format an int with %s like Python 2
did. So handle that.
Differential Revision: https://phab.mercurial-scm.org/D5726
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sat, 26 Jan 2019 14:16:34 -0800 |
parents | 031d91623fdc |
children | 1d99c9a5ccb0 |
files | hgext/githelp.py |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/githelp.py Sat Jan 26 14:14:44 2019 -0800 +++ b/hgext/githelp.py Sat Jan 26 14:16:34 2019 -0800 @@ -121,7 +121,12 @@ for k, values in sorted(self.opts.iteritems()): for v in values: if v: - cmd += " %s %s" % (k, v) + if isinstance(v, int): + fmt = ' %s %d' + else: + fmt = ' %s %s' + + cmd += fmt % (k, v) else: cmd += " %s" % (k,) if self.args: