This is an archive of the discontinued Mercurial Phabricator instance.

debugcommands: allow sending of simple commands with debugwireproto
ClosedPublic

Authored by indygreg on Feb 23 2018, 2:01 PM.

Details

Summary

Previously, we only had support for low-level "raw" operations.

A goal of hg debugwireproto is to allow easily performing
higher-level primitives, such as sending a wire protocol command
and reading its response.

We implement a "command" action that does just this.

Currently, we only support simple commands (those without payloads).
We have basic support for sending command arguments. We don't yet
support sending dictionary arguments. This will be implemented later.

To prove it works, we add tests to test-ssh-proto.t that send some
"listkeys" commands.

Note: we don't observe/report os.read() events because these may not be
deterministic. We instead observe/report the read() and readline()
operations on the bufferedinputpipe. These *should* be deterministic.

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 23 2018, 2:01 PM
indygreg edited the summary of this revision. (Show Details)Feb 23 2018, 3:51 PM
indygreg updated this revision to Diff 6026.
indygreg updated this revision to Diff 6141.Feb 26 2018, 4:16 PM
indygreg updated this revision to Diff 6252.Mar 1 2018, 11:30 AM
durin42 accepted this revision.Mar 1 2018, 4:37 PM
This revision is now accepted and ready to land.Mar 1 2018, 4:37 PM
This revision was automatically updated to reflect the committed changes.