Show More
@@ -6,7 +6,7 | |||
|
6 | 6 | # GNU General Public License version 2 or any later version. |
|
7 | 7 | |
|
8 | 8 | from i18n import _ |
|
9 |
import errno, getpass, os |
|
|
9 | import errno, getpass, os, socket, sys, tempfile, traceback | |
|
10 | 10 | import config, scmutil, util, error, formatter |
|
11 | 11 | |
|
12 | 12 | class ui(object): |
@@ -284,22 +284,16 class ui(object): | |||
|
284 | 284 | ConfigError: foo.invalid is not a byte quantity ('somevalue') |
|
285 | 285 | """ |
|
286 | 286 | |
|
287 |
|
|
|
288 |
if |
|
|
287 | value = self.config(section, name) | |
|
288 | if value is None: | |
|
289 | 289 | if not isinstance(default, str): |
|
290 | 290 | return default |
|
291 |
|
|
|
292 | multiple = 1 | |
|
293 | m = re.match(r'([^kmbg]+?)\s*([kmg]?)b?$', string, re.I) | |
|
294 | if m: | |
|
295 | string, key = m.groups() | |
|
296 | key = key.lower() | |
|
297 | multiple = dict(k=1024, m=1048576, g=1073741824).get(key, 1) | |
|
291 | value = default | |
|
298 | 292 | try: |
|
299 |
return int( |
|
|
300 |
except |
|
|
293 | return util.sizetoint(value) | |
|
294 | except error.ParseError: | |
|
301 | 295 | raise error.ConfigError(_("%s.%s is not a byte quantity ('%s')") |
|
302 |
% (section, name, |
|
|
296 | % (section, name, value)) | |
|
303 | 297 | |
|
304 | 298 | def configlist(self, section, name, default=None, untrusted=False): |
|
305 | 299 | """parse a configuration element as a list of comma/space separated |
General Comments 0
You need to be logged in to leave comments.
Login now