hgext/keyword.py
changeset 35888 c8e2d6ed1f9e
parent 35001 3fbc30f7b9f0
child 36607 c6061cadb400
equal deleted inserted replaced
35887:572f36e9a780 35888:c8e2d6ed1f9e
    99     dispatch,
    99     dispatch,
   100     error,
   100     error,
   101     extensions,
   101     extensions,
   102     filelog,
   102     filelog,
   103     localrepo,
   103     localrepo,
       
   104     logcmdutil,
   104     match,
   105     match,
   105     patch,
   106     patch,
   106     pathutil,
   107     pathutil,
   107     pycompat,
   108     pycompat,
   108     registrar,
   109     registrar,
   252 
   253 
   253     def substitute(self, data, path, ctx, subfunc):
   254     def substitute(self, data, path, ctx, subfunc):
   254         '''Replaces keywords in data with expanded template.'''
   255         '''Replaces keywords in data with expanded template.'''
   255         def kwsub(mobj):
   256         def kwsub(mobj):
   256             kw = mobj.group(1)
   257             kw = mobj.group(1)
   257             ct = cmdutil.makelogtemplater(self.ui, self.repo,
   258             ct = logcmdutil.maketemplater(self.ui, self.repo,
   258                                           self.templates[kw])
   259                                           self.templates[kw])
   259             self.ui.pushbuffer()
   260             self.ui.pushbuffer()
   260             ct.show(ctx, root=self.repo.root, file=path)
   261             ct.show(ctx, root=self.repo.root, file=path)
   261             ekw = templatefilters.firstline(self.ui.popbuffer())
   262             ekw = templatefilters.firstline(self.ui.popbuffer())
   262             return '$%s: %s $' % (kw, ekw)
   263             return '$%s: %s $' % (kw, ekw)