comparison mercurial/fileset.py @ 36503:ab5f18a9dcac

py3: slice over bytes or use startswith() to prevent getting ascii values Differential Revision: https://phab.mercurial-scm.org/D2496
author Pulkit Goyal <7895pulkit@gmail.com>
date Wed, 28 Feb 2018 19:54:10 +0530
parents 7b2b82f891bf
children db33c5bc781f
comparison
equal deleted inserted replaced
36502:d0d5eef57fb0 36503:ab5f18a9dcac
390 a = util.sizetoint(expr[2:]) 390 a = util.sizetoint(expr[2:])
391 return lambda x: x >= a 391 return lambda x: x >= a
392 elif expr.startswith(">"): 392 elif expr.startswith(">"):
393 a = util.sizetoint(expr[1:]) 393 a = util.sizetoint(expr[1:])
394 return lambda x: x > a 394 return lambda x: x > a
395 elif expr[0].isdigit or expr[0] == '.': 395 elif expr[0:1].isdigit or expr.startswith('.'):
396 a = util.sizetoint(expr) 396 a = util.sizetoint(expr)
397 b = _sizetomax(expr) 397 b = _sizetomax(expr)
398 return lambda x: x >= a and x <= b 398 return lambda x: x >= a and x <= b
399 raise error.ParseError(_("couldn't parse size: %s") % expr) 399 raise error.ParseError(_("couldn't parse size: %s") % expr)
400 400