This is an archive of the discontinued Mercurial Phabricator instance.

wireproto: allow wire protocol commands to declare transport support
ClosedPublic

Authored by indygreg on Feb 27 2018, 6:49 PM.

Details

Summary

Currently, wire protocol commands are exposed on all transports.
Some wire protocol commands are only supported or sensical on some
transports. In the future, new wire protocol commands may only be
available on new transports and legacy wire protocol commands may
not be available to newer transports.

This commit introduces a mechanism to allow @wireprotocommand to
declare transports for which they should not be available. The
mechanism for determining if a wire protocol command is available
for a given transport instance has been taught to take this knowledge
into account.

To help implement this feature, we add a dict to wireprototypes
declaring all wire transports and their metadata. There's probably
room to refactor the constants used to identify the wire protocols.
But that can be in another commit.

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.Feb 27 2018, 6:49 PM
durin42 added a subscriber: durin42.Mar 1 2018, 4:49 PM
durin42 added inline comments.
mercurial/wireproto.py
669–673

These feel vaguely orthogonal? Some are proto versions (that only apply to ssh?)

indygreg updated this revision to Diff 6332.Mar 2 2018, 9:50 AM
durin42 accepted this revision.Mar 2 2018, 7:04 PM
This revision is now accepted and ready to land.Mar 2 2018, 7:04 PM
This revision was automatically updated to reflect the committed changes.