76 Expansions spanning more than one line and incremental expansions, |
76 Expansions spanning more than one line and incremental expansions, |
77 like CVS' $Log$, are not supported. A keyword template map |
77 like CVS' $Log$, are not supported. A keyword template map |
78 "Log = {desc}" expands to the first line of the changeset description. |
78 "Log = {desc}" expands to the first line of the changeset description. |
79 ''' |
79 ''' |
80 |
80 |
81 from mercurial import commands, cmdutil, context, dispatch, filelog, revlog |
81 from mercurial import commands, cmdutil, dispatch, filelog, revlog |
82 from mercurial import patch, localrepo, templater, templatefilters, util |
82 from mercurial import patch, localrepo, templater, templatefilters, util |
83 from mercurial.hgweb import webcommands |
83 from mercurial.hgweb import webcommands |
84 from mercurial.node import nullid, hex |
84 from mercurial.node import nullid, hex |
85 from mercurial.i18n import _ |
85 from mercurial.i18n import _ |
86 import re, shutil, tempfile, time |
86 import re, shutil, tempfile, time |
140 False, '', False) |
140 False, '', False) |
141 |
141 |
142 def getnode(self, path, fnode): |
142 def getnode(self, path, fnode): |
143 '''Derives changenode from file path and filenode.''' |
143 '''Derives changenode from file path and filenode.''' |
144 # used by kwfilelog.read and kwexpand |
144 # used by kwfilelog.read and kwexpand |
145 c = context.filectx(self.repo, path, fileid=fnode) |
145 c = self.repo.filectx(path, fileid=fnode) |
146 return c.node() |
146 return c.node() |
147 |
147 |
148 def substitute(self, data, path, node, subfunc): |
148 def substitute(self, data, path, node, subfunc): |
149 '''Replaces keywords in data with expanded template.''' |
149 '''Replaces keywords in data with expanded template.''' |
150 def kwsub(mobj): |
150 def kwsub(mobj): |