mercurial/templatekw.py
changeset 40476 539efc88513b
parent 40474 2891ee3fcb86
child 40477 592feb3f88b1
equal deleted inserted replaced
40475:8fa26f3baf30 40476:539efc88513b
   689 
   689 
   690         data.append({'successors': successors, 'markers': finalmarkers})
   690         data.append({'successors': successors, 'markers': finalmarkers})
   691 
   691 
   692     return templateutil.mappinglist(data)
   692     return templateutil.mappinglist(data)
   693 
   693 
       
   694 @templatekeyword('p1', requires={'ctx'})
       
   695 def showp1(context, mapping):
       
   696     """Changeset. The changeset's first parent. ``{p1.rev}`` for the revision
       
   697     number, and ``{p1.node}`` for the identification hash."""
       
   698     ctx = context.resource(mapping, 'ctx')
       
   699     return templateutil.mappingdict({'ctx': ctx.p1()}, tmpl=_changeidtmpl)
       
   700 
       
   701 @templatekeyword('p2', requires={'ctx'})
       
   702 def showp2(context, mapping):
       
   703     """Changeset. The changeset's second parent. ``{p2.rev}`` for the revision
       
   704     number, and ``{p2.node}`` for the identification hash."""
       
   705     ctx = context.resource(mapping, 'ctx')
       
   706     return templateutil.mappingdict({'ctx': ctx.p2()}, tmpl=_changeidtmpl)
       
   707 
   694 @templatekeyword('p1rev', requires={'ctx'})
   708 @templatekeyword('p1rev', requires={'ctx'})
   695 def showp1rev(context, mapping):
   709 def showp1rev(context, mapping):
   696     """Integer. The repository-local revision number of the changeset's
   710     """Integer. The repository-local revision number of the changeset's
   697     first parent, or -1 if the changeset has no parents."""
   711     first parent, or -1 if the changeset has no parents."""
   698     ctx = context.resource(mapping, 'ctx')
   712     ctx = context.resource(mapping, 'ctx')