changeset 53238:b09ae3ab76be

wireprototypes: drop the unused `encodedresponse` class This was part of wire protocol V2, which bitrotted and was removed. Likely the interface where the documentation changes were made here can also go, but whittle away one thing at a time.
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 29 Apr 2025 17:40:37 -0400
parents 1951f36f0327
children d0d0cb739136
files mercurial/interfaces/repository.py mercurial/wireprotoframing.py mercurial/wireprototypes.py
diffstat 3 files changed, 3 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/interfaces/repository.py	Wed Apr 30 02:15:23 2025 +0200
+++ b/mercurial/interfaces/repository.py	Tue Apr 29 17:40:37 2025 -0400
@@ -2321,9 +2321,7 @@
     caching native Python objects in memory or has a way of reconstructing
     the original Python objects, implementations typically call this function
     to produce bytes from the output objects and then store those bytes in
-    the cache. When it comes time to re-emit those bytes, they are wrapped
-    in a ``wireprototypes.encodedresponse`` instance to tell the output
-    layer that they are pre-encoded.
+    the cache.
 
     When receiving the objects emitted by the command function, instances
     can choose what to do with those objects. The simplest thing to do is
@@ -2339,9 +2337,7 @@
     When caching objects, typically the encoded form of the object will
     be stored. Keep in mind that if the original object is forwarded to
     the output layer, it will need to be encoded there as well. For large
-    output, this redundant encoding could add overhead. Implementations
-    could wrap the encoded object data in ``wireprototypes.encodedresponse``
-    instances to avoid this overhead.
+    output, this redundant encoding could add overhead.
     """
 
     @abc.abstractmethod
--- a/mercurial/wireprotoframing.py	Wed Apr 30 02:15:23 2025 +0200
+++ b/mercurial/wireprotoframing.py	Tue Apr 29 17:40:37 2025 -0400
@@ -1344,12 +1344,7 @@
                     # TODO consider extracting the content normalization to a
                     # standalone function, as it may be useful for e.g. cachers.
 
-                    # A pre-encoded object is sent directly to the emitter.
-                    if isinstance(o, wireprototypes.encodedresponse):
-                        for frame in emitter.send(o.data):
-                            yield frame
-
-                    elif isinstance(
+                    if isinstance(
                         o, wireprototypes.indefinitebytestringresponse
                     ):
                         for chunk in cborutil.streamencodebytestringfromiter(
--- a/mercurial/wireprototypes.py	Wed Apr 30 02:15:23 2025 +0200
+++ b/mercurial/wireprototypes.py	Tue Apr 29 17:40:37 2025 -0400
@@ -424,20 +424,6 @@
 
 
 @attr.s
-class encodedresponse:
-    """Represents response data that is already content encoded.
-
-    Wire protocol version 2 only.
-
-    Commands typically emit Python objects that are encoded and sent over the
-    wire. If commands emit an object of this type, the encoding step is bypassed
-    and the content from this object is used instead.
-    """
-
-    data = attr.ib()
-
-
[email protected]
 class alternatelocationresponse:
     """Represents a response available at an alternate location.