mercurial/templatefuncs.py
changeset 37163 0fb28899e81a
parent 37015 a318bb154d42
child 37210 2a2ce93e12f4
--- a/mercurial/templatefuncs.py	Fri Mar 23 20:34:12 2018 +0900
+++ b/mercurial/templatefuncs.py	Fri Mar 23 20:43:55 2018 +0900
@@ -34,7 +34,6 @@
 evalinteger = templateutil.evalinteger
 evalstring = templateutil.evalstring
 evalstringliteral = templateutil.evalstringliteral
-evalastype = templateutil.evalastype
 
 # dict of template built-in functions
 funcs = {}
@@ -261,9 +260,10 @@
         raise error.ParseError(_("ifcontains expects three or four arguments"))
 
     haystack = evalfuncarg(context, mapping, args[1])
+    keytype = getattr(haystack, 'keytype', None)
     try:
-        needle = evalastype(context, mapping, args[0],
-                            getattr(haystack, 'keytype', None) or bytes)
+        needle = evalrawexp(context, mapping, args[0])
+        needle = templateutil.unwrapastype(needle, keytype or bytes)
         found = (needle in haystack)
     except error.ParseError:
         found = False