[PATCH] keyword: add extra datefilters in a single update call

Christian Ebert blacktrash at gmx.net
Fri Jul 2 06:22:57 CDT 2010


* Christian Ebert on Tuesday, June 22, 2010 at 14:35:39 +0200
> # HG changeset patch
> # User Christian Ebert <blacktrash at gmx.net>
> # Date 1277210049 -7200
> # Node ID efb62914311cb5a4e95a037460d240efc0ccf894
> # Parent  a99ef3711890637fa93c9be676cbe2b5f5676d14
> keyword: add extra datefilters in a single update call
> 
> diff --git a/hgext/keyword.py b/hgext/keyword.py
> --- a/hgext/keyword.py
> +++ b/hgext/keyword.py
> @@ -159,9 +159,9 @@
>         kwpat = r'\$(%s)(: [^$\n\r]*? )??\$' % '|'.join(escaped)
>         self.re_kw = re.compile(kwpat)
> 
> -        templatefilters.filters['utcdate'] = utcdate
> -        templatefilters.filters['svnisodate'] = svnisodate
> -        templatefilters.filters['svnutcdate'] = svnutcdate
> +        templatefilters.filters.update({'utcdate': utcdate,
> +                                        'svnisodate': svnisodate,
> +                                        'svnutcdate': svnutcdate})
> 
>     def substitute(self, data, path, ctx, subfunc):
>         '''Replaces keywords in data with expanded template.'''


This could go in now.

Or do we want those 3 datefilters available in core?

c
-- 
theatre - books - texts - movies
Black Trash Productions at home: http://www.blacktrash.org/
Black Trash Productions on Facebook:
http://www.facebook.com/blacktrashproductions


More information about the Mercurial-devel mailing list