Hi! I've attached a patch (against fai-source 3.2.20.1) to retrieve the config space from a mercurial (hg+http) repository.
Maybe someone finds it useful. Greetings, - Darsha
Index: conf/fai.conf =================================================================== --- conf/fai.conf (revision 5525) +++ conf/fai.conf (working copy) @@ -25,7 +25,7 @@ # how to access the fai config space # default if undefined here: nfs://`hostname`/$FAI_CONFIGDIR # supported URL-types: nfs, file, cvs, cvs+ssh, svn+file, svn+http, -# git, git+http, +# git, git+http, hg+http, #FAI_CONFIG_SRC=nfs://yourservername$FAI_CONFIGDIR # the following variables are read only for most users Index: lib/get-config-dir-hg =================================================================== --- lib/get-config-dir-hg (revision 0) +++ lib/get-config-dir-hg (revision 0) @@ -0,0 +1,40 @@ +#!/bin/bash + +# (c) 2002-2006 Henning Glawe <gla...@debian.org> +# (c) 2007 Holger Levsen <hol...@layer-acht.org> for the modifications to use git +# (c) 2009 Darshaka Pathirana <d...@syn-net.org> for the modifications to use hg + +### BEGIN SUBROUTINE INFO +# Provides-Var: +# Requires-Var: $FAI_CONFIG_SRC $FAI $LOGDIR +# Suggests-Var: +# Short-Description: get $FAI from a mercurial (hg) repository. +### END SUBROUTINE INFO + +# matched string: "hg://hgpath" +protocol=$(expr match "$FAI_CONFIG_SRC" '\([^:]*\)://') +hgpath=$(expr match "$FAI_CONFIG_SRC" '[^:]*://\([^[:space:]]\+\)') + +case $protocol in + hg+http) + echo hg+http + hgurl="http://$hgpath" + ;; + *) + echo "get-config-dir-hg: protocol $protocol not implemented" + exit 1 + ;; +esac + +if [ -d "$FAI/.hg" ] ; then + echo "Updating hg copy in $FAI" + cd $FAI + hg pull + task_error 701 $? +else + echo "Checking out from hg" + # cloning into an existing directory is not allowed + if [ -d $FAI ]; then rmdir $FAI; fi + hg clone $hgurl $FAI + task_error 702 $? +fi