tests/test-permissions
author Will Maier <willmaier@ml1.net>
Mon, 09 Feb 2009 07:55:42 -0600
changeset 7767 b2410ed2cbe9
parent 7138 0df098871e3d
child 11663 c1b11ee12fe7
permissions -rwxr-xr-x
Use shutil.copystat in copyfile().

#!/bin/sh

hg init t
cd t
echo foo > a
hg add a
hg commit -m "1" -d "1000000 0"
hg verify
chmod -r .hg/store/data/a.i
hg verify 2>/dev/null || echo verify failed
chmod +r .hg/store/data/a.i
hg verify 2>/dev/null || echo verify failed
chmod -w .hg/store/data/a.i
echo barber > a
hg commit -m "2" -d "1000000 0" 2>/dev/null || echo commit failed
chmod -w .
hg diff --nodates
chmod +w .

chmod +w .hg/store/data/a.i
mkdir dir
touch dir/a
hg status
chmod -rx dir
hg status
# reenable perm to allow deletion
chmod +rx dir