Show More
@@ -1,60 +1,60 b'' | |||||
1 | #require no-msys # MSYS will translate web paths as if they were file paths |
|
1 | #require no-msys # MSYS will translate web paths as if they were file paths | |
2 |
|
2 | |||
3 | This is a rudimentary test of the CGI files as of d74fc8dec2b4. |
|
3 | This is a rudimentary test of the CGI files as of d74fc8dec2b4. | |
4 |
|
4 | |||
5 | $ hg init test |
|
5 | $ hg init test | |
6 |
|
6 | |||
7 | $ cat >hgweb.cgi <<HGWEB |
|
7 | $ cat >hgweb.cgi <<HGWEB | |
8 | > #!$PYTHON |
|
8 | > #!$PYTHON | |
9 | > # |
|
9 | > # | |
10 | > # An example CGI script to use hgweb, edit as necessary |
|
10 | > # An example CGI script to use hgweb, edit as necessary | |
11 | > |
|
11 | > | |
12 | > import cgitb |
|
12 | > import cgitb | |
13 | > cgitb.enable() |
|
13 | > cgitb.enable() | |
14 | > |
|
14 | > | |
15 | > from mercurial import demandimport; demandimport.enable() |
|
15 | > from mercurial import demandimport; demandimport.enable() | |
16 | > from mercurial.hgweb import hgweb |
|
16 | > from mercurial.hgweb import hgweb | |
17 | > from mercurial.hgweb import wsgicgi |
|
17 | > from mercurial.hgweb import wsgicgi | |
18 | > |
|
18 | > | |
19 | > application = hgweb(b"test", b"Empty test repository") |
|
19 | > application = hgweb(b"test", b"Empty test repository") | |
20 | > wsgicgi.launch(application) |
|
20 | > wsgicgi.launch(application) | |
21 | > HGWEB |
|
21 | > HGWEB | |
22 |
|
22 | |||
23 | $ chmod 755 hgweb.cgi |
|
23 | $ chmod 755 hgweb.cgi | |
24 |
|
24 | |||
25 | $ cat >hgweb.config <<HGWEBDIRCONF |
|
25 | $ cat >hgweb.config <<HGWEBDIRCONF | |
26 | > [paths] |
|
26 | > [paths] | |
27 | > test = test |
|
27 | > test = test | |
28 | > HGWEBDIRCONF |
|
28 | > HGWEBDIRCONF | |
29 |
|
29 | |||
30 | $ cat >hgwebdir.cgi <<HGWEBDIR |
|
30 | $ cat >hgwebdir.cgi <<HGWEBDIR | |
31 | > #!$PYTHON |
|
31 | > #!$PYTHON | |
32 | > # |
|
32 | > # | |
33 | > # An example CGI script to export multiple hgweb repos, edit as necessary |
|
33 | > # An example CGI script to export multiple hgweb repos, edit as necessary | |
34 | > |
|
34 | > | |
35 | > import cgitb |
|
35 | > import cgitb | |
36 | > cgitb.enable() |
|
36 | > cgitb.enable() | |
37 | > |
|
37 | > | |
38 | > from mercurial import demandimport; demandimport.enable() |
|
38 | > from mercurial import demandimport; demandimport.enable() | |
39 | > from mercurial.hgweb import hgwebdir |
|
39 | > from mercurial.hgweb import hgwebdir | |
40 | > from mercurial.hgweb import wsgicgi |
|
40 | > from mercurial.hgweb import wsgicgi | |
41 | > |
|
41 | > | |
42 | > application = hgwebdir("hgweb.config") |
|
42 | > application = hgwebdir(b"hgweb.config") | |
43 | > wsgicgi.launch(application) |
|
43 | > wsgicgi.launch(application) | |
44 | > HGWEBDIR |
|
44 | > HGWEBDIR | |
45 |
|
45 | |||
46 | $ chmod 755 hgwebdir.cgi |
|
46 | $ chmod 755 hgwebdir.cgi | |
47 |
|
47 | |||
48 | $ . "$TESTDIR/cgienv" |
|
48 | $ . "$TESTDIR/cgienv" | |
49 | $ "$PYTHON" hgweb.cgi > page1 |
|
49 | $ "$PYTHON" hgweb.cgi > page1 | |
50 | $ "$PYTHON" hgwebdir.cgi > page2 |
|
50 | $ "$PYTHON" hgwebdir.cgi > page2 | |
51 |
|
51 | |||
52 | $ PATH_INFO="/test/" |
|
52 | $ PATH_INFO="/test/" | |
53 | $ PATH_TRANSLATED="/var/something/test.cgi" |
|
53 | $ PATH_TRANSLATED="/var/something/test.cgi" | |
54 | $ REQUEST_URI="/test/test/" |
|
54 | $ REQUEST_URI="/test/test/" | |
55 | $ SCRIPT_URI="http://hg.omnifarious.org/test/test/" |
|
55 | $ SCRIPT_URI="http://hg.omnifarious.org/test/test/" | |
56 | $ SCRIPT_URL="/test/test/" |
|
56 | $ SCRIPT_URL="/test/test/" | |
57 | $ "$PYTHON" hgwebdir.cgi > page3 |
|
57 | $ "$PYTHON" hgwebdir.cgi > page3 | |
58 |
|
58 | |||
59 | $ grep -i error page1 page2 page3 |
|
59 | $ grep -i error page1 page2 page3 | |
60 | [1] |
|
60 | [1] |
General Comments 0
You need to be logged in to leave comments.
Login now