Mercurial > hg
annotate tests/test-newcgi.t @ 13962:8b252e826c68
add: introduce a warning message for non-portable filenames (issue2756) (BC)
On POSIX platforms, the 'add', 'addremove', 'copy' and 'rename' commands now
warn if a file has a name that can't be checked out on Windows.
Example:
$ hg add con.xml
warning: filename contains 'con', which is reserved on Windows: 'con.xml'
$ hg status
A con.xml
The file is added despite the warning.
The warning is ON by default. It can be suppressed by setting the config option
'portablefilenames' in section 'ui' to 'ignore' or 'false':
$ hg --config ui.portablefilenames=ignore add con.xml
$ hg sta
A con.xml
If ui.portablefilenames is set to 'abort', then the command is aborted:
$ hg --config ui.portablefilenames=abort add con.xml
abort: filename contains 'con', which is reserved on Windows: 'con.xml'
On Windows, the ui.portablefilenames config setting is irrelevant and the
command is always aborted if a problematic filename is found.
author | Adrian Buehlmann <adrian@cadifra.com> |
---|---|
date | Tue, 19 Apr 2011 12:42:53 +0200 |
parents | aa3f726a2bdb |
children | 8b84d040d9f9 |
rev | line source |
---|---|
12470 | 1 This tests if CGI files from after d0db3462d568 but |
2 before d74fc8dec2b4 still work. | |
5577
e0173902c813
CGI compatibility fix for d74fc8dec2b4.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
3 |
12470 | 4 $ hg init test |
5 $ cat >hgweb.cgi <<HGWEB | |
6 > #!/usr/bin/env python | |
7 > # | |
8 > # An example CGI script to use hgweb, edit as necessary | |
9 > | |
10 > import cgitb | |
11 > cgitb.enable() | |
12 > | |
13 > from mercurial import demandimport; demandimport.enable() | |
14 > from mercurial.hgweb import hgweb | |
15 > from mercurial.hgweb import wsgicgi | |
16 > from mercurial.hgweb.request import wsgiapplication | |
17 > | |
18 > def make_web_app(): | |
12743
4c4aeaab2339
check-code: add 'no tab indent' check for unified tests
Adrian Buehlmann <adrian@cadifra.com>
parents:
12470
diff
changeset
|
19 > return hgweb("test", "Empty test repository") |
12470 | 20 > |
21 > wsgicgi.launch(wsgiapplication(make_web_app)) | |
22 > HGWEB | |
5577
e0173902c813
CGI compatibility fix for d74fc8dec2b4.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
23 |
12470 | 24 $ chmod 755 hgweb.cgi |
5577
e0173902c813
CGI compatibility fix for d74fc8dec2b4.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
25 |
12470 | 26 $ cat >hgweb.config <<HGWEBDIRCONF |
27 > [paths] | |
28 > test = test | |
29 > HGWEBDIRCONF | |
5577
e0173902c813
CGI compatibility fix for d74fc8dec2b4.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
30 |
12470 | 31 $ cat >hgwebdir.cgi <<HGWEBDIR |
32 > #!/usr/bin/env python | |
33 > # | |
34 > # An example CGI script to export multiple hgweb repos, edit as necessary | |
35 > | |
36 > import cgitb | |
37 > cgitb.enable() | |
38 > | |
39 > from mercurial import demandimport; demandimport.enable() | |
40 > from mercurial.hgweb import hgwebdir | |
41 > from mercurial.hgweb import wsgicgi | |
42 > from mercurial.hgweb.request import wsgiapplication | |
43 > | |
44 > def make_web_app(): | |
12743
4c4aeaab2339
check-code: add 'no tab indent' check for unified tests
Adrian Buehlmann <adrian@cadifra.com>
parents:
12470
diff
changeset
|
45 > return hgwebdir("hgweb.config") |
12470 | 46 > |
47 > wsgicgi.launch(wsgiapplication(make_web_app)) | |
48 > HGWEBDIR | |
5577
e0173902c813
CGI compatibility fix for d74fc8dec2b4.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
49 |
12470 | 50 $ chmod 755 hgwebdir.cgi |
5577
e0173902c813
CGI compatibility fix for d74fc8dec2b4.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
51 |
13269
aa3f726a2bdb
tests: remove duplication of the CGI environment variables
StevenGBrown
parents:
12743
diff
changeset
|
52 $ . "$TESTDIR/cgienv" |
12470 | 53 $ python hgweb.cgi > page1 |
54 $ python hgwebdir.cgi > page2 | |
55 | |
56 $ PATH_INFO="/test/" | |
57 $ PATH_TRANSLATED="/var/something/test.cgi" | |
58 $ REQUEST_URI="/test/test/" | |
59 $ SCRIPT_URI="http://hg.omnifarious.org/test/test/" | |
60 $ SCRIPT_URL="/test/test/" | |
61 $ python hgwebdir.cgi > page3 | |
62 | |
63 $ grep -i error page1 page2 page3 | |
64 [1] |