hgkw/keyword.py
changeset 714 1acf49264a06
parent 710 2f341cf2268d
child 715 0614ba0295f6
equal deleted inserted replaced
713:287137014488 714:1acf49264a06
   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):