diff --git a/mercurial/wireprotoframing.py b/mercurial/wireprotoframing.py --- a/mercurial/wireprotoframing.py +++ b/mercurial/wireprotoframing.py @@ -1146,6 +1146,14 @@ for frame in emitter.send(o.data): yield frame + elif isinstance( + o, wireprototypes.indefinitebytestringresponse): + for chunk in cborutil.streamencodebytestringfromiter( + o.chunks): + + for frame in emitter.send(chunk): + yield frame + # A regular object is CBOR encoded. else: for chunk in cborutil.streamencode(o): diff --git a/mercurial/wireprototypes.py b/mercurial/wireprototypes.py --- a/mercurial/wireprototypes.py +++ b/mercurial/wireprototypes.py @@ -389,3 +389,12 @@ fullhashseed = attr.ib(default=None) serverdercerts = attr.ib(default=None) servercadercerts = attr.ib(default=None) + +@attr.s +class indefinitebytestringresponse(object): + """Represents an object to be encoded to an indefinite length bytestring. + + Instances are initialized from an iterable of chunks, with each chunk being + a bytes instance. + """ + chunks = attr.ib()