tests/test-serve
changeset 6461 eb69e7989145
parent 6331 627665e37bdd
child 10633 3318431f2ab4
equal deleted inserted replaced
6460:a63aed912e54 6461:eb69e7989145
     1 #!/bin/sh
     1 #!/bin/sh
     2 
     2 
     3 hgserve()
     3 hgserve()
     4 {
     4 {
     5     hg serve -a localhost -p $HGPORT1 -d --pid-file=hg.pid -v $@ \
     5     hg serve -a localhost -p $HGPORT1 -d --pid-file=hg.pid -E errors.log -v $@ \
     6         | sed -e 's/:[0-9][0-9]*//g' -e 's/http:\/\/[^/]*\//http:\/\/localhost\//'
     6         | sed -e 's/:[0-9][0-9]*//g' -e 's/http:\/\/[^/]*\//http:\/\/localhost\//'
     7     cat hg.pid >> "$DAEMON_PIDS"
     7     cat hg.pid >> "$DAEMON_PIDS"
       
     8     echo % errors
       
     9     cat errors.log
     8     sleep 1
    10     sleep 1
     9     kill `cat hg.pid`
    11     kill `cat hg.pid`
    10     sleep 1
    12     sleep 1
    11 }
    13 }
    12 
    14 
    15 
    17 
    16 echo '[web]' > .hg/hgrc
    18 echo '[web]' > .hg/hgrc
    17 echo 'accesslog = access.log' >> .hg/hgrc
    19 echo 'accesslog = access.log' >> .hg/hgrc
    18 
    20 
    19 echo % Without -v
    21 echo % Without -v
    20 hg serve -a localhost -p $HGPORT -d --pid-file=hg.pid
    22 hg serve -a localhost -p $HGPORT -d --pid-file=hg.pid -E errors.log
    21 cat hg.pid >> "$DAEMON_PIDS"
    23 cat hg.pid >> "$DAEMON_PIDS"
    22 if [ -f access.log ]; then
    24 if [ -f access.log ]; then
    23     echo 'access log created - .hg/hgrc respected'
    25     echo 'access log created - .hg/hgrc respected'
    24 fi
    26 fi
       
    27 echo % errors
       
    28 cat errors.log
    25 
    29 
    26 echo % With -v
    30 echo % With -v
    27 hgserve
    31 hgserve
    28 
    32 
    29 echo % With --prefix foo
    33 echo % With --prefix foo