diff options
author | Joey Hess <joey@gnu.kitenet.net> | 2009-09-07 14:24:52 -0400 |
---|---|---|
committer | Joey Hess <joey@gnu.kitenet.net> | 2009-09-07 14:24:52 -0400 |
commit | 0b30c92649cdb55996fb20fc2782476f6fab146a (patch) | |
tree | cfb173e849dc6d8b52d7a13cbd148228cf3a59da | |
parent | dd45df9d9209f2f47042e76c32476a21884b7c52 (diff) |
Fix hgrc setup code to not warn if the hgrc already contains a call to etckeeper. (Thanks, Jakov Sosic)
-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` |