This is an archive of the discontinued Mercurial Phabricator instance.

wireproto: function for testing if wire protocol command is available
ClosedPublic

Authored by indygreg on Feb 1 2018, 6:37 PM.

Details

Summary

Currently, we perform simple membership testing for whether a wire
command is available. In the future, not all wire protocol commands
will be available on all transports. For example, a legacy transport
may not support newer commands.

In preparation of this, teach the protocol handlers to call into a
function to determine if a wire protocol command is available. That
function currently does membership testing like before, so behavior
should be identical.

In the case of the HTTP server, behavior is a bit wonkier. "cmd" is
used by both the wire protocol and hgweb. We do want the protocol
handler to handle requests for all commands that look like wire
protocol commands, even if they aren't available. Otherwise, the
fallback to hgweb would only confuse automated clients and make it
easier for hgweb to accidentally implement a "cmd" that is identical
to wire protocol commands (since they aren't centrally registered).

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 1 2018, 6:37 PM
indygreg updated this revision to Diff 5258.Feb 6 2018, 4:04 PM
durin42 accepted this revision.Feb 7 2018, 5:18 PM
This revision is now accepted and ready to land.Feb 7 2018, 5:18 PM
This revision was automatically updated to reflect the committed changes.