keyword: offer additional datefilters when the extension is enabled
authorChristian Ebert <blacktrash@gmx.net>
Mon, 14 Mar 2011 12:26:50 +0100
changeset 13634 15470463f932
parent 13633 20d13244f192
child 13637 4e976235c985
keyword: offer additional datefilters when the extension is enabled Before the additional datefilters (utcdate, svnisodate, svnutcdate) were used when kwtemplater was initialized. Now they always be used once the extension is enabled.
hgext/keyword.py
--- a/hgext/keyword.py	Mon Mar 14 12:19:59 2011 +0100
+++ b/hgext/keyword.py	Mon Mar 14 12:26:50 2011 +0100
@@ -126,6 +126,10 @@
     '''
     return util.datestr((text[0], 0), '%Y-%m-%d %H:%M:%SZ')
 
+templatefilters.filters.update({'utcdate': utcdate,
+                                'svnisodate': svnisodate,
+                                'svnutcdate': svnutcdate})
+
 # make keyword tools accessible
 kwtools = {'templater': None, 'hgcmd': ''}
 
@@ -187,9 +191,6 @@
                                   for k, v in kwmaps)
         else:
             self.templates = _defaultkwmaps(self.ui)
-        templatefilters.filters.update({'utcdate': utcdate,
-                                        'svnisodate': svnisodate,
-                                        'svnutcdate': svnutcdate})
 
     @util.propertycache
     def escape(self):