summaryrefslogtreecommitdiffstats
path: root/hg-commit
diff options
context:
space:
mode:
authorBrendan Cully <brendan@kublai.com>2007-03-06 15:43:21 -0800
committerBrendan Cully <brendan@kublai.com>2007-03-06 15:43:21 -0800
commit8cd635bbf00c2b7fc9133d47e8457a26c9a494e4 (patch)
treeb780ceea8efec72bef02a6bd259f7875a61f0782 /hg-commit
parent09862ab1193b795e4af13549a22f3574cedf299d (diff)
Make hg commit less clever
Diffstat (limited to 'hg-commit')
-rwxr-xr-xhg-commit33
1 files changed, 17 insertions, 16 deletions
diff --git a/hg-commit b/hg-commit
index be86a33e..220272bb 100755
--- a/hg-commit
+++ b/hg-commit
@@ -1,30 +1,31 @@
#!/bin/bash
-hg commit "$@"
-
lrev=$(hg log --limit 1 --template '{rev}' ChangeLog)
trev=$(hg tip --template '{rev'})
-if [ $lrev = $trev ]; then exit 0; fi
-
-declare -a nopts
+if [ $lrev = $trev ]
+then
+ exec hg commit "$@"
+fi
-while [ $# -gt 0 ]
+# Include ChangeLog if given any explicit file names
+i=0
+while [[ $i -lt $# ]]
do
- case "$1" in
- -m|-l) shift ;;
- -*) nopts[${#nopts[*]}]="$1" ;;
- # Include ChangeLog if given any explicit file names
- *) nopts[${#nopts[*]}]="$1"; cl=ChangeLog ;;
+ i=$((i+1))
+ case "${!i}" in
+ # no-argument options
+ -A) continue ;;
+ # one-argument options
+ -?) i=$((i+1)); continue ;;
+ # one-argument options with no space
+ -*) continue ;;
+ *) cl=ChangeLog ;;
esac
- shift
done
-clog=$(hg tip --template '{desc}')
-
{
hg log --style=./hg-changelog-map -r tip:$lrev
hg cat ChangeLog
} > ChangeLog
-hg rollback
-hg commit -m "$clog" "${nopts[@]}" $cl
+hg commit "$@" $cl