Mercurial > hg
comparison mercurial/templateutil.py @ 37084: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 | 2891079fb0c0 |
children | 7db3c28dfdfd |
comparison
equal
deleted
inserted
replaced
37083:f99d64e8a4e4 | 37084:f0b6fbea00cf |
---|---|
12 from .i18n import _ | 12 from .i18n import _ |
13 from . import ( | 13 from . import ( |
14 error, | 14 error, |
15 pycompat, | 15 pycompat, |
16 util, | 16 util, |
17 ) | |
18 from .utils import ( | |
19 stringutil, | |
17 ) | 20 ) |
18 | 21 |
19 class ResourceUnavailable(error.Abort): | 22 class ResourceUnavailable(error.Abort): |
20 pass | 23 pass |
21 | 24 |
279 func, data = arg | 282 func, data = arg |
280 if func is runsymbol: | 283 if func is runsymbol: |
281 thing = func(context, mapping, data, default=None) | 284 thing = func(context, mapping, data, default=None) |
282 if thing is None: | 285 if thing is None: |
283 # not a template keyword, takes as a boolean literal | 286 # not a template keyword, takes as a boolean literal |
284 thing = util.parsebool(data) | 287 thing = stringutil.parsebool(data) |
285 else: | 288 else: |
286 thing = func(context, mapping, data) | 289 thing = func(context, mapping, data) |
287 thing = unwrapvalue(thing) | 290 thing = unwrapvalue(thing) |
288 if isinstance(thing, bool): | 291 if isinstance(thing, bool): |
289 return thing | 292 return thing |