mutt stable branch with some hacks
1#!/bin/bash
2
3MUTTDIR=$(dirname $0)
4
5(cd $MUTTDIR && ./check_sec.sh) || exit 1
6
7if [ -f $MUTTDIR/doc/manual.xml ] ; then
8 ( cd $MUTTDIR/doc/ && make validate ) || exit 1
9fi
10
11lrev=$(hg log --limit 1 --template '{rev}' $MUTTDIR/ChangeLog)
12trev=$(hg tip --template '{rev}')
13if [ $lrev = $trev ]
14then
15 exec hg commit "$@"
16fi
17
18# Include ChangeLog if given any explicit file names
19i=0
20while [[ $i -lt $# ]]
21do
22 i=$((i+1))
23 case "${!i}" in
24 # no-argument options
25 -A) continue ;;
26 # one-argument options
27 -?) i=$((i+1)); continue ;;
28 # one-argument options with no space
29 -*) continue ;;
30 *) cl=$MUTTDIR/ChangeLog ;;
31 esac
32done
33
34{
35 hg log --no-merges --style=$MUTTDIR/hg-changelog-map -r tip:$lrev | sed 's#ChangeLog, ##'
36 hg cat $MUTTDIR/ChangeLog
37} > $MUTTDIR/ChangeLog
38${VISUAL:-${EDITOR:-vi}} $MUTTDIR/ChangeLog
39
40hg commit "$@" $cl