Mercurial > hg
diff tests/test-check-code.t @ 24177:f53b7174facf
hgweb: extract changeset template mapping generation to own function
Similar in spirit to 513d47905114, I want to write an extension to
make available extra template keywords so hgweb templates can include
extra data.
To do this today requires monkeypatching the templater, which I think is
the wrong place to perform this modification.
This patch extracts the creation of the templater arguments to a
standalone function - one that can be monkeypatched by extensions.
I would very much like for extensions to be able to inject extra
templater parameters into *any* template. However, I'm not sure the best
way to facilitate this, as hgweb commands invoke the templater before
returning and we want the extensions to have access to rich data
structures like the context instances. We need cooperation inside hgweb
command functions. The use case screams for something like internal-only
"hooks." This is exactly what my (rejected) "events" patch series
provided. Perhaps that feature should be reconsidered...
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Mon, 02 Mar 2015 15:07:18 -0800 |
parents | e53f6b72a0e4 |
children | 68633ff2b608 |