Mercurial > public > mercurial-scm > hg-stable
diff mercurial/formatter.py @ 28957:d813132ea361
templater: load and expand aliases by template engine (API) (issue4842)
Now template aliases are fully supported in log and formatter templates.
As I said before, aliases are not expanded in map files. This avoids possible
corruption of our stock styles and web templates. This behavior is undocumented
since no map file nor [templates] section are documented at all. Later on,
we might want to add [aliases] section to map files if it appears to be useful.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 27 Mar 2016 20:59:36 +0900 |
parents | 78759f78a44e |
children | b501579147f1 |
line wrap: on
line diff
--- a/mercurial/formatter.py Sun Apr 03 13:23:40 2016 +0900 +++ b/mercurial/formatter.py Sun Mar 27 20:59:36 2016 +0900 @@ -197,7 +197,8 @@ def maketemplater(ui, topic, tmpl, filters=None, cache=None): """Create a templater from a string template 'tmpl'""" - t = templater.templater(filters=filters, cache=cache) + aliases = ui.configitems('templatealias') + t = templater.templater(filters=filters, cache=cache, aliases=aliases) if tmpl: t.cache[topic] = tmpl return t