diff --git a/mercurial/logcmdutil.py b/mercurial/logcmdutil.py --- a/mercurial/logcmdutil.py +++ b/mercurial/logcmdutil.py @@ -603,12 +603,13 @@ class changesettemplater(changesetprinte def templatespec(tmpl, mapfile): - if pycompat.ispy3: - assert not isinstance(tmpl, str), b'tmpl must not be a str' + assert not (tmpl and mapfile) if mapfile: - return formatter.templatespec(b'changeset', tmpl, mapfile) + return formatter.mapfile_templatespec(b'changeset', mapfile) else: - return formatter.templatespec(b'', tmpl, None) + if pycompat.ispy3: + assert not isinstance(tmpl, str), b'tmpl must not be a str' + return formatter.literal_templatespec(tmpl) def _lookuptemplate(ui, tmpl, style):