action/test1
author Paul Crowley <paul@lshift.net>
Tue, 15 Dec 2009 14:28:27 +0000
changeset 269 a09f1bc9a6cf
parent 268 24145a4eb6fc
child 270 28b355b7390e
permissions -rwxr-xr-x
Change back to non-Debian testing, fix test to work around NULL problem

#!/bin/sh

set -e

cd

cat > .ssh/config <<__END__
Host chroothg
Hostname localhost
User hg
Port 2222
__END__

echo "Cloning hgadmin..."
hg clone ssh://chroothg/hgadmin
echo "Updating hgadmin..."
cd hgadmin

cat > access.conf <<__END__
write user=restricted/** file=allowedhere/**
read user=restricted/**
__END__
mkdir -p keys/restricted
cp /home/test2/.ssh/id_rsa.pub keys/restricted/test2

hg add keys/restricted/test2 access.conf
hg commit -u test1 -m "Added user test2"
echo "Push"
hg push
cd ..
mkdir realrepo
cd realrepo
hg init .
mkdir allowedhere
echo "This is a file" > allowedhere/content
echo "This is a file not everyone can write to" > cantwrite
hg add allowedhere/content cantwrite
hg commit -u test1 -m "Add files to the repo"
echo "Pushing changes"
hg clone . ssh://chroothg/real/project
echo "Done for user test1"