Source

hgsubversion / tests / fixtures / pre_commit_hooks.sh

#!/bin/sh

mkdir temp
cd temp

mkdir project-orig
cd project-orig
mkdir trunk branches tags
cd ..

svnadmin create testrepo
svnurl=file://`pwd`/testrepo
svn import --username equeny project-orig $svnurl -m "Empty dirs."

svn co $svnurl project
cd project
echo 'file: alpha' > trunk/alpha
svn add trunk/alpha
svn ci --username durin -m 'Add alpha'
echo 'Data of beta' > trunk/beta
svn add trunk/beta
svn ci --username durin -m 'Add beta'
svn up
svn cp trunk branches/the_branch
svn ci --username durin -m 'Make a branch'
cd ..

echo '#!/bin/sh
echo "Commits are not allowed" >&2; exit 1;
' > `pwd`/testrepo/hooks/pre-commit
chmod +x `pwd`/testrepo/hooks/pre-commit

tar cz -C testrepo -f ../pre_commit_hooks.tar.gz .