Remove usage of changectx
The method has been removed in changeset 836867586b83 of Mercurial.
#!/bin/sh
set -e
cd
if [ -e .ssh/authorized_keys ] ; then
echo "This user already exists with authorized keys, aborting"
exit -1
fi
cp $1/init/dot-mercurial-server .mercurial-server
mkdir -p repos/hgadmin .ssh
cd repos/hgadmin
hg init .
cp $1/init/hgadmin-hgrc .hg/hgrc