Mercurial > public > mercurial-scm > hg
comparison mercurial/ui.py @ 32961:24111157f967
config: use the new '_unset' value for 'configint'
This should let 'configint' delegates all special processing of the default
config value to the main 'config' method.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sat, 17 Jun 2017 12:53:40 +0200 |
parents | 6ff6eb33f353 |
children | 0bf986cfa82b |
comparison
equal
deleted
inserted
replaced
32960:6ff6eb33f353 | 32961:24111157f967 |
---|---|
572 if desc is None: | 572 if desc is None: |
573 desc = convert.__name__ | 573 desc = convert.__name__ |
574 raise error.ConfigError(_("%s.%s is not a valid %s ('%s')") | 574 raise error.ConfigError(_("%s.%s is not a valid %s ('%s')") |
575 % (section, name, desc, v)) | 575 % (section, name, desc, v)) |
576 | 576 |
577 def configint(self, section, name, default=None, untrusted=False): | 577 def configint(self, section, name, default=_unset, untrusted=False): |
578 """parse a configuration element as an integer | 578 """parse a configuration element as an integer |
579 | 579 |
580 >>> u = ui(); s = 'foo' | 580 >>> u = ui(); s = 'foo' |
581 >>> u.setconfig(s, 'int1', '42') | 581 >>> u.setconfig(s, 'int1', '42') |
582 >>> u.configint(s, 'int1') | 582 >>> u.configint(s, 'int1') |