comparison mercurial/formatter.py @ 32159:0fd15522a848

py3: use pycompat.byteskwargs to converts kwargs to bytes baseformatter._item must contain both keys and values in bytes. So to make sure that, we convert the opts back to bytes.
author Pulkit Goyal <7895pulkit@gmail.com>
date Thu, 04 May 2017 01:12:14 +0530
parents 5b2241e84982
children 012e0da5b759
comparison
equal deleted inserted replaced
32158:89153b0d4881 32159:0fd15522a848
112 short, 112 short,
113 ) 113 )
114 114
115 from . import ( 115 from . import (
116 error, 116 error,
117 pycompat,
117 templatefilters, 118 templatefilters,
118 templatekw, 119 templatekw,
119 templater, 120 templater,
120 util, 121 util,
121 ) 122 )
176 def context(self, **ctxs): 177 def context(self, **ctxs):
177 '''insert context objects to be used to render template keywords''' 178 '''insert context objects to be used to render template keywords'''
178 pass 179 pass
179 def data(self, **data): 180 def data(self, **data):
180 '''insert data into item that's not shown in default output''' 181 '''insert data into item that's not shown in default output'''
182 data = pycompat.byteskwargs(data)
181 self._item.update(data) 183 self._item.update(data)
182 def write(self, fields, deftext, *fielddata, **opts): 184 def write(self, fields, deftext, *fielddata, **opts):
183 '''do default text output while assigning data to item''' 185 '''do default text output while assigning data to item'''
184 fieldkeys = fields.split() 186 fieldkeys = fields.split()
185 assert len(fieldkeys) == len(fielddata) 187 assert len(fieldkeys) == len(fielddata)