view tests/test-clone-cgi.t @ 17777:af7c6bc48d8d

run-tests: alternative way of handling \r on Windows After f71d60da58fb all \r was stripped from output on Windows, and the places where a \r explicitly was expected it was accepted that it was missing. Ugly hack. Instead we now accept that an extra \r might appear at the end of lines on Windows. That is more to the point and less ugly.
author Mads Kiilerich <mads@kiilerich.com>
date Mon, 15 Oct 2012 02:33:12 +0200
parents 8b84d040d9f9
children e8efcc8ff5c0
line wrap: on
line source

  $ "$TESTDIR/hghave" no-msys || exit 80 # MSYS will translate web paths as if they were file paths

This is a test of the wire protocol over CGI-based hgweb.
initialize repository

  $ hg init test
  $ cd test
  $ echo a > a
  $ hg ci -Ama
  adding a
  $ cd ..
  $ cat >hgweb.cgi <<HGWEB
  > #
  > # An example CGI script to use hgweb, edit as necessary
  > import cgitb
  > cgitb.enable()
  > from mercurial import demandimport; demandimport.enable()
  > from mercurial.hgweb import hgweb
  > from mercurial.hgweb import wsgicgi
  > application = hgweb("test", "Empty test repository")
  > wsgicgi.launch(application)
  > HGWEB
  $ chmod 755 hgweb.cgi

try hgweb request

  $ . "$TESTDIR/cgienv"
  $ QUERY_STRING="cmd=changegroup&roots=0000000000000000000000000000000000000000"; export QUERY_STRING
  $ python hgweb.cgi >page1 2>&1
  $ python "$TESTDIR/md5sum.py" page1
  1f424bb22ec05c3c6bc866b6e67efe43  page1