2007-06-04 23:48:59 +04:00
|
|
|
#!/bin/sh
|
|
|
|
|
2008-03-17 18:15:43 +03:00
|
|
|
hgserve()
|
|
|
|
{
|
2008-04-03 14:46:37 +04:00
|
|
|
hg serve -a localhost -p $HGPORT1 -d --pid-file=hg.pid -E errors.log -v $@ \
|
2008-03-21 00:58:53 +03:00
|
|
|
| sed -e 's/:[0-9][0-9]*//g' -e 's/http:\/\/[^/]*\//http:\/\/localhost\//'
|
2008-03-17 18:15:43 +03:00
|
|
|
cat hg.pid >> "$DAEMON_PIDS"
|
2008-04-03 14:46:37 +04:00
|
|
|
echo % errors
|
|
|
|
cat errors.log
|
2008-03-17 18:15:43 +03:00
|
|
|
sleep 1
|
|
|
|
kill `cat hg.pid`
|
|
|
|
sleep 1
|
|
|
|
}
|
|
|
|
|
2007-06-04 23:48:59 +04:00
|
|
|
hg init test
|
|
|
|
cd test
|
|
|
|
|
2007-07-12 02:56:16 +04:00
|
|
|
echo '[web]' > .hg/hgrc
|
|
|
|
echo 'accesslog = access.log' >> .hg/hgrc
|
|
|
|
|
2007-06-04 23:48:59 +04:00
|
|
|
echo % Without -v
|
2008-04-03 14:46:37 +04:00
|
|
|
hg serve -a localhost -p $HGPORT -d --pid-file=hg.pid -E errors.log
|
2007-06-06 02:26:36 +04:00
|
|
|
cat hg.pid >> "$DAEMON_PIDS"
|
2007-07-12 02:56:16 +04:00
|
|
|
if [ -f access.log ]; then
|
|
|
|
echo 'access log created - .hg/hgrc respected'
|
|
|
|
fi
|
2008-04-03 14:46:37 +04:00
|
|
|
echo % errors
|
|
|
|
cat errors.log
|
2007-06-04 23:48:59 +04:00
|
|
|
|
|
|
|
echo % With -v
|
2008-03-17 18:15:43 +03:00
|
|
|
hgserve
|
2008-01-23 01:06:37 +03:00
|
|
|
|
|
|
|
echo % With --prefix foo
|
2008-03-17 18:15:43 +03:00
|
|
|
hgserve --prefix foo
|
2008-01-23 01:06:37 +03:00
|
|
|
|
|
|
|
echo % With --prefix /foo
|
2008-03-17 18:15:43 +03:00
|
|
|
hgserve --prefix /foo
|
2008-01-23 01:06:37 +03:00
|
|
|
|
|
|
|
echo % With --prefix foo/
|
2008-03-17 18:15:43 +03:00
|
|
|
hgserve --prefix foo/
|
2008-01-23 01:06:37 +03:00
|
|
|
|
|
|
|
echo % With --prefix /foo/
|
2008-03-17 18:15:43 +03:00
|
|
|
hgserve --prefix /foo/
|