##// END OF EJS Templates
Turn off signing with hgeditor by default...
Matt Mackall -
r684:4ccf3de5 0.6b default
parent child Browse files
Show More
@@ -3,6 +3,9 b''
3 # This is an example of using HGEDITOR to automate the signing of
3 # This is an example of using HGEDITOR to automate the signing of
4 # commits and so on.
4 # commits and so on.
5
5
6 # change this to one to turn on GPG support
7 SIGN=0
8
6 T1=""; T2=""
9 T1=""; T2=""
7 cleanup_exit() {
10 cleanup_exit() {
8 rm -f "$T1" "$T2"
11 rm -f "$T1" "$T2"
@@ -40,12 +43,17 b' else'
40
43
41 CHECKSUM=`md5sum "$T1"`
44 CHECKSUM=`md5sum "$T1"`
42 $EDITOR "$T1" "$T2" || cleanup_exit $?
45 $EDITOR "$T1" "$T2" || cleanup_exit $?
46
47 if [ "$SIGN" == "1" ] ; then
43 echo "$CHECKSUM" | md5sum -c 2>/dev/null && cleanup_exit 13
48 echo "$CHECKSUM" | md5sum -c 2>/dev/null && cleanup_exit 13
44 {
49 {
45 head -n 1 "$T1"
50 head -n 1 "$T1"
46 echo
51 echo
47 grep -v "^HG:" "$T1" | gpg -t -a -u "${HGUSER}" --clearsign
52 grep -v "^HG:" "$T1" | gpg -t -a -u "${HGUSER}" --clearsign
48 } > "$T2" && mv "$T2" "$1"
53 } > "$T2" && mv "$T2" "$1"
54 else
55 mv "$T1" "$1"
56 fi
49 cleanup_exit $?
57 cleanup_exit $?
50 fi
58 fi
51
59
General Comments 0
You need to be logged in to leave comments. Login now