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