diff -r 583efc0983f1 -r e92c6762e2be hgkw/keyword.py --- a/hgkw/keyword.py Mon Nov 26 12:24:16 2007 +0100 +++ b/hgkw/keyword.py Mon Nov 26 12:29:23 2007 +0100 @@ -127,21 +127,22 @@ self.t = cmdutil.changeset_templater(self.ui, self.repo, False, '', False) - def kwsub(self, mobj): - '''Substitutes keyword using corresponding template.''' - kw = mobj.group(1) - self.t.use_template(self.templates[kw]) - self.ui.pushbuffer() - self.t.show(changenode=self.node, root=self.repo.root, file=self.path) - keywordsub = templater.firstline(self.ui.popbuffer()) - return '$%s: %s $' % (kw, keywordsub) - def substitute(self, node, data, subfunc): '''Obtains node if missing, and calls given substitution function.''' if not self.node: c = context.filectx(self.repo, self.path, fileid=node) self.node = c.node() - return subfunc(self.kwsub, data) + + def kwsub(mobj): + '''Substitutes keyword using corresponding template.''' + kw = mobj.group(1) + self.t.use_template(self.templates[kw]) + self.ui.pushbuffer() + self.t.show(changenode=self.node, + root=self.repo.root, file=self.path) + return '$%s: %s $' % (kw, templater.firstline(self.ui.popbuffer())) + + return subfunc(kwsub, data) def expand(self, node, data): '''Returns data with keywords expanded.'''