hgkw/keyword.py
branch0.9.2compat
changeset 477 03268523c017
parent 464 509fbcac51c7
child 478 a3b8a3a03cc7
equal deleted inserted replaced
464:509fbcac51c7 477:03268523c017
    83         cause rejects if the patch context contains an active keyword.
    83         cause rejects if the patch context contains an active keyword.
    84         In that case run "hg kwshrink", and then reimport.
    84         In that case run "hg kwshrink", and then reimport.
    85         Or, better, use bundle/unbundle to share changes.
    85         Or, better, use bundle/unbundle to share changes.
    86 '''
    86 '''
    87 
    87 
    88 from mercurial import commands, cmdutil, context, fancyopts, filelog
    88 from mercurial import commands, cmdutil, fancyopts, filelog
    89 from mercurial import localrepo, patch, revlog, templater, util
    89 from mercurial import localrepo, patch, revlog, templater, util
    90 from mercurial.node import nullid, hex
    90 from mercurial.node import nullid, hex
    91 from mercurial.i18n import gettext as _
    91 from mercurial.i18n import gettext as _
    92 import getopt, os, re, shutil, tempfile, time
    92 import getopt, os, re, shutil, tempfile, time
    93 
    93 
   280                                                False, None, '', False)
   280                                                False, None, '', False)
   281 
   281 
   282     def getnode(self, path, fnode):
   282     def getnode(self, path, fnode):
   283         '''Derives changenode from file path and filenode.'''
   283         '''Derives changenode from file path and filenode.'''
   284         # used by kwfilelog.read and kwexpand
   284         # used by kwfilelog.read and kwexpand
   285         c = context.filectx(self.repo, path, fileid=fnode)
   285         c = self.repo.filectx(path, fileid=fnode)
   286         return c.node()
   286         return c.node()
   287 
   287 
   288     def substitute(self, data, path, node, subfunc):
   288     def substitute(self, data, path, node, subfunc):
   289         '''Replaces keywords in data with expanded template.'''
   289         '''Replaces keywords in data with expanded template.'''
   290         def kwsub(mobj):
   290         def kwsub(mobj):