hgkw/keyword.py
branchstable
changeset 1353 b420a21eb9e5
parent 1316 c7c23e04673e
child 1354 d8c31683af2e
equal deleted inserted replaced
1351:49bef9bfeb50 1353:b420a21eb9e5
   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)