mercurial/templatefuncs.py
changeset 38267 fb874fc1d9b4
parent 38265 41ae9b3cbfb9
child 38285 8d6109b49b31
--- a/mercurial/templatefuncs.py	Wed Mar 21 12:06:18 2018 +0900
+++ b/mercurial/templatefuncs.py	Mon Mar 19 00:23:20 2018 +0900
@@ -291,13 +291,10 @@
         # i18n: "ifcontains" is a keyword
         raise error.ParseError(_("ifcontains expects three or four arguments"))
 
-    haystack = evalfuncarg(context, mapping, args[1])
-    keytype = getattr(haystack, 'keytype', None)
+    haystack = evalwrapped(context, mapping, args[1])
     try:
         needle = evalrawexp(context, mapping, args[0])
-        needle = templateutil.unwrapastype(context, mapping, needle,
-                                           keytype or bytes)
-        found = (needle in haystack)
+        found = haystack.contains(context, mapping, needle)
     except error.ParseError:
         found = False