# HG changeset patch # User Christian Ebert # Date 1168796310 -3600 # Node ID 9353e7ce6d9b9b53788652825abf3929a2196761 # Parent 9e4cbe64fb4fcb6faf38432c7fb9c3537b30d8d7 No clumsy setting of node in kwfilelog.add, pass as kwarg diff -r 9e4cbe64fb4f -r 9353e7ce6d9b hgkw/keyword.py --- a/hgkw/keyword.py Sun Jan 14 12:56:52 2007 +0100 +++ b/hgkw/keyword.py Sun Jan 14 18:38:30 2007 +0100 @@ -96,7 +96,8 @@ self.t = cmdutil.changeset_templater(self.ui, self.repo, False, '', False) - def expand(self, mobj, path): + def expand(self, mobj, path, node=None): + self.node = self.node or node kw = mobj.group(1) template = templater.parsestring(self.templates[kw], quoted=False) self.t.use_template(template) @@ -141,9 +142,8 @@ if self.iskwcandidate(data): c = context.filectx(self._repo, self._path, fileid=node, filelog=self) - self.kwt.node = c.node() return self.kwt.re_kw.sub(lambda m: - self.kwt.expand(m, self._path), data) + self.kwt.expand(m, self._path, node=c.node()), data) return data def add(self, text, meta, tr, link, p1=None, p2=None):