--- a/hg.rst Sun Nov 07 22:24:33 2010 +0200
+++ b/hg.rst Sun Nov 07 23:17:10 2010 +0200
@@ -60,6 +60,53 @@
http://mercurial.selenic.com/wiki/PublishingRepositories
Publishing Mercurial Repositories
+* Publish repos.
+
+With static HTTP hosting you can copy via rsync, ftp, scp, etc., so long as all the files beneath
+.hg are copied. Also since 1.1 pull protocol can detect static HTTP hosting:
+
+ $ hg clone http://example.com/project
+
+ http://mercurial.selenic.com/wiki/hgserve
+ http://mercurial.selenic.com/wiki/StaticHTTP
+
+** init.d script.
+
+ #!/bin/sh
+ CMD=/usr/bin/hg
+
+ PORT=7878
+ SRC=/srv/hg
+ CONGIG=/srv/hg/hgweb.config
+ PIDFILE=/var/run/hg.pid
+
+ case "$1" in
+ start)
+ echo "Mecurial Server service starting."
+ (cd "$SRC"; $CMD serve -d -p $PORT --pid-file "$PIDFILE")
+ ;;
+ stop)
+ if [ -f "$PIDFILE" ]; then
+ PID=`cat "$PIDFILE"`
+ if [ "$PID" -gt 1 ]; then
+ kill -TERM $PID
+ echo "Stopping the Mercurial service PID=$PID."
+ else
+ echo Bad PID for Mercurial -- \"$PID\".
+ echo You may remove \"$PIDFILE\" manually.
+ fi
+ else
+ echo No PID file recorded for mercurial.
+ fi
+ ;;
+ *)
+ echo "$0 {start|stop}"
+ exit 1
+ ;;
+ esac
+
+ http://mercurial.selenic.com/wiki/hgserve
+
* Manage patches with MQ.
First enable MQ, add following to your ~/.hgrc: