From c65ad8cba4ebf8eb7625b4e0801a6c68125384ac Mon Sep 17 00:00:00 2001 From: Mathieu Clabaut Date: Fri, 21 Dec 2007 15:47:30 -0600 Subject: Tranlsation of init.d in mercurial idiom --- hg/init.d/40hg-init | 7 +++--- hg/init.d/50hg-ignore | 51 +++++++++++++++++++++++++++++++++++------- hg/init.d/50hg-perm | 2 +- hg/init.d/50hg-pre-commit-hook | 15 +++++-------- hg/init.d/70hg-add | 4 ++-- 5 files changed, 56 insertions(+), 23 deletions(-) diff --git a/hg/init.d/40hg-init b/hg/init.d/40hg-init index 69867c4..cf9733b 100644 --- a/hg/init.d/40hg-init +++ b/hg/init.d/40hg-init @@ -1,6 +1,7 @@ #!/bin/sh set -e -if [ ! -e .git ]; then - git-init - echo "$(hostname) /etc repository" > .git/description +if [ ! -e .hg ]; then + hg init + echo "[web]\n" > .hg/hgrc + echo "$(hostname) /etc repository" > .hg/hgrc fi diff --git a/hg/init.d/50hg-ignore b/hg/init.d/50hg-ignore index f931592..b02107e 100644 --- a/hg/init.d/50hg-ignore +++ b/hg/init.d/50hg-ignore @@ -1,22 +1,57 @@ #!/bin/sh set -e -if [ ! -e .gitignore ]; then - cat >.gitignore <.hgignore <&2 - fi +if [ -e .hg/hgrc ] && grep "^\[hooks\]" .hg/hgrc; then + echo "etckeeper warning: [hooks] section in .hg/hgrc needs to be manually modified to run: etckeeper pre-commit `pwd`" >&2 else - cat >.git/hooks/pre-commit <>.hg/hgrc <&2 +if ! hg addremove .; then + echo "etckeeper warning: hg addremove failed" >&2 fi -- cgit v1.2.3