tests/test-wsgicgi.t
author Pierre-Yves David <pierre-yves.david@octobus.net>
Fri, 05 Apr 2024 14:13:47 +0200
changeset 51584 5b99b64328f2
parent 50937 04bfcb416745
permissions -rw-r--r--
phases: use revision number in `_pushdiscoveryphase` We now reach our target checkpoint in terms of rev-num conversion. The `_pushdiscoveryphase` function is now performing graph computation based on revision number only. Avoiding repeated conversion from node-id to rev-num. See previous changeset updated `new_heads` for rationnal. Again, time saved in the 100 milliseconds order of magnitude for the mozilla-try benchmark I have been using. However, wow that the logic is done using revision number, we can look into having better logic in the next changesets, which will provide a much bigger speedup.

  $ hg init test
  $ cat >hgweb.cgi <<HGWEB
  > #!$PYTHON
  > from mercurial import demandimport; demandimport.enable()
  > from mercurial.hgweb import hgweb
  > from mercurial.hgweb import wsgicgi
  > application = hgweb(b"test", b"Empty test repository")
  > wsgicgi.launch(application)
  > HGWEB
  $ chmod 755 hgweb.cgi

Check that non-ASCII bytes roundtrip correctly.

  $ . "$TESTDIR/cgienv"
  $ PATH_INFO="/rev/$(python -c 'import sys; sys.stdout.buffer.write(b"\xe2\x80\x94")')"; export PATH_INFO
  $ QUERY_STRING="style=raw"; export QUERY_STRING
  $ "$PYTHON" ./hgweb.cgi | grep error
  error: unknown revision '\xe2\x80\x94' (esc)