2014-08-06 20:43:59 +04:00
|
|
|
#require no-msys # MSYS will translate web paths as if they were file paths
|
2011-11-21 04:49:20 +04:00
|
|
|
|
2018-04-12 02:04:47 +03:00
|
|
|
$ cat << EOF >> $HGRCPATH
|
|
|
|
> [format]
|
|
|
|
> allowbundle1=True
|
|
|
|
> EOF
|
|
|
|
|
2010-09-26 22:11:52 +04:00
|
|
|
This is a test of the wire protocol over CGI-based hgweb.
|
|
|
|
initialize repository
|
|
|
|
|
|
|
|
$ hg init test
|
|
|
|
$ cd test
|
|
|
|
$ echo a > a
|
|
|
|
$ hg ci -Ama
|
|
|
|
adding a
|
|
|
|
$ cd ..
|
|
|
|
$ cat >hgweb.cgi <<HGWEB
|
|
|
|
> #
|
|
|
|
> # An example CGI script to use hgweb, edit as necessary
|
|
|
|
> import cgitb
|
|
|
|
> cgitb.enable()
|
2019-01-30 03:25:33 +03:00
|
|
|
> from edenscm.mercurial import demandimport; demandimport.enable()
|
|
|
|
> from edenscm.mercurial.hgweb import hgweb
|
|
|
|
> from edenscm.mercurial.hgweb import wsgicgi
|
2010-09-26 22:11:52 +04:00
|
|
|
> application = hgweb("test", "Empty test repository")
|
|
|
|
> wsgicgi.launch(application)
|
|
|
|
> HGWEB
|
|
|
|
$ chmod 755 hgweb.cgi
|
|
|
|
|
|
|
|
try hgweb request
|
|
|
|
|
2011-01-16 14:12:54 +03:00
|
|
|
$ . "$TESTDIR/cgienv"
|
2010-09-26 22:11:52 +04:00
|
|
|
$ QUERY_STRING="cmd=changegroup&roots=0000000000000000000000000000000000000000"; export QUERY_STRING
|
2018-04-12 02:04:47 +03:00
|
|
|
$ $PYTHON hgweb.cgi >page1
|
|
|
|
devel-warn: using deprecated bundlev1 format
|
|
|
|
at: */changegroup.py:* (makechangegroup) (glob)
|
2017-06-20 16:45:02 +03:00
|
|
|
$ $PYTHON "$TESTDIR/md5sum.py" page1
|
2018-04-12 02:04:47 +03:00
|
|
|
1f424bb22ec05c3c6bc866b6e67efe43 page1
|
2013-02-05 02:25:25 +04:00
|
|
|
|
|
|
|
make sure headers are sent even when there is no body
|
|
|
|
|
2017-07-05 19:10:11 +03:00
|
|
|
$ QUERY_STRING="cmd=listkeys&namespace=nosuchnamespace" $PYTHON hgweb.cgi
|
2013-02-05 02:25:25 +04:00
|
|
|
Status: 200 Script output follows\r (esc)
|
|
|
|
Content-Type: application/mercurial-0.1\r (esc)
|
|
|
|
Content-Length: 0\r (esc)
|
|
|
|
\r (esc)
|