Differences between revisions 5 and 6
Revision 5 as of 2009-05-19 19:30:56
Size: 696
Editor: localhost
Comment: converted to 1.6 markup
Revision 6 as of 2012-05-13 09:28:29
Size: 660
Editor: 62
Comment: Cleanup
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
Commands names are sent over the ssh pipe as plain text followed by newline. Arguments are sent as "[argname] [value length]\n" followed by the value. Responses are "[response length]\n" followed by the response. <<Include(A:stub)>>
Line 3: Line 3:
Examples: Command names are sent over the ssh pipe as plain text, followed by a newline. Arguments are sent as {{{[argname] [value length]\n}}}, followed by the value. Responses are {{{[response length]\n}}}, followed by the response.
Line 5: Line 5:
Example:
Line 13: Line 14:
Unknown commands elicit no response in early hg versions and zero length.

Version detection:

Because older Mercurial versions have no response to unknown commands, to detect a version you must send the {{{hello}}} command followed by a command with known output and then determine if the {{{hello}}} command responded before the known output was sent.
===== Version detection =====
Because older Mercurial versions give no/zero-length responses to unknown commands, you must first send the ''`hello`'' command followed by a command with known output, and then determine if the ''`hello`'' command responded before the known output was sent.

{i} This page is an incomplete stub. Please help improve this page by expanding it, following our wiki style guidelines.

Command names are sent over the ssh pipe as plain text, followed by a newline. Arguments are sent as [argname] [value length]\n, followed by the value. Responses are [response length]\n, followed by the response.

Example:

send:
heads
response:
41
482d3fb47d80693f929101f95944bf019009dd79

Version detection

Because older Mercurial versions give no/zero-length responses to unknown commands, you must first send the hello command followed by a command with known output, and then determine if the hello command responded before the known output was sent.


CategoryInternals

SshCommandProtocol (last edited 2013-12-10 13:11:46 by MaytagMetalark)