Mercurial > hg
diff mercurial/cmdutil.py @ 45264:8cce9f77ca73
templatespec: create a factory function for each type there is
Most of the arguments to the `templatespec` constructor are mutually
exclusive, so each combination creates a different type of
templatespec. Let's clarify that by creating factory functions.
I've left the callers in `logcmdutil` unchanged for now because they
are more complex and `logcmdutil.templatespec()` is slightly higher
level in that it is specific to changesets.
My larger goal is to add support frozen binaries (specifically
PyOxidizer) by adding a specific type of `templatespec` for built-in
templates. That will get its own factory function.
Differential Revision: https://phab.mercurial-scm.org/D8845
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Thu, 16 Jul 2020 13:33:46 -0700 |
parents | a56ba57c837d |
children | e58e234096de |
line wrap: on
line diff
--- a/mercurial/cmdutil.py Wed Jul 29 10:42:09 2020 -0700 +++ b/mercurial/cmdutil.py Thu Jul 16 13:33:46 2020 -0700 @@ -3375,7 +3375,7 @@ def buildcommittemplate(repo, ctx, subs, extramsg, ref): ui = repo.ui - spec = formatter.templatespec(ref, None, None) + spec = formatter.reference_templatespec(ref) t = logcmdutil.changesettemplater(ui, repo, spec) t.t.cache.update( (k, templater.unquotestring(v))