comparison mercurial/templater.py @ 18970:3cdb6f2f6789

templatekw: add default styles for hybrid types (issue3887) This allows elements like file_copies to be printed as 'name (source)' when used with join.
author Matt Mackall <mpm@selenic.com>
date Tue, 16 Apr 2013 09:44:29 -0500
parents 74ea61318ea8
children d8d548d868d3
comparison
equal deleted inserted replaced
18969:257afe5489d4 18970:3cdb6f2f6789
226 # i18n: "join" is a keyword 226 # i18n: "join" is a keyword
227 raise error.ParseError(_("join expects one or two arguments")) 227 raise error.ParseError(_("join expects one or two arguments"))
228 228
229 joinset = args[0][0](context, mapping, args[0][1]) 229 joinset = args[0][0](context, mapping, args[0][1])
230 if util.safehasattr(joinset, '__call__'): 230 if util.safehasattr(joinset, '__call__'):
231 joinset = [x.values()[0] for x in joinset()] 231 jf = joinset.joinfmt
232 joinset = [jf(x) for x in joinset()]
232 233
233 joiner = " " 234 joiner = " "
234 if len(args) > 1: 235 if len(args) > 1:
235 joiner = args[1][0](context, mapping, args[1][1]) 236 joiner = args[1][0](context, mapping, args[1][1])
236 237