--- a/mercurial/hgweb/server.py Mon Dec 24 12:22:33 2007 +0100
+++ b/mercurial/hgweb/server.py Mon Dec 24 17:21:40 2007 +0100
@@ -197,7 +197,7 @@
def openlog(opt, default):
if opt and opt != '-':
- return open(opt, 'w')
+ return open(opt, 'a')
return default
if repo is None:
--- a/tests/test-hgweb Mon Dec 24 12:22:33 2007 +0100
+++ b/tests/test-hgweb Mon Dec 24 17:21:40 2007 +0100
@@ -7,7 +7,7 @@
echo foo > da/foo
echo foo > foo
hg ci -Ambase -d '0 0'
-hg serve -p $HGPORT -d --pid-file=hg.pid
+hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log
cat hg.pid >> $DAEMON_PIDS
echo % manifest
("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/?style=raw')
@@ -28,5 +28,12 @@
echo % should give a 404 - file does not exist
"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/bork?style=raw'
+echo % stop and restart
+kill `cat hg.pid`
+hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log
+cat hg.pid >> $DAEMON_PIDS
+# Test the access/error files are opened in append mode
+python -c "print len(file('access.log').readlines()), 'log lines written'"
+
echo % static file
"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/static/style-gitweb.css'
--- a/tests/test-hgweb.out Mon Dec 24 12:22:33 2007 +0100
+++ b/tests/test-hgweb.out Mon Dec 24 17:21:40 2007 +0100
@@ -65,6 +65,8 @@
error: Path not found: bork/
+% stop and restart
+7 log lines written
% static file
200 Script output follows