# HG changeset patch # User Dirkjan Ochtman # Date 1219308924 -7200 # Node ID 1ec2d227a5215bb8991f50e54273acd3b108308b # Parent 2cb708e25a5d87d6fd71ae32ea69c37130f5b690 hgweb: fix WSGI iterators handling in CGI adapter (issue1254) diff -r 2cb708e25a5d -r 1ec2d227a521 mercurial/hgweb/wsgicgi.py --- a/mercurial/hgweb/wsgicgi.py Wed Aug 20 19:00:39 2008 +0200 +++ b/mercurial/hgweb/wsgicgi.py Thu Aug 21 10:55:24 2008 +0200 @@ -62,4 +62,6 @@ headers_set[:] = [status, response_headers] return write - application(environ, start_response) + content = application(environ, start_response) + for chunk in content: + write(chunk) diff -r 2cb708e25a5d -r 1ec2d227a521 tests/test-clone-cgi --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-clone-cgi Thu Aug 21 10:55:24 2008 +0200 @@ -0,0 +1,62 @@ +#!/bin/sh +# This is a test of the wire protocol over CGI-based hgweb. + +echo % initialize repository +hg init test +cd test +echo a > a +hg ci -Ama +cd .. + +cat >hgweb.cgi <page1 2>&1 ; echo $? +python "$TESTDIR/md5sum.py" page1 + +exit 0 diff -r 2cb708e25a5d -r 1ec2d227a521 tests/test-clone-cgi.out --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-clone-cgi.out Thu Aug 21 10:55:24 2008 +0200 @@ -0,0 +1,5 @@ +% initialize repository +adding a +% try hgweb request +0 +54086fe9a47b47d83204f38bda0b90c2 page1