##// END OF EJS Templates
server: append to logfiles
Mirko Friedenhagen -
r5690:1b365c57 default
parent child Browse files
Show More
@@ -197,7 +197,7 b' def create_server(ui, repo):'
197
197
198 def openlog(opt, default):
198 def openlog(opt, default):
199 if opt and opt != '-':
199 if opt and opt != '-':
200 return open(opt, 'w')
200 return open(opt, 'a')
201 return default
201 return default
202
202
203 if repo is None:
203 if repo is None:
@@ -7,7 +7,7 b' mkdir da'
7 echo foo > da/foo
7 echo foo > da/foo
8 echo foo > foo
8 echo foo > foo
9 hg ci -Ambase -d '0 0'
9 hg ci -Ambase -d '0 0'
10 hg serve -p $HGPORT -d --pid-file=hg.pid
10 hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log
11 cat hg.pid >> $DAEMON_PIDS
11 cat hg.pid >> $DAEMON_PIDS
12 echo % manifest
12 echo % manifest
13 ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/?style=raw')
13 ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/?style=raw')
@@ -28,5 +28,12 b' echo % should give a 400 - bad command'
28 echo % should give a 404 - file does not exist
28 echo % should give a 404 - file does not exist
29 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/bork?style=raw'
29 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/bork?style=raw'
30
30
31 echo % stop and restart
32 kill `cat hg.pid`
33 hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log
34 cat hg.pid >> $DAEMON_PIDS
35 # Test the access/error files are opened in append mode
36 python -c "print len(file('access.log').readlines()), 'log lines written'"
37
31 echo % static file
38 echo % static file
32 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/static/style-gitweb.css'
39 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/static/style-gitweb.css'
@@ -65,6 +65,8 b' 404 Not Found'
65
65
66
66
67 error: Path not found: bork/
67 error: Path not found: bork/
68 % stop and restart
69 7 log lines written
68 % static file
70 % static file
69 200 Script output follows
71 200 Script output follows
70
72
General Comments 0
You need to be logged in to leave comments. Login now