tests/test-wsgicgi.t
author Arseniy Alekseyev <aalekseyev@janestreet.com>
Fri, 26 Apr 2024 19:10:35 +0100
changeset 51626 865efc020c33
parent 50937 04bfcb416745
permissions -rw-r--r--
dirstate: remove the python-side whitelist of allowed matchers This whitelist is too permissive because it allows matchers that contain disallowed ones deep inside, for example through `intersectionmatcher`. It is also too restrictive because it doesn't pass through some of the matchers we support, such as `patternmatcher`. It's also unnecessary because unsupported matchers raise `FallbackError` and we fall back anyway. Making this change makes more of the tests use rust code path, and therefore subtly change behavior. For example, rust status in largefiles repos seems to have strange behavior.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
50937
04bfcb416745 hgweb: pass strings in WSGI environment correctly from wsgicgi
Manuel Jacob <me@manueljacob.de>
parents:
diff changeset
     1
  $ hg init test
04bfcb416745 hgweb: pass strings in WSGI environment correctly from wsgicgi
Manuel Jacob <me@manueljacob.de>
parents:
diff changeset
     2
  $ cat >hgweb.cgi <<HGWEB
04bfcb416745 hgweb: pass strings in WSGI environment correctly from wsgicgi
Manuel Jacob <me@manueljacob.de>
parents:
diff changeset
     3
  > #!$PYTHON
04bfcb416745 hgweb: pass strings in WSGI environment correctly from wsgicgi
Manuel Jacob <me@manueljacob.de>
parents:
diff changeset
     4
  > from mercurial import demandimport; demandimport.enable()
04bfcb416745 hgweb: pass strings in WSGI environment correctly from wsgicgi
Manuel Jacob <me@manueljacob.de>
parents:
diff changeset
     5
  > from mercurial.hgweb import hgweb
04bfcb416745 hgweb: pass strings in WSGI environment correctly from wsgicgi
Manuel Jacob <me@manueljacob.de>
parents:
diff changeset
     6
  > from mercurial.hgweb import wsgicgi
04bfcb416745 hgweb: pass strings in WSGI environment correctly from wsgicgi
Manuel Jacob <me@manueljacob.de>
parents:
diff changeset
     7
  > application = hgweb(b"test", b"Empty test repository")
04bfcb416745 hgweb: pass strings in WSGI environment correctly from wsgicgi
Manuel Jacob <me@manueljacob.de>
parents:
diff changeset
     8
  > wsgicgi.launch(application)
04bfcb416745 hgweb: pass strings in WSGI environment correctly from wsgicgi
Manuel Jacob <me@manueljacob.de>
parents:
diff changeset
     9
  > HGWEB
04bfcb416745 hgweb: pass strings in WSGI environment correctly from wsgicgi
Manuel Jacob <me@manueljacob.de>
parents:
diff changeset
    10
  $ chmod 755 hgweb.cgi
04bfcb416745 hgweb: pass strings in WSGI environment correctly from wsgicgi
Manuel Jacob <me@manueljacob.de>
parents:
diff changeset
    11
04bfcb416745 hgweb: pass strings in WSGI environment correctly from wsgicgi
Manuel Jacob <me@manueljacob.de>
parents:
diff changeset
    12
Check that non-ASCII bytes roundtrip correctly.
04bfcb416745 hgweb: pass strings in WSGI environment correctly from wsgicgi
Manuel Jacob <me@manueljacob.de>
parents:
diff changeset
    13
04bfcb416745 hgweb: pass strings in WSGI environment correctly from wsgicgi
Manuel Jacob <me@manueljacob.de>
parents:
diff changeset
    14
  $ . "$TESTDIR/cgienv"
04bfcb416745 hgweb: pass strings in WSGI environment correctly from wsgicgi
Manuel Jacob <me@manueljacob.de>
parents:
diff changeset
    15
  $ PATH_INFO="/rev/$(python -c 'import sys; sys.stdout.buffer.write(b"\xe2\x80\x94")')"; export PATH_INFO
04bfcb416745 hgweb: pass strings in WSGI environment correctly from wsgicgi
Manuel Jacob <me@manueljacob.de>
parents:
diff changeset
    16
  $ QUERY_STRING="style=raw"; export QUERY_STRING
04bfcb416745 hgweb: pass strings in WSGI environment correctly from wsgicgi
Manuel Jacob <me@manueljacob.de>
parents:
diff changeset
    17
  $ "$PYTHON" ./hgweb.cgi | grep error
04bfcb416745 hgweb: pass strings in WSGI environment correctly from wsgicgi
Manuel Jacob <me@manueljacob.de>
parents:
diff changeset
    18
  error: unknown revision '\xe2\x80\x94' (esc)