comparison mercurial/templater.py @ 22844:1533e642262d

merge with stable
author Matt Mackall <mpm@selenic.com>
date Fri, 10 Oct 2014 12:15:46 -0500
parents d844e220792a b6531d806de8
children 3226ed457928
comparison
equal deleted inserted replaced
22841:18b3869179f9 22844:1533e642262d
328 item = stringify(args[0][0](context, mapping, args[0][1])) 328 item = stringify(args[0][0](context, mapping, args[0][1]))
329 items = args[1][0](context, mapping, args[1][1]) 329 items = args[1][0](context, mapping, args[1][1])
330 330
331 # Iterating over items gives a formatted string, so we iterate 331 # Iterating over items gives a formatted string, so we iterate
332 # directly over the raw values. 332 # directly over the raw values.
333 if item in [i.values()[0] for i in items()]: 333 if ((callable(items) and item in [i.values()[0] for i in items()]) or
334 (isinstance(items, str) and item in items)):
334 yield _evalifliteral(args[2], context, mapping) 335 yield _evalifliteral(args[2], context, mapping)
335 elif len(args) == 4: 336 elif len(args) == 4:
336 yield _evalifliteral(args[3], context, mapping) 337 yield _evalifliteral(args[3], context, mapping)
337 338
338 def ifeq(context, mapping, args): 339 def ifeq(context, mapping, args):