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
echo % initialize remote repo with branches
hg init remote
cd remote
echo a > a
hg ci -Ama
hg branch br
hg ci -Amb
echo c > c
hg ci -Amc
hg log
cd ..
echo % try cloning -r branch
hg clone -rbr remote local1
hg -R local1 parents
echo % try cloning -rother clone#branch
hg clone -r0 remote#br local2
hg -R local2 parents
echo % try cloning -r1 clone#branch
hg clone -r1 remote#br local3
hg -R local3 parents