#!/bin/bash -x

basepath=/tmp
repopath=/tmp/testrepo
repourl=file://$repopath
wcpath=/tmp/testwc

cd $basepath
rm -rf $wcpath
rm -rf $repopath
svnadmin create $repopath

svn co $repourl $wcpath
cd $wcpath

svn mkdir trunk branches
svn ci -m "Create standard directories"
svn up

svn mkdir trunk/foo
echo "foo1" > trunk/foo/foo
svn add trunk/foo/foo
svn ci -m "Create foo project"

cd $basepath
rm -rf $wcpath

svn cp -m "Branch foo" --parents $repourl/trunk $repourl/branches/1.0

svn co $repourl/trunk/foo $wcpath
cd $wcpath
echo "foo2" > foo
svn ci -m "Modify foo on the trunk"

cd $basepath
rm -rf $wcpath
svn co $repourl/branches/1.0/foo $wcpath
cd $wcpath
svn merge -c 4 ^/trunk/foo
svn merge -c 4 ^/trunk/foo .
svn merge ^/trunk/foo@3 ^/trunk/foo@4 .
svn merge -r 3:4 ^/trunk/foo .

