Show More
@@ -596,7 +596,7 b' class ui(object):' | |||
|
596 | 596 | return self.configwith(int, section, name, default, 'integer', |
|
597 | 597 | untrusted) |
|
598 | 598 | |
|
599 |
def configbytes(self, section, name, default= |
|
|
599 | def configbytes(self, section, name, default=_unset, untrusted=False): | |
|
600 | 600 | """parse a configuration element as a quantity in bytes |
|
601 | 601 | |
|
602 | 602 | Units can be specified as b (bytes), k or kb (kilobytes), m or |
@@ -618,11 +618,13 b' class ui(object):' | |||
|
618 | 618 | ConfigError: foo.invalid is not a byte quantity ('somevalue') |
|
619 | 619 | """ |
|
620 | 620 | |
|
621 |
value = self.config(section, name, |
|
|
621 | value = self.config(section, name, default, untrusted) | |
|
622 | 622 | if value is None: |
|
623 |
if |
|
|
624 |
|
|
|
623 | if default is _unset: | |
|
624 | default = 0 | |
|
625 | 625 | value = default |
|
626 | if not isinstance(value, str): | |
|
627 | return value | |
|
626 | 628 | try: |
|
627 | 629 | return util.sizetoint(value) |
|
628 | 630 | except error.ParseError: |
General Comments 0
You need to be logged in to leave comments.
Login now