Differences between revisions 2 and 3
Revision 2 as of 2006-06-04 16:56:58
Size: 659
Editor: mpm
Comment:
Revision 3 as of 2006-06-04 17:59:12
Size: 671
Comment:
Deletions are marked like this. Additions are marked like this.
Line 17: Line 17:
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. 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.

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.

Examples:

send:
heads
response:
41
482d3fb47d80693f929101f95944bf019009dd79

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.

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