From d9d2090d3bc7013434e78eb07c5117d65ab0e310 Mon Sep 17 00:00:00 2001 From: Rocco Rutte Date: Wed, 10 Dec 2008 13:58:01 +0100 Subject: [PATCH] hg-commit: Work even in subdirectories --- hg-commit | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/hg-commit b/hg-commit index c8f29c4d7..de9cce849 100755 --- a/hg-commit +++ b/hg-commit @@ -2,12 +2,13 @@ MUTTDIR=$(dirname $0) -$MUTTDIR/check_sec.sh +(cd $MUTTDIR && ./check_sec.sh) || exit 1 + if [ -f $MUTTDIR/doc/manual.xml ] ; then ( cd $MUTTDIR/doc/ && make validate ) || exit 1 fi -lrev=$(hg log --limit 1 --template '{rev}' ChangeLog) +lrev=$(hg log --limit 1 --template '{rev}' $MUTTDIR/ChangeLog) trev=$(hg tip --template '{rev}') if [ $lrev = $trev ] then @@ -26,14 +27,14 @@ do -?) i=$((i+1)); continue ;; # one-argument options with no space -*) continue ;; - *) cl=ChangeLog ;; + *) cl=$MUTTDIR/ChangeLog ;; esac done { - hg log --no-merges --style=./hg-changelog-map -r tip:$lrev - hg cat ChangeLog -} > ChangeLog -${VISUAL:-${EDITOR:-vi}} ChangeLog + hg log --no-merges --style=$MUTTDIR/hg-changelog-map -r tip:$lrev + hg cat $MUTTDIR/ChangeLog +} > $MUTTDIR/ChangeLog +${VISUAL:-${EDITOR:-vi}} $MUTTDIR/ChangeLog hg commit "$@" $cl -- 2.40.0