# HG changeset patch # User Matt Mackall # Date 1201812259 21600 # Node ID 263b3b10c55fbf29521ec227f4ed0e09e7378c95 # Parent 3ea0cbaf35358ca79e2061fdcfef6d3fea4dd57e templates: move filters to their own module This eliminates just about all Mercurial dependencies in templater.py [ original upstream description ] diff -r 3ea0cbaf3535 -r 263b3b10c55f hgkw/keyword.py --- a/hgkw/keyword.py Tue Jan 08 22:40:51 2008 -0500 +++ b/hgkw/keyword.py Thu Jan 31 14:44:19 2008 -0600 @@ -80,8 +80,8 @@ "Log = {desc}" expands to the first line of the changeset description. ''' -from mercurial import commands, cmdutil, context, dispatch, filelog -from mercurial import patch, localrepo, revlog, templater, util +from mercurial import commands, cmdutil, context, dispatch, filelog, revlog +from mercurial import patch, localrepo, templater, templatefilters, util from mercurial.node import * from mercurial.i18n import _ import re, shutil, sys, tempfile, time @@ -132,7 +132,7 @@ kwpat = r'\$(%s)(: [^$\n\r]*? )??\$' % '|'.join(escaped) self.re_kw = re.compile(kwpat) - templater.common_filters['utcdate'] = utcdate + templatefilters.filters['utcdate'] = utcdate self.ct = cmdutil.changeset_templater(self.ui, self.repo, False, '', False) @@ -151,7 +151,8 @@ self.ct.use_template(self.templates[kw]) self.ui.pushbuffer() self.ct.show(changenode=fnode, root=self.repo.root, file=self.path) - return '$%s: %s $' % (kw, templater.firstline(self.ui.popbuffer())) + return '$%s: %s $' % (kw, templatefilters.firstline( + self.ui.popbuffer())) return subfunc(kwsub, data)