hgext3rd/evolve/templatekw.py
changeset 3973 1094e56d369a
parent 3941 2b885ca5afcc
child 3974 fe5fd6509930
equal deleted inserted replaced
3972:f715dcea5086 3973:1094e56d369a
    23 
    23 
    24 eh = exthelper.exthelper()
    24 eh = exthelper.exthelper()
    25 
    25 
    26 ### template keywords
    26 ### template keywords
    27 # XXX it does not handle troubles well :-/
    27 # XXX it does not handle troubles well :-/
    28 
       
    29 if not util.safehasattr(templatekw, 'showobsolete'):
       
    30     # hg < 4.2
       
    31     @eh.templatekw('obsolete')
       
    32     def obsoletekw(repo, ctx, templ, **args):
       
    33         """String. Whether the changeset is ``obsolete``.
       
    34         """
       
    35         if ctx.obsolete():
       
    36             return 'obsolete'
       
    37         return ''
       
    38 
    28 
    39 if util.safehasattr(templatekw, 'compatlist'):
    29 if util.safehasattr(templatekw, 'compatlist'):
    40     @eh.templatekw('troubles', requires=set(['ctx', 'templ']))
    30     @eh.templatekw('troubles', requires=set(['ctx', 'templ']))
    41     def showtroubles(context, mapping):
    31     def showtroubles(context, mapping):
    42         ctx = context.resource(mapping, 'ctx')
    32         ctx = context.resource(mapping, 'ctx')