# HG changeset patch # User Patrick Mezard # Date 1205766943 -3600 # Node ID 874ca958025bede085d75dca59c9fc03a50748de # Parent 653ddd1d7cd79654545c528b31b80ecf2aea7c83 test-serve: replace copy/paste with shell function diff -r 653ddd1d7cd7 -r 874ca958025b tests/test-serve --- a/tests/test-serve Tue Mar 18 04:07:39 2008 -0300 +++ b/tests/test-serve Mon Mar 17 16:15:43 2008 +0100 @@ -1,5 +1,15 @@ #!/bin/sh +hgserve() +{ + hg serve -a localhost -p $HGPORT1 -d --pid-file=hg.pid -v $@ \ + | sed -e 's/:[0-9][0-9]*//g' -e 's/localhost\.localdomain/localhost/' + cat hg.pid >> "$DAEMON_PIDS" + sleep 1 + kill `cat hg.pid` + sleep 1 +} + hg init test cd test @@ -14,38 +24,16 @@ fi echo % With -v -hg serve -a localhost -p $HGPORT1 -d --pid-file=hg.pid -v \ - | sed -e 's/:[0-9][0-9]*//g' -e 's/localhost\.localdomain/localhost/' -cat hg.pid >> "$DAEMON_PIDS" -sleep 1 -kill `cat hg.pid` -sleep 1 +hgserve echo % With --prefix foo -hg serve -a localhost -p $HGPORT1 -d --pid-file=hg.pid -v --prefix foo \ - | sed -e 's/:[0-9][0-9]*//g' -e 's/localhost\.localdomain/localhost/' -cat hg.pid >> "$DAEMON_PIDS" -sleep 1 -kill `cat hg.pid` -sleep 1 +hgserve --prefix foo echo % With --prefix /foo -hg serve -a localhost -p $HGPORT1 -d --pid-file=hg.pid -v --prefix /foo \ - | sed -e 's/:[0-9][0-9]*//g' -e 's/localhost\.localdomain/localhost/' -cat hg.pid >> "$DAEMON_PIDS" -sleep 1 -kill `cat hg.pid` -sleep 1 +hgserve --prefix /foo echo % With --prefix foo/ -hg serve -a localhost -p $HGPORT1 -d --pid-file=hg.pid -v --prefix foo/ \ - | sed -e 's/:[0-9][0-9]*//g' -e 's/localhost\.localdomain/localhost/' -cat hg.pid >> "$DAEMON_PIDS" -sleep 1 -kill `cat hg.pid` -sleep 1 +hgserve --prefix foo/ echo % With --prefix /foo/ -hg serve -a localhost -p $HGPORT1 -d --pid-file=hg.pid -v --prefix /foo/ \ - | sed -e 's/:[0-9][0-9]*//g' -e 's/localhost\.localdomain/localhost/' -cat hg.pid >> "$DAEMON_PIDS" +hgserve --prefix /foo/