diff options
author | Mathieu Clabaut <mathieu.clabaut@gmail.com> | 2007-12-21 15:47:30 -0600 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-01-03 19:53:46 -0500 |
commit | 83d1b75cabbd594019ea6fb0395c4d27e38d8aa3 (patch) | |
tree | 3b2ca170a4b6ce3fb06b241130cbbf1c19f63135 /hg/pre-commit.d | |
parent | c65ad8cba4ebf8eb7625b4e0801a6c68125384ac (diff) |
pre-commit.d : Translation into mercurial idiom
Diffstat (limited to 'hg/pre-commit.d')
-rw-r--r-- | hg/pre-commit.d/20store-empty-directory | 2 | ||||
-rw-r--r-- | hg/pre-commit.d/20warn-hardlinks | 7 | ||||
-rw-r--r-- | hg/pre-commit.d/20warn-special-file | 4 | ||||
-rw-r--r-- | hg/pre-commit.d/30store-metadata | 2 | ||||
-rw-r--r-- | hg/pre-commit.d/README | 2 |
5 files changed, 10 insertions, 7 deletions
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. |