comparison mercurial/wireprotoframing.py @ 51700:7f0cb9ee0534

Backout accidental publication of a large range of revisions I accidentally published 25e7f9dcad0f::bd1483fd7088, this is the inverse.
author Raphaël Gomès <rgomes@octobus.net>
date Tue, 23 Jul 2024 10:02:46 +0200
parents 493034cc3265
children ca7bde5dbafb
comparison
equal deleted inserted replaced
51699:bd1483fd7088 51700:7f0cb9ee0534
544 formatters to be applied at rendering time. In terms of the ``ui`` 544 formatters to be applied at rendering time. In terms of the ``ui``
545 class, each atom corresponds to a ``ui.write()``. 545 class, each atom corresponds to a ``ui.write()``.
546 """ 546 """
547 atomdicts = [] 547 atomdicts = []
548 548
549 for formatting, args, labels in atoms: 549 for (formatting, args, labels) in atoms:
550 # TODO look for localstr, other types here? 550 # TODO look for localstr, other types here?
551 551
552 if not isinstance(formatting, bytes): 552 if not isinstance(formatting, bytes):
553 raise ValueError(b'must use bytes formatting strings') 553 raise ValueError(b'must use bytes formatting strings')
554 for arg in args: 554 for arg in args:
1196 stream, 1196 stream,
1197 requestid, 1197 requestid,
1198 b'%s' % stringutil.forcebytestr(e), 1198 b'%s' % stringutil.forcebytestr(e),
1199 errtype=b'server', 1199 errtype=b'server',
1200 ): 1200 ):
1201
1201 yield frame 1202 yield frame
1202 1203
1203 break 1204 break
1204 1205
1205 try: 1206 try:
1256 o, wireprototypes.indefinitebytestringresponse 1257 o, wireprototypes.indefinitebytestringresponse
1257 ): 1258 ):
1258 for chunk in cborutil.streamencodebytestringfromiter( 1259 for chunk in cborutil.streamencodebytestringfromiter(
1259 o.chunks 1260 o.chunks
1260 ): 1261 ):
1262
1261 for frame in emitter.send(chunk): 1263 for frame in emitter.send(chunk):
1262 yield frame 1264 yield frame
1263 1265
1264 # A regular object is CBOR encoded. 1266 # A regular object is CBOR encoded.
1265 else: 1267 else: