hgext/keyword.py
changeset 32837 50586a0a946f
parent 32375 04baab18d60a
child 32935 69d1c3ea0d6f
equal deleted inserted replaced
32836:29558247b00e 32837:50586a0a946f
   237 
   237 
   238     def substitute(self, data, path, ctx, subfunc):
   238     def substitute(self, data, path, ctx, subfunc):
   239         '''Replaces keywords in data with expanded template.'''
   239         '''Replaces keywords in data with expanded template.'''
   240         def kwsub(mobj):
   240         def kwsub(mobj):
   241             kw = mobj.group(1)
   241             kw = mobj.group(1)
   242             ct = cmdutil.changeset_templater(self.ui, self.repo, False, None,
   242             ct = cmdutil.makelogtemplater(self.ui, self.repo,
   243                                              self.templates[kw], '', False)
   243                                           self.templates[kw])
   244             self.ui.pushbuffer()
   244             self.ui.pushbuffer()
   245             ct.show(ctx, root=self.repo.root, file=path)
   245             ct.show(ctx, root=self.repo.root, file=path)
   246             ekw = templatefilters.firstline(self.ui.popbuffer())
   246             ekw = templatefilters.firstline(self.ui.popbuffer())
   247             return '$%s: %s $' % (kw, ekw)
   247             return '$%s: %s $' % (kw, ekw)
   248         return subfunc(kwsub, data)
   248         return subfunc(kwsub, data)