skip-blame because just b'' prefixes
I believe this should fix some tests.
hg-reviewers |
I believe this should fix some tests.
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
Path | Packages | |||
---|---|---|---|---|
M | tests/test-extension.t (2 lines) | |||
M | tests/test-hgweb-commands.t (2 lines) | |||
M | tests/test-mq.t (2 lines) | |||
M | tests/test-newercgi.t (2 lines) | |||
M | tests/test-oldcgi.t (2 lines) | |||
M | tests/test-push-cgi.t (2 lines) |
Check hgweb's load order of extensions and registration of functions | Check hgweb's load order of extensions and registration of functions | ||||
$ cat > hgweb.cgi <<EOF | $ cat > hgweb.cgi <<EOF | ||||
> #!$PYTHON | > #!$PYTHON | ||||
> from mercurial import demandimport; demandimport.enable() | > from mercurial import demandimport; demandimport.enable() | ||||
> from mercurial.hgweb import hgweb | > from mercurial.hgweb import hgweb | ||||
> from mercurial.hgweb import wsgicgi | > from mercurial.hgweb import wsgicgi | ||||
> application = hgweb('.', 'test repo') | > application = hgweb(b'.', b'test repo') | ||||
> wsgicgi.launch(application) | > wsgicgi.launch(application) | ||||
> EOF | > EOF | ||||
$ . "$TESTDIR/cgienv" | $ . "$TESTDIR/cgienv" | ||||
$ PATH_INFO='/' SCRIPT_NAME='' $PYTHON hgweb.cgi \ | $ PATH_INFO='/' SCRIPT_NAME='' $PYTHON hgweb.cgi \ | ||||
> | grep '^[0-9]) ' # ignores HTML output | > | grep '^[0-9]) ' # ignores HTML output | ||||
1) foo imported | 1) foo imported | ||||
1) bar imported | 1) bar imported |
bookmarks view doesn't choke on bookmarks on secret changesets (issue3774) | bookmarks view doesn't choke on bookmarks on secret changesets (issue3774) | ||||
$ hg phase -fs 4 | $ hg phase -fs 4 | ||||
$ hg bookmark -r4 secret | $ hg bookmark -r4 secret | ||||
$ cat > hgweb.cgi <<HGWEB | $ cat > hgweb.cgi <<HGWEB | ||||
> from mercurial import demandimport; demandimport.enable() | > from mercurial import demandimport; demandimport.enable() | ||||
> from mercurial.hgweb import hgweb | > from mercurial.hgweb import hgweb | ||||
> from mercurial.hgweb import wsgicgi | > from mercurial.hgweb import wsgicgi | ||||
> app = hgweb('.', 'test') | > app = hgweb(b'.', b'test') | ||||
> wsgicgi.launch(app) | > wsgicgi.launch(app) | ||||
> HGWEB | > HGWEB | ||||
$ . "$TESTDIR/cgienv" | $ . "$TESTDIR/cgienv" | ||||
$ PATH_INFO=/bookmarks; export PATH_INFO | $ PATH_INFO=/bookmarks; export PATH_INFO | ||||
$ QUERY_STRING='style=raw' | $ QUERY_STRING='style=raw' | ||||
$ $PYTHON hgweb.cgi | grep -v ETag: | $ $PYTHON hgweb.cgi | grep -v ETag: | ||||
Status: 200 Script output follows\r (esc) | Status: 200 Script output follows\r (esc) | ||||
Content-Type: text/plain; charset=ascii\r (esc) | Content-Type: text/plain; charset=ascii\r (esc) |
Test that secret mq patch does not break hgweb | Test that secret mq patch does not break hgweb | ||||
$ cat > hgweb.cgi <<HGWEB | $ cat > hgweb.cgi <<HGWEB | ||||
> from mercurial import demandimport; demandimport.enable() | > from mercurial import demandimport; demandimport.enable() | ||||
> from mercurial.hgweb import hgweb | > from mercurial.hgweb import hgweb | ||||
> from mercurial.hgweb import wsgicgi | > from mercurial.hgweb import wsgicgi | ||||
> import cgitb | > import cgitb | ||||
> cgitb.enable() | > cgitb.enable() | ||||
> app = hgweb('.', 'test') | > app = hgweb(b'.', b'test') | ||||
> wsgicgi.launch(app) | > wsgicgi.launch(app) | ||||
> HGWEB | > HGWEB | ||||
$ . "$TESTDIR/cgienv" | $ . "$TESTDIR/cgienv" | ||||
#if msys | #if msys | ||||
$ PATH_INFO=//tags; export PATH_INFO | $ PATH_INFO=//tags; export PATH_INFO | ||||
#else | #else | ||||
$ PATH_INFO=/tags; export PATH_INFO | $ PATH_INFO=/tags; export PATH_INFO | ||||
#endif | #endif |
> | > | ||||
> import cgitb | > import cgitb | ||||
> cgitb.enable() | > cgitb.enable() | ||||
> | > | ||||
> from mercurial import demandimport; demandimport.enable() | > from mercurial import demandimport; demandimport.enable() | ||||
> from mercurial.hgweb import hgweb | > from mercurial.hgweb import hgweb | ||||
> from mercurial.hgweb import wsgicgi | > from mercurial.hgweb import wsgicgi | ||||
> | > | ||||
> application = hgweb("test", "Empty test repository") | > application = hgweb(b"test", b"Empty test repository") | ||||
> wsgicgi.launch(application) | > wsgicgi.launch(application) | ||||
> HGWEB | > HGWEB | ||||
$ chmod 755 hgweb.cgi | $ chmod 755 hgweb.cgi | ||||
$ cat >hgweb.config <<HGWEBDIRCONF | $ cat >hgweb.config <<HGWEBDIRCONF | ||||
> [paths] | > [paths] | ||||
> test = test | > test = test |
#require no-msys # MSYS will translate web paths as if they were file paths | #require no-msys # MSYS will translate web paths as if they were file paths | ||||
This tests if CGI files from before d0db3462d568 still work. | This tests if CGI files from before d0db3462d568 still work. | ||||
$ hg init test | $ hg init test | ||||
$ cat >hgweb.cgi <<HGWEB | $ cat >hgweb.cgi <<HGWEB | ||||
> #!$PYTHON | > #!$PYTHON | ||||
> # | > # | ||||
> # An example CGI script to use hgweb, edit as necessary | > # An example CGI script to use hgweb, edit as necessary | ||||
> | > | ||||
> import cgitb, os, sys | > import cgitb, os, sys | ||||
> cgitb.enable() | > cgitb.enable() | ||||
> | > | ||||
> # sys.path.insert(0, "/path/to/python/lib") # if not a system-wide install | > # sys.path.insert(0, "/path/to/python/lib") # if not a system-wide install | ||||
> from mercurial import hgweb | > from mercurial import hgweb | ||||
> | > | ||||
> h = hgweb.hgweb("test", "Empty test repository") | > h = hgweb.hgweb(b"test", b"Empty test repository") | ||||
> h.run() | > h.run() | ||||
> HGWEB | > HGWEB | ||||
$ chmod 755 hgweb.cgi | $ chmod 755 hgweb.cgi | ||||
$ cat >hgweb.config <<HGWEBDIRCONF | $ cat >hgweb.config <<HGWEBDIRCONF | ||||
> [paths] | > [paths] | ||||
> test = test | > test = test |
create hgweb invocation script | create hgweb invocation script | ||||
$ cat >hgweb.cgi <<HGWEB | $ cat >hgweb.cgi <<HGWEB | ||||
> import cgitb | > import cgitb | ||||
> cgitb.enable() | > cgitb.enable() | ||||
> from mercurial import demandimport; demandimport.enable() | > from mercurial import demandimport; demandimport.enable() | ||||
> from mercurial.hgweb import hgweb | > from mercurial.hgweb import hgweb | ||||
> from mercurial.hgweb import wsgicgi | > from mercurial.hgweb import wsgicgi | ||||
> application = hgweb('.', 'test repository') | > application = hgweb(b'.', b'test repository') | ||||
> wsgicgi.launch(application) | > wsgicgi.launch(application) | ||||
> HGWEB | > HGWEB | ||||
$ chmod 755 hgweb.cgi | $ chmod 755 hgweb.cgi | ||||
test preparation | test preparation | ||||
$ . "$TESTDIR/cgienv" | $ . "$TESTDIR/cgienv" | ||||
$ REQUEST_METHOD="POST"; export REQUEST_METHOD | $ REQUEST_METHOD="POST"; export REQUEST_METHOD |