[PATCH 2 of 7 iterbatch] wireproto: document quirk of _callstream between http and ssh

Martin von Zweigbergk martinvonz at google.com
Tue Mar 8 18:54:57 EST 2016


On Mon, Mar 7, 2016 at 8:25 PM, Augie Fackler <raf at durin42.com> wrote:
> # HG changeset patch
> # User Augie Fackler <augie at google.com>
> # Date 1456946323 18000
> #      Wed Mar 02 14:18:43 2016 -0500
> # Node ID 071d05cce9156434dee4696287119f284631701b
> # Parent  5fd58c8c55d052c671a4725d01f27fb1c14353a9
> # EXP-Topic batch
> wireproto: document quirk of _callstream between http and ssh
>
> This tripped me up when trying to use it, so it feels like we should
> document this to avoid future pain.
>
> diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
> --- a/mercurial/wireproto.py
> +++ b/mercurial/wireproto.py
> @@ -396,9 +396,12 @@ class wirepeer(peer.peerrepository):
>      def _callstream(self, cmd, **args):
>          """execute <cmd> on the server
>
> -        The command is expected to return a stream.
> +        The command is expected to return a stream. Note that if the
> +        command doesn't return a stream, _callstream behaves
> +        differently for ssh and http peers.
>
> -        returns the server reply as a file like object."""
> +        returns the server reply as a file like object.
> +        """

I find the documentation very confusing, but that's mostly unrelated
to your patch. So the method is expected to return a stream, but it
doesn't have to? What does that mean? And is a "file like object" a
stream?

>          raise NotImplementedError()
>
>      def _callcompressable(self, cmd, **args):
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list