Mercurial > hg
comparison hgext/color.py @ 25597:fd5bc660c9f0
templater: do not reevaluate rawstring as template (BC)
The previous patch made 'string' is always interpreted as a template. So
this patch removes the special handling of r'rawstring' instead. Now r''
disables template processing at all.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Wed, 10 Jun 2015 21:44:43 +0900 |
parents | dd511b5cb818 |
children | 328739ea70c3 |
comparison
equal
deleted
inserted
replaced
25596:c1975809a6b5 | 25597:fd5bc660c9f0 |
---|---|
494 | 494 |
495 # add known effects to the mapping so symbols like 'red', 'bold', | 495 # add known effects to the mapping so symbols like 'red', 'bold', |
496 # etc. don't need to be quoted | 496 # etc. don't need to be quoted |
497 mapping.update(dict([(k, k) for k in _effects])) | 497 mapping.update(dict([(k, k) for k in _effects])) |
498 | 498 |
499 thing = templater._evalifliteral(args[1], context, mapping) | 499 thing = args[1][0](context, mapping, args[1][1]) |
500 | 500 |
501 # apparently, repo could be a string that is the favicon? | 501 # apparently, repo could be a string that is the favicon? |
502 repo = mapping.get('repo', '') | 502 repo = mapping.get('repo', '') |
503 if isinstance(repo, str): | 503 if isinstance(repo, str): |
504 return thing | 504 return thing |
505 | 505 |
506 label = templater._evalifliteral(args[0], context, mapping) | 506 label = args[0][0](context, mapping, args[0][1]) |
507 | 507 |
508 thing = templater.stringify(thing) | 508 thing = templater.stringify(thing) |
509 label = templater.stringify(label) | 509 label = templater.stringify(label) |
510 | 510 |
511 return repo.ui.label(thing, label) | 511 return repo.ui.label(thing, label) |