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