# HG changeset patch # User Martin von Zweigbergk # Date 2020-07-21 04:32:10 # Node ID dfb67cd1da7f14e277bec26c0d8d259bffe002d2 # Parent 8cce9f77ca73526dc4326d169bcceebce0d6e7ca templatespec: logcmdutil.templatespec() gets either template or mapfile The callers of the function already never pass (non-`None`) values for both, so let's check that and call the new factory functions. Differential Revision: https://phab.mercurial-scm.org/D8846 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):