comparison mercurial/templatekw.py @ 36574:45f149bf08d1

templatekw: fix dict construction in _showlist to not mix bytes and strs What we had was fine on Python 2, but was slightly wrong on Python 3. This works on both. Differential Revision: https://phab.mercurial-scm.org/D2554
author Augie Fackler <augie@google.com>
date Fri, 02 Mar 2018 09:09:38 -0500
parents c3692364b344
children 0083e373e5f5
comparison
equal deleted inserted replaced
36573:9b6b02a5b589 36574:45f149bf08d1
203 if name not in templ: 203 if name not in templ:
204 if isinstance(values[0], bytes): 204 if isinstance(values[0], bytes):
205 yield separator.join(values) 205 yield separator.join(values)
206 else: 206 else:
207 for v in values: 207 for v in values:
208 yield dict(v, **strmapping) 208 r = dict(v)
209 r.update(mapping)
210 yield r
209 return 211 return
210 startname = 'start_' + plural 212 startname = 'start_' + plural
211 if startname in templ: 213 if startname in templ:
212 yield templ(startname, **strmapping) 214 yield templ(startname, **strmapping)
213 vmapping = mapping.copy() 215 vmapping = mapping.copy()