action/test1
changeset 268 24145a4eb6fc
parent 266 7cc208cbf2be
child 269 a09f1bc9a6cf
equal deleted inserted replaced
267:4f24892b33fe 268:24145a4eb6fc
     9 Hostname localhost
     9 Hostname localhost
    10 User hg
    10 User hg
    11 Port 2222
    11 Port 2222
    12 __END__
    12 __END__
    13 
    13 
       
    14 echo "Cloning hgadmin..."
    14 hg clone ssh://chroothg/hgadmin
    15 hg clone ssh://chroothg/hgadmin
       
    16 echo "Updating hgadmin..."
    15 cd hgadmin
    17 cd hgadmin
    16 mkdir -p keys/users
    18 
    17 cp /home/test2/.ssh/id_rsa.pub keys/users/test2
    19 cat > access.conf <<__END__
    18 hg add keys/users/test2
    20 read user=restricted/** file=special/**
       
    21 write user=restricted/**
       
    22 __END__
       
    23 mkdir -p keys/restricted
       
    24 cp /home/test2/.ssh/id_rsa.pub keys/restricted/test2
       
    25 
       
    26 hg add keys/restricted/test2 access.conf
    19 hg commit -u test1 -m "Added user test2"
    27 hg commit -u test1 -m "Added user test2"
       
    28 echo "Push"
    20 hg push
    29 hg push
    21 cd ..
    30 cd ..
    22 mkdir realrepo
    31 mkdir realrepo
    23 cd realrepo
    32 cd realrepo
    24 hg init .
    33 hg init .
    25 echo "This is a file" > content
    34 echo "This is a file" > content
    26 hg add content
    35 mkdir special
       
    36 echo "This is a file not everyone can write to" > special/cantwrite
       
    37 hg add content special/cantwrite
    27 hg commit -u test1 -m "Add a file to the repo"
    38 hg commit -u test1 -m "Add a file to the repo"
       
    39 echo "Pushing changes"
    28 hg clone . ssh://chroothg/real/project
    40 hg clone . ssh://chroothg/real/project
    29 
    41 echo "Done for user test1"