comparison mercurial/logcmdutil.py @ 45290: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 dfb67cd1da7f
children c1915cfa8080
comparison
equal deleted inserted replaced
45289:dfb67cd1da7f 45290:215f08c8006c
605 def templatespec(tmpl, mapfile): 605 def templatespec(tmpl, mapfile):
606 assert not (tmpl and mapfile) 606 assert not (tmpl and mapfile)
607 if mapfile: 607 if mapfile:
608 return formatter.mapfile_templatespec(b'changeset', mapfile) 608 return formatter.mapfile_templatespec(b'changeset', mapfile)
609 else: 609 else:
610 if pycompat.ispy3:
611 assert not isinstance(tmpl, str), b'tmpl must not be a str'
612 return formatter.literal_templatespec(tmpl) 610 return formatter.literal_templatespec(tmpl)
613 611
614 612
615 def _lookuptemplate(ui, tmpl, style): 613 def _lookuptemplate(ui, tmpl, style):
616 """Find the template matching the given template spec or style 614 """Find the template matching the given template spec or style