Mercurial > forks > mercurial
changeset 53240:481703065b70
wireprototypes: drop the unused `indefinitebytestringresponse` class
This was part of wire protocol V2, which bitrotted and was removed.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Tue, 29 Apr 2025 17:48:30 -0400 |
parents | d0d0cb739136 |
children | 36e303062cf4 |
files | mercurial/wireprotoframing.py mercurial/wireprototypes.py |
diffstat | 2 files changed, 3 insertions(+), 32 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/wireprotoframing.py Tue Apr 29 17:45:58 2025 -0400 +++ b/mercurial/wireprotoframing.py Tue Apr 29 17:48:30 2025 -0400 @@ -33,7 +33,6 @@ encoding, error, util, - wireprototypes, ) from .utils import ( cborutil, @@ -1275,20 +1274,10 @@ # TODO consider extracting the content normalization to a # standalone function, as it may be useful for e.g. cachers. - if 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): - for frame in emitter.send(chunk): - yield frame + for chunk in cborutil.streamencode(o): + for frame in emitter.send(chunk): + yield frame except Exception as e: for frame in createerrorframe(
--- a/mercurial/wireprototypes.py Tue Apr 29 17:45:58 2025 -0400 +++ b/mercurial/wireprototypes.py Tue Apr 29 17:48:30 2025 -0400 @@ -6,7 +6,6 @@ from __future__ import annotations import abc -import typing from typing import ( Protocol, @@ -17,12 +16,6 @@ hex, ) from .i18n import _ -from .thirdparty import attr - -# Force pytype to use the non-vendored package -if typing.TYPE_CHECKING: - # noinspection PyPackageRequirements - import attr from . import ( error, @@ -421,14 +414,3 @@ ) return compengines - - [email protected] -class indefinitebytestringresponse: - """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()