Mercurial > hg-stable
changeset 684:4ccf3de52989 0.6b
Turn off signing with hgeditor by default
manifest hash: f2732475351ee22d78e0dab629db03f1f215b21f
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 11 Jul 2005 21:56:29 -0800 |
parents | 104d2aee3b44 |
children | 79fb7032739f |
files | hgeditor |
diffstat | 1 files changed, 14 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/hgeditor Mon Jul 11 21:54:37 2005 -0800 +++ b/hgeditor Mon Jul 11 21:56:29 2005 -0800 @@ -3,6 +3,9 @@ # This is an example of using HGEDITOR to automate the signing of # commits and so on. +# change this to one to turn on GPG support +SIGN=0 + T1=""; T2="" cleanup_exit() { rm -f "$T1" "$T2" @@ -40,12 +43,17 @@ CHECKSUM=`md5sum "$T1"` $EDITOR "$T1" "$T2" || cleanup_exit $? - echo "$CHECKSUM" | md5sum -c 2>/dev/null && cleanup_exit 13 - { - head -n 1 "$T1" - echo - grep -v "^HG:" "$T1" | gpg -t -a -u "${HGUSER}" --clearsign - } > "$T2" && mv "$T2" "$1" + + if [ "$SIGN" == "1" ] ; then + echo "$CHECKSUM" | md5sum -c 2>/dev/null && cleanup_exit 13 + { + head -n 1 "$T1" + echo + grep -v "^HG:" "$T1" | gpg -t -a -u "${HGUSER}" --clearsign + } > "$T2" && mv "$T2" "$1" + else + mv "$T1" "$1" + fi cleanup_exit $? fi