hgkw/keyword.py
changeset 1356 d9c3f8002e7c
parent 1354 d8c31683af2e
child 1357 a9e00192f30a
equal deleted inserted replaced
1352:9dcd045229b4 1356:d9c3f8002e7c
   215 
   215 
   216     def substitute(self, data, path, ctx, subfunc):
   216     def substitute(self, data, path, ctx, subfunc):
   217         '''Replaces keywords in data with expanded template.'''
   217         '''Replaces keywords in data with expanded template.'''
   218         def kwsub(mobj):
   218         def kwsub(mobj):
   219             kw = mobj.group(1)
   219             kw = mobj.group(1)
   220             ct = cmdutil.changeset_templater(self.ui, self.repo,
   220             ct = cmdutil.changeset_templater(self.ui, self.repo, False, None,
   221                                              False, None, '', False)
   221                                              self.templates[kw], '', False)
   222             ct.use_template(self.templates[kw])
       
   223             self.ui.pushbuffer()
   222             self.ui.pushbuffer()
   224             ct.show(ctx, root=self.repo.root, file=path)
   223             ct.show(ctx, root=self.repo.root, file=path)
   225             ekw = templatefilters.firstline(self.ui.popbuffer())
   224             ekw = templatefilters.firstline(self.ui.popbuffer())
   226             return '$%s: %s $' % (kw, ekw)
   225             return '$%s: %s $' % (kw, ekw)
   227         return subfunc(kwsub, data)
   226         return subfunc(kwsub, data)