hgkw/keyword.py
changeset 771 09e39675a702
parent 769 3bf3212b13bc
child 773 9f939fae8ff3
equal deleted inserted replaced
769:3bf3212b13bc 771:09e39675a702
   157             self.templates = _defaultkwmaps(self.ui)
   157             self.templates = _defaultkwmaps(self.ui)
   158         escaped = map(re.escape, self.templates.keys())
   158         escaped = map(re.escape, self.templates.keys())
   159         kwpat = r'\$(%s)(: [^$\n\r]*? )??\$' % '|'.join(escaped)
   159         kwpat = r'\$(%s)(: [^$\n\r]*? )??\$' % '|'.join(escaped)
   160         self.re_kw = re.compile(kwpat)
   160         self.re_kw = re.compile(kwpat)
   161 
   161 
   162         templatefilters.filters['utcdate'] = utcdate
   162         templatefilters.filters.update({'utcdate': utcdate,
   163         templatefilters.filters['svnisodate'] = svnisodate
   163                                         'svnisodate': svnisodate,
   164         templatefilters.filters['svnutcdate'] = svnutcdate
   164                                         'svnutcdate': svnutcdate})
   165 
   165 
   166     def substitute(self, data, path, ctx, subfunc):
   166     def substitute(self, data, path, ctx, subfunc):
   167         '''Replaces keywords in data with expanded template.'''
   167         '''Replaces keywords in data with expanded template.'''
   168         def kwsub(mobj):
   168         def kwsub(mobj):
   169             kw = mobj.group(1)
   169             kw = mobj.group(1)