| 1 |
#require no-msys # MSYS will translate web paths as if they were file paths |
| 2 |
|
| 3 |
This is a test of the wire protocol over CGI-based hgweb. |
| 4 |
initialize repository |
| 5 |
|
| 6 |
$ hg init test |
| 7 |
$ cd test |
| 8 |
$ echo a > a |
| 9 |
$ hg ci -Ama |
| 10 |
adding a |
| 11 |
$ cd .. |
| 12 |
$ cat >hgweb.cgi <<HGWEB |
| 13 |
> # |
| 14 |
> # An example CGI script to use hgweb, edit as necessary |
| 15 |
> from mercurial import demandimport; demandimport.enable() |
| 16 |
> from mercurial.hgweb import hgweb |
| 17 |
> from mercurial.hgweb import wsgicgi |
| 18 |
> application = hgweb(b"test", b"Empty test repository") |
| 19 |
> wsgicgi.launch(application) |
| 20 |
> HGWEB |
| 21 |
$ chmod 755 hgweb.cgi |
| 22 |
|
| 23 |
try hgweb request |
| 24 |
|
| 25 |
$ . "$TESTDIR/cgienv" |
| 26 |
$ QUERY_STRING="cmd=changegroup&roots=0000000000000000000000000000000000000000"; export QUERY_STRING |
| 27 |
$ "$PYTHON" hgweb.cgi >page1 2>&1 |
| 28 |
$ "$PYTHON" "$TESTDIR/md5sum.py" page1 |
| 29 |
1f424bb22ec05c3c6bc866b6e67efe43 page1 |
| 30 |
|
| 31 |
make sure headers are sent even when there is no body |
| 32 |
|
| 33 |
$ QUERY_STRING="cmd=listkeys&namespace=nosuchnamespace" "$PYTHON" hgweb.cgi |
| 34 |
Status: 200 Script output follows\r (esc) |
| 35 |
Content-Type: application/mercurial-0.1\r (esc) |
| 36 |
Content-Length: 0\r (esc) |
| 37 |
\r (esc) |