Mercurial > public > mercurial-scm > hg
comparison mercurial/formatter.py @ 45266:215f08c8006c
templatespec: move check for non-unicode to lower-level function
Now that we have the factory functions, it makes sense to have the
check there.
Differential Revision: https://phab.mercurial-scm.org/D8847
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Mon, 20 Jul 2020 21:33:28 -0700 |
parents | 8cce9f77ca73 |
children | 65a812ed9e9f |
comparison
equal
deleted
inserted
replaced
45265:dfb67cd1da7f | 45266:215f08c8006c |
---|---|
549 def reference_templatespec(ref, refargs=None): | 549 def reference_templatespec(ref, refargs=None): |
550 return templatespec(ref, None, None, refargs) | 550 return templatespec(ref, None, None, refargs) |
551 | 551 |
552 | 552 |
553 def literal_templatespec(tmpl): | 553 def literal_templatespec(tmpl): |
554 if pycompat.ispy3: | |
555 assert not isinstance(tmpl, str), b'tmpl must not be a str' | |
554 return templatespec(b'', tmpl, None) | 556 return templatespec(b'', tmpl, None) |
555 | 557 |
556 | 558 |
557 def mapfile_templatespec(topic, mapfile): | 559 def mapfile_templatespec(topic, mapfile): |
558 return templatespec(topic, None, mapfile) | 560 return templatespec(topic, None, mapfile) |