Mercurial > public > mercurial-scm > hg
comparison mercurial/ui.py @ 33060:e70cbae4c4e6
config: use '_config' within 'configbytes'
This will prevent bugs from using None as the sentinel value (eg:
'ui.interactive')
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sun, 25 Jun 2017 14:41:12 +0200 |
parents | 1dc2ffe0123b |
children | c41cbe98822c |
comparison
equal
deleted
inserted
replaced
33059:1dc2ffe0123b | 33060:e70cbae4c4e6 |
---|---|
632 Traceback (most recent call last): | 632 Traceback (most recent call last): |
633 ... | 633 ... |
634 ConfigError: foo.invalid is not a byte quantity ('somevalue') | 634 ConfigError: foo.invalid is not a byte quantity ('somevalue') |
635 """ | 635 """ |
636 | 636 |
637 value = self.config(section, name, default, untrusted) | 637 value = self._config(section, name, default, untrusted) |
638 if value is None: | 638 if value is _unset: |
639 if default is _unset: | 639 if default is _unset: |
640 default = 0 | 640 default = 0 |
641 value = default | 641 value = default |
642 if not isinstance(value, str): | 642 if not isinstance(value, str): |
643 return value | 643 return value |