mercurial/cmdutil.py
changeset 26435 882b170ae616
parent 26433 3ad41638b4b4
child 26510 77c13f3c01ca
equal deleted inserted replaced
26434:0a823de8d7b7 26435:882b170ae616
  1426             self.footer += templater.stringify(self.t(self._parts['docfooter']))
  1426             self.footer += templater.stringify(self.t(self._parts['docfooter']))
  1427         return super(changeset_templater, self).close()
  1427         return super(changeset_templater, self).close()
  1428 
  1428 
  1429     def _show(self, ctx, copies, matchfn, props):
  1429     def _show(self, ctx, copies, matchfn, props):
  1430         '''show a single changeset or file revision'''
  1430         '''show a single changeset or file revision'''
  1431 
       
  1432         showlist = templatekw.showlist
       
  1433 
       
  1434         # showparents() behavior depends on ui trace level which
       
  1435         # causes unexpected behaviors at templating level and makes
       
  1436         # it harder to extract it in a standalone function. Its
       
  1437         # behavior cannot be changed so leave it here for now.
       
  1438         def showparents(**args):
       
  1439             ctx = args['ctx']
       
  1440             parents = [[('rev', p.rev()),
       
  1441                         ('node', p.hex()),
       
  1442                         ('phase', p.phasestr())]
       
  1443                        for p in scmutil.meaningfulparents(self.repo, ctx)]
       
  1444             return showlist('parent', parents, **args)
       
  1445 
       
  1446         props = props.copy()
  1431         props = props.copy()
  1447         props.update(templatekw.keywords)
  1432         props.update(templatekw.keywords)
  1448         props['parents'] = showparents
       
  1449         props['templ'] = self.t
  1433         props['templ'] = self.t
  1450         props['ctx'] = ctx
  1434         props['ctx'] = ctx
  1451         props['repo'] = self.repo
  1435         props['repo'] = self.repo
  1452         props['revcache'] = {'copies': copies}
  1436         props['revcache'] = {'copies': copies}
  1453         props['cache'] = self.cache
  1437         props['cache'] = self.cache