[PATCH] Detect type of http repo

Mark Williamson mark.williamson at cl.cam.ac.uk
Sun Feb 17 21:30:04 CST 2008


Hi,

Not sure this patch would want to go in as-is but I wanted feedback on the way 
I was doing this.  I've knocked up a little extra code that probes what kind 
of http repository is available - returning an intelligent httprepo if 
possible, falling back to static otherwise (and complaining if neither are 
available).

It'd be nice if static-http could "just work" without having to enter a 
funny-looking URL; some of us have cruel sysadmins who make CGIs not work and 
it's potentially confusing to find that they're really required rather than 
just desirable.

In case the auto-detect is not desired I've added an "hg://" alias that will 
force use of httprepo and left in static-http:// which will force the 
statichttprepo to be used.

The upshot of this from a dynamic server's point of view is that we waste one 
command round-trip when a repo instance is created, by running the "heads" 
command to see if anyone is at home.  If anyone is worried about the 
performance implications of this, we could eliminate this by failing over to 
a statichttprepo a bit later on but that would make the code more complex.

Thoughts?

Cheers,
Mark

PS. if cloning from remote bundles gets implemented, e.g. as suggested by 
the "pack" extension, I could look at adding support for detecting that too.

-- 
Push Me Pull You - Distributed SCM tool (http://www.cl.cam.ac.uk/~maw48/pmpu/)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hg-detect-http.patch
Type: all/allfiles
Size: 1895 bytes
Desc: not available
Url : http://selenic.com/pipermail/mercurial-devel/attachments/20080218/39de416c/attachment.bin 


More information about the Mercurial-devel mailing list