tests/test-gpg
author Javi Merino <cibervicho@gmail.com>
Wed, 19 May 2010 18:06:35 +0200
changeset 11266 2b440bb8a66b
parent 9041 6e5e548452de
permissions -rwxr-xr-x
Fixed a bashism with the use of $RANDOM in hgeditor. The variable $RANDOM is not POSIX so a portable /bin/sh may not define it. When creating a directory with a random name it's better to use mktemp, which, even though is not POSIX, exists in common Unixes including Linux, OpenBSD, FreeBSD and MacOS X.

#!/bin/sh

"$TESTDIR/hghave" gpg || exit 80

cat <<EOF >> $HGRCPATH
[extensions]
gpg=

[gpg]
cmd=gpg --no-permission-warning --no-secmem-warning --homedir $TESTDIR/gpg
EOF

hg init r
cd r
echo foo > foo
hg ci -Amfoo

echo '% no signatures'
hg sigs

echo '% hg sign 0'
hg sign 0

echo '% hg sigs'
hg sigs

echo '% hg sigcheck 0'
hg sigcheck 0