This is an archive of the discontinued Mercurial Phabricator instance.

wireproto: define and expose types of wire command arguments
ClosedPublic

Authored by indygreg on Apr 9 2018, 2:58 PM.

Details

Summary

Exposing the set of argument names is cool. But with wire protocol
version 2, we're using CBOR to transport arguments and this allows us
to have typing for arguments.

Typed arguments are much nicer because they will cut down on transfer
overhead and processing overhead for decoding values.

This commit teaches @wireprotocommand to accept a dictionary for
arguments. The arguments registered for version 2 transports are
canonically stored as dictionaries rather than a space-delimited string.

It is an error to defined arguments with a dictionary for commands using
version 1 transports. This reinforces my intent to fully decouple command
handlers for version 2 transports.

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 9 2018, 2:58 PM
durin42 accepted this revision.Apr 9 2018, 6:28 PM
This revision is now accepted and ready to land.Apr 9 2018, 6:28 PM
This revision was automatically updated to reflect the committed changes.