comparison hgext3rd/evolve/templatekw.py @ 5059:98c15ea18302

templatekw: use literal set syntax According to https://www.mercurial-scm.org/wiki/SupportedPythonVersions, we don't support Python 2.6 since 4.3.
author Anton Shestakov <av6@dwimlabs.net>
date Tue, 07 Jan 2020 16:05:44 +0700
parents 48b30ff742cb
children d684c6d73374
comparison
equal deleted inserted replaced
5058:c95e68e8a219 5059:98c15ea18302
22 eh = exthelper.exthelper() 22 eh = exthelper.exthelper()
23 23
24 ### template keywords 24 ### template keywords
25 25
26 if util.safehasattr(templatekw, 'compatlist'): 26 if util.safehasattr(templatekw, 'compatlist'):
27 @eh.templatekeyword(b'instabilities', requires=set([b'ctx', b'templ'])) 27 @eh.templatekeyword(b'instabilities', requires={b'ctx', b'templ'})
28 def showinstabilities(context, mapping): 28 def showinstabilities(context, mapping):
29 """List of strings. Evolution instabilities affecting the changeset 29 """List of strings. Evolution instabilities affecting the changeset
30 (zero or more of "orphan", "content-divergent" or "phase-divergent").""" 30 (zero or more of "orphan", "content-divergent" or "phase-divergent")."""
31 ctx = context.resource(mapping, b'ctx') 31 ctx = context.resource(mapping, b'ctx')
32 return templatekw.compatlist(context, mapping, b'instability', 32 return templatekw.compatlist(context, mapping, b'instability',
33 ctx.instabilities(), 33 ctx.instabilities(),
34 plural=b'instabilities') 34 plural=b'instabilities')
35 35
36 @eh.templatekeyword(b'troubles', requires=set([b'ctx', b'templ'])) 36 @eh.templatekeyword(b'troubles', requires={b'ctx', b'templ'})
37 def showtroubles(context, mapping): # legacy name for instabilities 37 def showtroubles(context, mapping): # legacy name for instabilities
38 ctx = context.resource(mapping, b'ctx') 38 ctx = context.resource(mapping, b'ctx')
39 return templatekw.compatlist(context, mapping, b'trouble', 39 return templatekw.compatlist(context, mapping, b'trouble',
40 ctx.instabilities(), plural=b'troubles') 40 ctx.instabilities(), plural=b'troubles')
41 else: 41 else: