#
# switch seems to break when you have local changes on a file exclusive 
# to a branch, but only if the file is deep within your wc
#

SVNROOT=file://`pwd`/repo

# if TESTPATH=path, no breakage!
TESTPATH=a/longer/path

rm -rf repo wc

svnadmin create repo
svn mkdir $SVNROOT/trunk -m 'add trunk'
svn mkdir $SVNROOT/branches -m 'add branches'
svn checkout $SVNROOT/trunk wc

cd wc
echo file1 >file1
mkdir -p $TESTPATH
echo file2 >$TESTPATH/file2
svn add *
svn commit -m 'add contents'

svn cp $SVNROOT/trunk $SVNROOT/branches/branch1 -m 'branch trunk'
svn switch $SVNROOT/branches/branch1
echo file3 >$TESTPATH/file3
svn add $TESTPATH/file3
svn commit -m 'add file3 on branch'

echo modify file3 >>$TESTPATH/file3
svn switch $SVNROOT/trunk
# svn: Won't delete locally modified file 'file3'

svn switch $SVNROOT/branches/branch1
# svn: File not found: revision '5', path '/trunk/longer'