hgext/keyword.py
changeset 10894 26cf11f9f322
parent 10844 6722ba3bf80b
child 10967 479f15f3faa9
equal deleted inserted replaced
10893:468876bc3885 10894:26cf11f9f322
   138 
   138 
   139     def substitute(self, data, path, ctx, subfunc):
   139     def substitute(self, data, path, ctx, subfunc):
   140         '''Replaces keywords in data with expanded template.'''
   140         '''Replaces keywords in data with expanded template.'''
   141         def kwsub(mobj):
   141         def kwsub(mobj):
   142             kw = mobj.group(1)
   142             kw = mobj.group(1)
   143             self.ct = cmdutil.changeset_templater(self.ui, self.repo,
   143             ct = cmdutil.changeset_templater(self.ui, self.repo,
   144                                                   False, None, '', False)
   144                                              False, None, '', False)
   145             self.ct.use_template(self.templates[kw])
   145             ct.use_template(self.templates[kw])
   146             self.ui.pushbuffer()
   146             self.ui.pushbuffer()
   147             self.ct.show(ctx, root=self.repo.root, file=path)
   147             ct.show(ctx, root=self.repo.root, file=path)
   148             ekw = templatefilters.firstline(self.ui.popbuffer())
   148             ekw = templatefilters.firstline(self.ui.popbuffer())
   149             return '$%s: %s $' % (kw, ekw)
   149             return '$%s: %s $' % (kw, ekw)
   150         return subfunc(kwsub, data)
   150         return subfunc(kwsub, data)
   151 
   151 
   152     def expand(self, path, node, data):
   152     def expand(self, path, node, data):