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
cat >> $HGRCPATH <<EOF
[extensions]
convert=
EOF
# Prepare orig repo
hg init orig
cd orig
echo foo > foo
HGUSER='user name' hg ci -qAm 'foo'
cd ..
# Explicit --authors
cat > authormap.txt <<EOF
user name = Long User Name
# comment
this line is ignored
EOF
hg convert --authors authormap.txt orig new
echo $?
cat new/.hg/authormap
hg -Rnew log
rm -rf new
# Implicit .hg/authormap
hg init new
mv authormap.txt new/.hg/authormap
hg convert orig new
echo $?
hg -Rnew log