Mercurial socket interface

Carey Evans carey.evans at gmail.com
Sun Oct 4 17:11:17 CDT 2009


2009/10/5 Greg Ward <greg-hg at gerg.ca>:
>  <nbytes>command\0arg1\0arg2\0...\0argN\0
>
> where <nbytes> is (for example) a 16-bit unsigned int with the length
> of the whole command string.  Read 2 bytes, parse, read <nbytes>
> bytes.  Simple and no buffering required.

This is a lot like what is described at
http://cr.yp.to/proto/netstrings.txt. The native Subversion protocol
is also quite simple:
http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_ra_svn/protocol

I personally like the idea of making "hg serve" do everything that's required.

-- 
Laissez lire, et laissez danser; ces deux amusements ne feront jamais
de mal au monde.



More information about the Mercurial-devel mailing list