[darcs-devel] About submission via POST

John Meacham john at repetae.net
Sun Mar 30 04:07:13 UTC 2008


Some explanation of this patch,

This patch allows 'darcs send' to submit patches via the HTTP POST
method in addition to via email. This has a number of advantages, namely
that you need not have email set up on the client machine (useful for
windows boxes) and the server has a chance to take a look at the patch
before it decides whether to accept it or not. 

I have included a very simple example CGI script that simply acts as a
gateway between HTTP POST and a maildir. more advanced server scripts
are possible of course, the HTTP POST is done with a mime type of
message/rfc822 and the 'Content-Accept' is set to text/plain so the
results can be printed to the screen. 

To know whether it should use POST or email, it first looks for a file
named _darcs/prefs/post, and if that exists it reads it, each line
should consist of a url. 'mailto:' urls are also allowed if you want the
patch to be both emailed and submitted to a site. if _darcs/prefs/post
doesn't exist, it falls back to reading the _darcs/prefs/email file like
normal. so it is backwards and forwards compatible.

It currently requires Network.HTTP to be installed, though the
appropriate bindings could be added to the curl and libwww parts too. 

        John

-- 
John Meacham - ⑆repetae.net⑆john⑈


More information about the darcs-devel mailing list