##// END OF EJS Templates
templatekw: switch revset() to new API
Yuya Nishihara -
r36613:2da41410 default
parent child Browse files
Show More
@@ -903,12 +903,12 b' def showrev(context, mapping):'
903 ctx = context.resource(mapping, 'ctx')
903 ctx = context.resource(mapping, 'ctx')
904 return scmutil.intrev(ctx)
904 return scmutil.intrev(ctx)
905
905
906 def showrevslist(name, revs, **args):
906 def showrevslist(context, mapping, name, revs):
907 """helper to generate a list of revisions in which a mapped template will
907 """helper to generate a list of revisions in which a mapped template will
908 be evaluated"""
908 be evaluated"""
909 args = pycompat.byteskwargs(args)
909 repo = context.resource(mapping, 'repo')
910 repo = args['ctx'].repo()
910 templ = context.resource(mapping, 'templ')
911 f = _showlist(name, ['%d' % r for r in revs], args['templ'], args)
911 f = _showlist(name, ['%d' % r for r in revs], templ, mapping)
912 return _hybrid(f, revs,
912 return _hybrid(f, revs,
913 lambda x: {name: x, 'ctx': repo[x], 'revcache': {}},
913 lambda x: {name: x, 'ctx': repo[x], 'revcache': {}},
914 pycompat.identity, keytype=int)
914 pycompat.identity, keytype=int)
@@ -1129,12 +1129,7 b' def revset(context, mapping, args):'
1129 revs = query(raw)
1129 revs = query(raw)
1130 revs = list(revs)
1130 revs = list(revs)
1131 revsetcache[raw] = revs
1131 revsetcache[raw] = revs
1132
1132 return templatekw.showrevslist(context, mapping, "revision", revs)
1133 # TODO: pass (context, mapping) pair to keyword function
1134 props = context._resources.copy()
1135 props.update(mapping)
1136 return templatekw.showrevslist("revision", revs,
1137 **pycompat.strkwargs(props))
1138
1133
1139 @templatefunc('rstdoc(text, style)')
1134 @templatefunc('rstdoc(text, style)')
1140 def rstdoc(context, mapping, args):
1135 def rstdoc(context, mapping, args):
General Comments 0
You need to be logged in to leave comments. Login now