Advertise hg client capabilities to hg server

Anton Gogolev anton.gogolev at gmail.com
Tue Jan 28 02:37:11 CST 2014


Hi,

I'm entertaining the idea of how useful would it be for hg server to know
a thing or two about the client that is connecting to it. More
specifically, things I think could be useful to know on the server-side
include:

 * Client version
 * Enabled extensions
 * Platform
 * ...and something else

How I see this implemented is either by including all this information in
a User-Agent string or in some kind of X-HG-CLIENT header or combination
thereof:

 GET http://host?cmd=capabilities HTTP/1.1
 Accept-Encoding: identity
 Accept: application/mercurial-0.1
 User-Agent: mercurial/proto-2.8.2
 X-Hg-Client: extensions=largefiles,projrc,convert,page,rebase,mq;
   platform=windows;

I don't know what are the implications of bumping version number in
"User-Agent: mercurial/proto-1.0", probably somebody can chime in
and destroy this whole idea.

How can this be useful, you ask? For one, this would allow server to
enforce a client to enable specific extensions (like projrc, which is
useful in a corporate environment) or warn about outdated version or
possible problems with repository on a local machine (when cloning a
repository created on a case-sensitive file system to a Windows machine).

This might introduce slight security problems with exposing a list of
enabled extensions to the server, but this can be solved with a client-
side configuration knob, which would default to existing, "anonymous"
behavior.

What do you think of that?

Thanks,
Anton.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20140128/e9d7cccf/attachment.html>


More information about the Mercurial-devel mailing list