# HG changeset patch # User Yuya Nishihara # Date 1533727294 -32400 # Node ID 2b885ca5afcca2662a216a6aea4d4a6c60ea6207 # Parent e69ff3ae758c2e7d8648ce9bb6f9eae57d28427e templatekw: do not override in-core {obsolete} keyword The extension version uses old API, which will be deprecated in Mercurial 4.8. diff -r e69ff3ae758c -r 2b885ca5afcc hgext3rd/evolve/templatekw.py --- a/hgext3rd/evolve/templatekw.py Mon Aug 13 12:55:10 2018 +0200 +++ b/hgext3rd/evolve/templatekw.py Wed Aug 08 20:21:34 2018 +0900 @@ -26,13 +26,15 @@ ### template keywords # XXX it does not handle troubles well :-/ -@eh.templatekw('obsolete') -def obsoletekw(repo, ctx, templ, **args): - """String. Whether the changeset is ``obsolete``. - """ - if ctx.obsolete(): - return 'obsolete' - return '' +if not util.safehasattr(templatekw, 'showobsolete'): + # hg < 4.2 + @eh.templatekw('obsolete') + def obsoletekw(repo, ctx, templ, **args): + """String. Whether the changeset is ``obsolete``. + """ + if ctx.obsolete(): + return 'obsolete' + return '' if util.safehasattr(templatekw, 'compatlist'): @eh.templatekw('troubles', requires=set(['ctx', 'templ']))