comparison mercurial/fileset.py @ 38083:5f2dc1b71cf1

py3: use utils.stringutil.forcebytestr to convert error to bytes Differential Revision: https://phab.mercurial-scm.org/D3607
author Pulkit Goyal <7895pulkit@gmail.com>
date Sat, 19 May 2018 18:48:26 +0530
parents f290f130d7fc
children 5cb39a368c80
comparison
equal deleted inserted replaced
38082:1978abdb216c 38083:5f2dc1b71cf1
352 """ 352 """
353 try: 353 try:
354 # i18n: "grep" is a keyword 354 # i18n: "grep" is a keyword
355 r = re.compile(getstring(x, _("grep requires a pattern"))) 355 r = re.compile(getstring(x, _("grep requires a pattern")))
356 except re.error as e: 356 except re.error as e:
357 raise error.ParseError(_('invalid match pattern: %s') % e) 357 raise error.ParseError(_('invalid match pattern: %s') %
358 stringutil.forcebytestr(e))
358 return [f for f in mctx.existing() if r.search(mctx.ctx[f].data())] 359 return [f for f in mctx.existing() if r.search(mctx.ctx[f].data())]
359 360
360 def _sizetomax(s): 361 def _sizetomax(s):
361 try: 362 try:
362 s = s.strip().lower() 363 s = s.strip().lower()