From 13f115d6b706a715e964e5b7012c01b6a36a5125 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 9 Apr 2011 13:41:43 -0400 Subject: Use hg pre-commit hook, rather than its precommit hook, as the latter is run after the files staged for commit are determined and so .etckeeper cannot be staged as part of the current commit. Closes: #621827 --- init.d/50vcs-pre-commit-hook | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'init.d') diff --git a/init.d/50vcs-pre-commit-hook b/init.d/50vcs-pre-commit-hook index e1745b1..6045981 100755 --- a/init.d/50vcs-pre-commit-hook +++ b/init.d/50vcs-pre-commit-hook @@ -19,15 +19,15 @@ EOF ;; hg) if [ -e .hg/hgrc ] && grep "^\[hooks\]" .hg/hgrc; then - if ! grep -q "etckeeper pre-commit" .hg/hgrc; then - echo "etckeeper warning: [hooks] section in .hg/hgrc needs to be manually modified to run: etckeeper pre-commit -d `pwd`" >&2 + if ! grep "^pre-commit" .hg/hgrc | grep -q "etckeeper pre-commit"; then + echo "etckeeper warning: [hooks] section in .hg/hgrc needs to be manually modified to contain: pre-commit = etckeeper pre-commit -d `pwd`" >&2 fi else touch .hg/hgrc cat >>.hg/hgrc <