diff -r 120682fce099 -r 8fa3ab6221b9 mercurial/ui.py --- a/mercurial/ui.py Sun Feb 12 21:40:46 2017 -0800 +++ b/mercurial/ui.py Sun Feb 12 21:44:55 2017 -0800 @@ -453,17 +453,11 @@ >>> u.configint(s, 'invalid') Traceback (most recent call last): ... - ConfigError: foo.invalid is not an integer ('somevalue') + ConfigError: foo.invalid is not a valid integer ('somevalue') """ - v = self.config(section, name, None, untrusted) - if v is None: - return default - try: - return int(v) - except ValueError: - raise error.ConfigError(_("%s.%s is not an integer ('%s')") - % (section, name, v)) + return self.configwith(int, section, name, default, 'integer', + untrusted) def configbytes(self, section, name, default=0, untrusted=False): """parse a configuration element as a quantity in bytes