[PATCH] templates: add {lasttag} and {lasttagdistance} keywords

Dirkjan Ochtman dirkjan at ochtman.nl
Tue Jul 14 11:57:46 CDT 2009


On Tue, Jul 14, 2009 at 18:45, Gilles Moris<gilles.moris at free.fr> wrote:
>  mercurial/cmdutil.py |  40 ++++++++++++++++++++++++++++++++++++++++
>  mercurial/help.py    |   3 +++
>  tests/test-log       |  44 ++++++++++++++++++++++++++++++++++++++++++++
>  tests/test-log.out   |  50 ++++++++++++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 137 insertions(+), 0 deletions(-)

So I've been thinking about the templatefilter mess in cmdutil's
templater functions, and I'd like to propose a way out:

- all template filter functions accept a new **defaults dict in
addition to their current argument(s)
- we always pass 'repo' into the templater defaults

Now we don't need to do all the closures, and can keep template
filters in one place. Comments?

Cheers,

Dirkjan



More information about the Mercurial-devel mailing list