diff options
-rw-r--r-- | debian/changelog | 2 | ||||
-rwxr-xr-x | init.d/50vcs-pre-commit-hook | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/debian/changelog b/debian/changelog index fcfd1fc..6afc1c5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,8 @@ etckeeper (0.41) UNRELEASED; urgency=low * Change etckeeper uninit to not remove .gitignore (etc) file if it lacks the "managed by etckeeper" comment. Closes: #545137 + * Fix hgrc setup code to not warn if the hgrc already contains + a call to etckeeper. (Thanks, Jakov Sosic) -- Joey Hess <joeyh@debian.org> Mon, 07 Sep 2009 14:06:45 -0400 diff --git a/init.d/50vcs-pre-commit-hook b/init.d/50vcs-pre-commit-hook index 06d433b..e1745b1 100755 --- a/init.d/50vcs-pre-commit-hook +++ b/init.d/50vcs-pre-commit-hook @@ -19,10 +19,12 @@ EOF ;; hg) 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 -d `pwd`" >&2 + 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 + fi else - touch .hg/hgrc - cat >>.hg/hgrc <<EOF + touch .hg/hgrc + cat >>.hg/hgrc <<EOF [hooks] # pre-commit hook for etckeeper, to store metadata and do sanity checks precommit = etckeeper pre-commit -d `pwd` |