This is an archive of the discontinued Mercurial Phabricator instance.

httppeer: support protocol upgrade
ClosedPublic

Authored by indygreg on Apr 10 2018, 9:28 PM.

Details

Summary

With the new handshake defined and in place on the server, we can
now implement it on the client.

The HTTP handshake mechanism has been taught to add headers advertising
its support for the new capabilities response. Response handling
has been adjusted to allow CBOR responses through. And makepeer()
has been taught to instantiate a mutually supported peer.

The HTTPv2 peer class doesn't implement the full peer interface. So
HTTPv2 is not yet usable as a peer.

Like the server side, we support registering handlers for
different API services. This allows extensions to easily implement
API services and peers. A practical use case for this is to
provide a previous implementation of the experimental version 2
wire protocol to a future version of Mercurial. We know there will
be BC breaks after 4.6 ships. But someone could take the peer and
server code from 4.6, drop it in an extension, and allow its use
indefinitely.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

indygreg created this revision.Apr 10 2018, 9:28 PM
durin42 accepted this revision.Apr 11 2018, 12:54 PM
This revision is now accepted and ready to land.Apr 11 2018, 12:54 PM
This revision was automatically updated to reflect the committed changes.