Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/revsetlang.py @ 37087:f0b6fbea00cf
stringutil: bulk-replace call sites to point to new module
This might conflict with other patches floating around, sorry.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Thu, 22 Mar 2018 21:56:20 +0900 |
parents | 1b179d151578 |
children | 29eb4cafeeb8 |
comparison
equal
deleted
inserted
replaced
37086:f99d64e8a4e4 | 37087:f0b6fbea00cf |
---|---|
14 error, | 14 error, |
15 node, | 15 node, |
16 parser, | 16 parser, |
17 pycompat, | 17 pycompat, |
18 util, | 18 util, |
19 ) | |
20 from .utils import ( | |
21 stringutil, | |
19 ) | 22 ) |
20 | 23 |
21 elements = { | 24 elements = { |
22 # token-type: binding-strength, primary, prefix, infix, suffix | 25 # token-type: binding-strength, primary, prefix, infix, suffix |
23 "(": (21, None, ("group", 1, ")"), ("func", 1, ")"), None), | 26 "(": (21, None, ("group", 1, ")"), ("func", 1, ")"), None), |
205 return int(getstring(x, err)) | 208 return int(getstring(x, err)) |
206 except ValueError: | 209 except ValueError: |
207 raise error.ParseError(err) | 210 raise error.ParseError(err) |
208 | 211 |
209 def getboolean(x, err): | 212 def getboolean(x, err): |
210 value = util.parsebool(getsymbol(x)) | 213 value = stringutil.parsebool(getsymbol(x)) |
211 if value is not None: | 214 if value is not None: |
212 return value | 215 return value |
213 raise error.ParseError(err) | 216 raise error.ParseError(err) |
214 | 217 |
215 def getlist(x): | 218 def getlist(x): |
563 >>> _quote(b'asdf\'') | 566 >>> _quote(b'asdf\'') |
564 "'asdf\\''" | 567 "'asdf\\''" |
565 >>> _quote(1) | 568 >>> _quote(1) |
566 "'1'" | 569 "'1'" |
567 """ | 570 """ |
568 return "'%s'" % util.escapestr(pycompat.bytestr(s)) | 571 return "'%s'" % stringutil.escapestr(pycompat.bytestr(s)) |
569 | 572 |
570 def _formatargtype(c, arg): | 573 def _formatargtype(c, arg): |
571 if c == 'd': | 574 if c == 'd': |
572 return '%d' % int(arg) | 575 return '%d' % int(arg) |
573 elif c == 's': | 576 elif c == 's': |