mercurial/templatekw.py
changeset 31807 e6eb86b154c5
parent 31699 568c4e7437b2
child 31850 f0d719e513fc
equal deleted inserted replaced
31806:8f203b491bb5 31807:e6eb86b154c5
     5 # This software may be used and distributed according to the terms of the
     5 # This software may be used and distributed according to the terms of the
     6 # GNU General Public License version 2 or any later version.
     6 # GNU General Public License version 2 or any later version.
     7 
     7 
     8 from __future__ import absolute_import
     8 from __future__ import absolute_import
     9 
     9 
       
    10 from .i18n import _
    10 from .node import hex, nullid
    11 from .node import hex, nullid
    11 from . import (
    12 from . import (
    12     encoding,
    13     encoding,
    13     error,
    14     error,
    14     hbisect,
    15     hbisect,
   420     elif ctx.closesbranch():
   421     elif ctx.closesbranch():
   421         return '_'
   422         return '_'
   422     else:
   423     else:
   423         return 'o'
   424         return 'o'
   424 
   425 
       
   426 @templatekeyword('index')
       
   427 def showindex(**args):
       
   428     """Integer. The current iteration of the loop. (0 indexed)"""
       
   429     # just hosts documentation; should be overridden by template mapping
       
   430     raise error.Abort(_("can't use index in this context"))
       
   431 
   425 @templatekeyword('latesttag')
   432 @templatekeyword('latesttag')
   426 def showlatesttag(**args):
   433 def showlatesttag(**args):
   427     """List of strings. The global tags on the most recent globally
   434     """List of strings. The global tags on the most recent globally
   428     tagged ancestor of this changeset.
   435     tagged ancestor of this changeset.
   429     """
   436     """