##// END OF EJS Templates
templater: show slightly better hint on map operation error...
Yuya Nishihara -
r38290:4b0f39e7 default
parent child Browse files
Show More
@@ -753,14 +753,22 b' def _iteroverlaymaps(context, origmappin'
753 lm['index'] = i
753 lm['index'] = i
754 yield lm
754 yield lm
755
755
756 def _applymap(context, mapping, d, targ):
756 def _applymap(context, mapping, d, darg, targ):
757 for lm in _iteroverlaymaps(context, mapping, d.itermaps(context)):
757 try:
758 diter = d.itermaps(context)
759 except error.ParseError as err:
760 sym = findsymbolicname(darg)
761 if not sym:
762 raise
763 hint = _("keyword '%s' does not support map operation") % sym
764 raise error.ParseError(bytes(err), hint=hint)
765 for lm in _iteroverlaymaps(context, mapping, diter):
758 yield evalrawexp(context, lm, targ)
766 yield evalrawexp(context, lm, targ)
759
767
760 def runmap(context, mapping, data):
768 def runmap(context, mapping, data):
761 darg, targ = data
769 darg, targ = data
762 d = evalwrapped(context, mapping, darg)
770 d = evalwrapped(context, mapping, darg)
763 return mappedgenerator(_applymap, args=(mapping, d, targ))
771 return mappedgenerator(_applymap, args=(mapping, d, darg, targ))
764
772
765 def runmember(context, mapping, data):
773 def runmember(context, mapping, data):
766 darg, memb = data
774 darg, memb = data
@@ -3213,6 +3213,7 b' Test new-style inline templating:'
3213
3213
3214 $ hg log -R latesttag -r tip -T '{rev % "a"}\n'
3214 $ hg log -R latesttag -r tip -T '{rev % "a"}\n'
3215 hg: parse error: 11 is not iterable of mappings
3215 hg: parse error: 11 is not iterable of mappings
3216 (keyword 'rev' does not support map operation)
3216 [255]
3217 [255]
3217 $ hg log -R latesttag -r tip -T '{get(extras, "unknown") % "a"}\n'
3218 $ hg log -R latesttag -r tip -T '{get(extras, "unknown") % "a"}\n'
3218 hg: parse error: None is not iterable of mappings
3219 hg: parse error: None is not iterable of mappings
General Comments 0
You need to be logged in to leave comments. Login now