Offer additional datefilters when the extension is enabled
authorChristian Ebert <blacktrash@gmx.net>
Mon, 14 Mar 2011 12:26:50 +0100
changeset 893 24924dfb8326
parent 892 d6b24cad9513
child 894 2061f728babf
child 896 3ed02605e0f2
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.
hgkw/keyword.py
--- a/hgkw/keyword.py	Mon Mar 14 12:19:59 2011 +0100
+++ b/hgkw/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):