using static-http with PUT/POST

Matt Mackall mpm at selenic.com
Sat Apr 7 18:29:01 UTC 2012


On Sat, 2012-04-07 at 10:34 -0700, Rian Hunter wrote:
> Hmm well for editing a remote resource via Http PUT/DELETE should be enough.

Not really. Mercurial depends on being able to append to files and HTTP
1.1 doesn't really support that without ad hoc extensions. Rewriting
files from scratch with a full-file PUT will be a) ridiculously
inefficient b) unsafe for multiple users and c) liable to corrupt your
repo on failure.

But if your PUT handler accepts Content-range or a similar hack, then
yes, it's vaguely workable. Take a close look at how the opener object
works here:

http://www.selenic.com/hg/file/329887a7074c/mercurial/statichttprepo.py#l61

You might also look at the list archives for the various hacks people
have done to support FTP.

> Also does mercurial do bulk transfers without needing to inspect it's data? If so http pipelining can speed up the interaction.

Not really. I/O in Mercurial is intentionally setup to be
single-threaded and highly local to improve performance on spinning
media.

-- 
Mathematics is the supreme nostalgia of our time.





More information about the Mercurial mailing list