--- a/hgext3rd/evolve/templatekw.py Sat Mar 07 01:36:33 2020 +0700
+++ b/hgext3rd/evolve/templatekw.py Sat Mar 07 01:43:40 2020 +0700
@@ -22,36 +22,20 @@
### template keywords
-if util.safehasattr(templatekw, 'compatlist'):
- @eh.templatekeyword(b'instabilities', requires={b'ctx', b'templ'})
- def showinstabilities(context, mapping):
- """List of strings. Evolution instabilities affecting the changeset
- (zero or more of "orphan", "content-divergent" or "phase-divergent")."""
- ctx = context.resource(mapping, b'ctx')
- return templatekw.compatlist(context, mapping, b'instability',
- ctx.instabilities(),
- plural=b'instabilities')
+@eh.templatekeyword(b'instabilities', requires={b'ctx', b'templ'})
+def showinstabilities(context, mapping):
+ """List of strings. Evolution instabilities affecting the changeset
+ (zero or more of "orphan", "content-divergent" or "phase-divergent")."""
+ ctx = context.resource(mapping, b'ctx')
+ return templatekw.compatlist(context, mapping, b'instability',
+ ctx.instabilities(),
+ plural=b'instabilities')
- @eh.templatekeyword(b'troubles', requires={b'ctx', b'templ'})
- def showtroubles(context, mapping): # legacy name for instabilities
- ctx = context.resource(mapping, b'ctx')
- return templatekw.compatlist(context, mapping, b'trouble',
- ctx.instabilities(), plural=b'troubles')
-else:
- # older template API in hg < 4.6
- @eh.templatekeyword(b'instabilities')
- def showinstabilities(**args):
- """List of strings. Evolution instabilities affecting the changeset
- (zero or more of "orphan", "content-divergent" or "phase-divergent")."""
- ctx = args[b'ctx']
- return templatekw.showlist(b'instability', ctx.instabilities(), args,
- plural=b'instabilities')
-
- @eh.templatekeyword(b'troubles')
- def showtroubles(**args):
- ctx = args[b'ctx']
- return templatekw.showlist(b'trouble', ctx.instabilities(), args,
- plural=b'troubles')
+@eh.templatekeyword(b'troubles', requires={b'ctx', b'templ'})
+def showtroubles(context, mapping): # legacy name for instabilities
+ ctx = context.resource(mapping, b'ctx')
+ return templatekw.compatlist(context, mapping, b'trouble',
+ ctx.instabilities(), plural=b'troubles')
_sp = templatekw.showpredecessors
if util.safehasattr(_sp, '_requires'):