D3177: wireproto: crude support for version 2 HTTP peer
Josef 'Jeff' Sipek
jeffpc at josefsipek.net
Sat Apr 7 23:22:52 UTC 2018
On Sat, Apr 07, 2018 at 05:53:50 +0000, indygreg (Gregory Szorc) wrote:
> indygreg created this revision.
> Herald added a subscriber: mercurial-devel.
> Herald added a reviewer: hg-reviewers.
>
> REVISION SUMMARY
> As part of implementing the server-side bits of the wire protocol
> command handlers for version 2, we want a way to easily test those
This seems a bit confusing... is this wireproto2 or HTTP2?
(There are places in this diff with similar ambiguity.)
Jeff.
> commands. Currently, we use the "httprequest" action of `hg
> debugwireproto`. But this requires explicitly specifying the HTTP
> request headers, low-level frame details, and the data structure
> to encode with CBOR. That's a lot of boilerplate and a lot of it can
> change as the wire protocol evolves.
>
> `hg debugwireproto` has a mechanism to issue commands via the peer
> interface. That is *much* easier to use and we prefer to test with
> that going forward.
>
> This commit implements enough parts of the peer API to send basic
> requests via the HTTP version 2 transport.
>
> The peer code is super hacky. Again, the goal is to facilitate
> server testing, not robustly implement a client. The client code
> will receive love at a later time.
>
> REPOSITORY
> rHG Mercurial
>
> REVISION DETAIL
> https://phab.mercurial-scm.org/D3177
>
> AFFECTED FILES
> mercurial/debugcommands.py
> mercurial/httppeer.py
> tests/test-http-api-httpv2.t
> tests/test-http-protocol.t
> tests/wireprotohelpers.sh
>
> CHANGE DETAILS
>
> diff --git a/tests/wireprotohelpers.sh b/tests/wireprotohelpers.sh
> --- a/tests/wireprotohelpers.sh
> +++ b/tests/wireprotohelpers.sh
> @@ -5,6 +5,10 @@
> hg --verbose debugwireproto --peer raw http://$LOCALIP:$HGPORT/
> }
>
> +sendhttpv2peer() {
> + hg --verbose debugwireproto --peer http2 http://$LOCALIP:$HGPORT/
--
Only two things are infinite, the universe and human stupidity, and I'm not
sure about the former.
- Albert Einstein
More information about the Mercurial-devel
mailing list