templatekw: do not override in-core {obsolete} keyword
The extension version uses old API, which will be deprecated in Mercurial 4.8.
--- 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']))