From 83d1b75cabbd594019ea6fb0395c4d27e38d8aa3 Mon Sep 17 00:00:00 2001 From: Mathieu Clabaut Date: Fri, 21 Dec 2007 15:47:30 -0600 Subject: pre-commit.d : Translation into mercurial idiom --- hg/pre-commit.d/20store-empty-directory | 2 +- hg/pre-commit.d/20warn-hardlinks | 7 +++++-- hg/pre-commit.d/20warn-special-file | 4 ++-- hg/pre-commit.d/30store-metadata | 2 +- hg/pre-commit.d/README | 2 +- 5 files changed, 10 insertions(+), 7 deletions(-) (limited to 'hg') diff --git a/hg/pre-commit.d/20store-empty-directory b/hg/pre-commit.d/20store-empty-directory index e0f9538..2f127dd 100644 --- a/hg/pre-commit.d/20store-empty-directory +++ b/hg/pre-commit.d/20store-empty-directory @@ -13,7 +13,7 @@ find -type d -empty | grep -v /.git/ | sort | if [ ! -e .etckeeper ] || ! cmp -s .etckeeper .etckeeper.new ; then mv -f .etckeeper.new .etckeeper - git add .etckeeper + hg add .etckeeper else rm -f .etckeeper.new fi diff --git a/hg/pre-commit.d/20warn-hardlinks b/hg/pre-commit.d/20warn-hardlinks index 3dd7a96..aa4b705 100644 --- a/hg/pre-commit.d/20warn-hardlinks +++ b/hg/pre-commit.d/20warn-hardlinks @@ -1,7 +1,10 @@ #!/bin/sh + +# TODO +# Not sure if it is the case with Mercurial ? set -e -hardlinks=$(find -type f -not -links 1 | grep -v /.git/) || true +hardlinks=$(find -type f -not -links 1 | grep -v /.hg/) || true if [ -n "$hardlinks" ]; then - echo "etckeeper warning: hardlinked files could cause problems with git:" >&2 + echo "etckeeper warning: hardlinked files could cause problems with mercurial:" >&2 echo "$hardlinks" >&2 fi diff --git a/hg/pre-commit.d/20warn-special-file b/hg/pre-commit.d/20warn-special-file index cb4d019..d5d1d7f 100644 --- a/hg/pre-commit.d/20warn-special-file +++ b/hg/pre-commit.d/20warn-special-file @@ -1,8 +1,8 @@ #!/bin/sh set -e -special=$(find -not -type d -not -type f -not -type l | grep -v /.git/) || true +special=$(find -not -type d -not -type f -not -type l | grep -v /.hg/) || true if [ -n "$special" ]; then - echo "etckeeper warning: special files could cause problems with git:" >&2 + echo "etckeeper warning: special files could cause problems with mercurial:" >&2 echo "$special" >&2 fi diff --git a/hg/pre-commit.d/30store-metadata b/hg/pre-commit.d/30store-metadata index b878abd..3f119f5 100644 --- a/hg/pre-commit.d/30store-metadata +++ b/hg/pre-commit.d/30store-metadata @@ -14,5 +14,5 @@ fi # everytime, so avoid changing the file if nothing really changed. if [ ! -z "$(metastore --compare)" ]; then metastore --save - git add .metadata + hg add .metadata fi diff --git a/hg/pre-commit.d/README b/hg/pre-commit.d/README index 051d094..08b8cc9 100644 --- a/hg/pre-commit.d/README +++ b/hg/pre-commit.d/README @@ -1,2 +1,2 @@ -This is run by a git pre-commit hook before committing changes to the +This is run by a mercurial pre-commit hook before committing changes to the repository. This can be used for storing metadata, and for sanity checks. -- cgit v1.2.3