Mercurial > public > mercurial-scm > hg
comparison mercurial/ui.py @ 36126:8f5c7f906f9b
ui: use pycompat.bytestr() to get a bytes-repr of config default
We don't know what type we'll get here, so we need something that'll
behave like a repr without returning a unicode.
Differential Revision: https://phab.mercurial-scm.org/D2208
author | Augie Fackler <augie@google.com> |
---|---|
date | Mon, 12 Feb 2018 20:41:47 -0500 |
parents | 0ff41ced4c12 |
children | df1760b58fda |
comparison
equal
deleted
inserted
replaced
36125:0dde5f53b4ce | 36126:8f5c7f906f9b |
---|---|
496 elif (item is not None | 496 elif (item is not None |
497 and item.default is not configitems.dynamicdefault | 497 and item.default is not configitems.dynamicdefault |
498 and default != itemdefault): | 498 and default != itemdefault): |
499 msg = ("specifying a mismatched default value for a registered " | 499 msg = ("specifying a mismatched default value for a registered " |
500 "config item: '%s.%s' '%s'") | 500 "config item: '%s.%s' '%s'") |
501 msg %= (section, name, default) | 501 msg %= (section, name, pycompat.bytestr(default)) |
502 self.develwarn(msg, 2, 'warn-config-default') | 502 self.develwarn(msg, 2, 'warn-config-default') |
503 | 503 |
504 for s, n in alternates: | 504 for s, n in alternates: |
505 candidate = self._data(untrusted).get(s, n, None) | 505 candidate = self._data(untrusted).get(s, n, None) |
506 if candidate is not None: | 506 if candidate is not None: |