tests/test-serve
changeset 6300 874ca958025b
parent 6262 de7256c82fad
child 6331 627665e37bdd
equal deleted inserted replaced
6299:653ddd1d7cd7 6300:874ca958025b
     1 #!/bin/sh
     1 #!/bin/sh
       
     2 
       
     3 hgserve()
       
     4 {
       
     5     hg serve -a localhost -p $HGPORT1 -d --pid-file=hg.pid -v $@ \
       
     6         | sed -e 's/:[0-9][0-9]*//g' -e 's/localhost\.localdomain/localhost/'
       
     7     cat hg.pid >> "$DAEMON_PIDS"
       
     8     sleep 1
       
     9     kill `cat hg.pid`
       
    10     sleep 1
       
    11 }
     2 
    12 
     3 hg init test
    13 hg init test
     4 cd test
    14 cd test
     5 
    15 
     6 echo '[web]' > .hg/hgrc
    16 echo '[web]' > .hg/hgrc
    12 if [ -f access.log ]; then
    22 if [ -f access.log ]; then
    13     echo 'access log created - .hg/hgrc respected'
    23     echo 'access log created - .hg/hgrc respected'
    14 fi
    24 fi
    15 
    25 
    16 echo % With -v
    26 echo % With -v
    17 hg serve -a localhost -p $HGPORT1 -d --pid-file=hg.pid -v \
    27 hgserve
    18     | sed -e 's/:[0-9][0-9]*//g' -e 's/localhost\.localdomain/localhost/'
       
    19 cat hg.pid >> "$DAEMON_PIDS"
       
    20 sleep 1
       
    21 kill `cat hg.pid`
       
    22 sleep 1
       
    23 
    28 
    24 echo % With --prefix foo
    29 echo % With --prefix foo
    25 hg serve -a localhost -p $HGPORT1 -d --pid-file=hg.pid -v --prefix foo \
    30 hgserve --prefix foo
    26     | sed -e 's/:[0-9][0-9]*//g' -e 's/localhost\.localdomain/localhost/'
       
    27 cat hg.pid >> "$DAEMON_PIDS"
       
    28 sleep 1
       
    29 kill `cat hg.pid`
       
    30 sleep 1
       
    31 
    31 
    32 echo % With --prefix /foo
    32 echo % With --prefix /foo
    33 hg serve -a localhost -p $HGPORT1 -d --pid-file=hg.pid -v --prefix /foo \
    33 hgserve --prefix /foo
    34     | sed -e 's/:[0-9][0-9]*//g' -e 's/localhost\.localdomain/localhost/'
       
    35 cat hg.pid >> "$DAEMON_PIDS"
       
    36 sleep 1
       
    37 kill `cat hg.pid`
       
    38 sleep 1
       
    39 
    34 
    40 echo % With --prefix foo/
    35 echo % With --prefix foo/
    41 hg serve -a localhost -p $HGPORT1 -d --pid-file=hg.pid -v --prefix foo/ \
    36 hgserve --prefix foo/
    42     | sed -e 's/:[0-9][0-9]*//g' -e 's/localhost\.localdomain/localhost/'
       
    43 cat hg.pid >> "$DAEMON_PIDS"
       
    44 sleep 1
       
    45 kill `cat hg.pid`
       
    46 sleep 1
       
    47 
    37 
    48 echo % With --prefix /foo/
    38 echo % With --prefix /foo/
    49 hg serve -a localhost -p $HGPORT1 -d --pid-file=hg.pid -v --prefix /foo/ \
    39 hgserve --prefix /foo/
    50     | sed -e 's/:[0-9][0-9]*//g' -e 's/localhost\.localdomain/localhost/'
       
    51 cat hg.pid >> "$DAEMON_PIDS"