#!/bin/sh # The next line is the only line you should need to adjust. # SVNDIR=/tmp/svn/bin SVNDIR=/opt/subversion/bin SVN=${SVNDIR}/svn SVNSERVE=${SVNDIR}/svnserve SVNADMIN=${SVNDIR}/svnadmin URL=file:///`pwd`/repos rm -rf repos wc* import-me ${SVNADMIN} create repos echo "### Making a Greek Tree for import..." mkdir import-me mkdir import-me/trunk mkdir import-me/trunk/MyProject mkdir import-me/trunk/MyProject/MyFolder echo "//My Cool File" > import-me/trunk/MyProject/MyFolder/MyFile1.txt echo "//My Cool File" > import-me/trunk/MyProject/MyFolder/MyFile2.txt echo "### Done." echo "" echo "### Importing it..." (cd import-me; ${SVN} import -q -m "Initial import." ${URL}); echo "### Done." echo "" echo "### Checking out trunk..." ${SVN} co -q ${URL}/trunk wc1 echo "### Done" echo "" echo "### Creating branch..." ${SVN} cp -m "Create Branch" ${URL}/trunk/MyProject ${URL}/branches/r01/MyProject --parents echo "### Done." echo "" echo "### Checking out branch..." ${SVN} co -q ${URL}/branches/r01 wc2 echo "### Done." echo "" cd wc1 echo "### delete MyFile1.txt in trunk..." ${SVN} rm MyProject/MyFolder/MyFile1.txt ${SVN} commit -m "Delete file" echo "### Done." echo "" echo "### modify MyFile2.txt in trunk..." echo "//Edit My Cool File" > MyProject/MyFolder/MyFile2.txt ${SVN} commit -m "Update file" echo "### Done." echo "" cd .. cd wc2 echo "### delete MyFile1.txt in branch..." ${SVN} rm MyProject/MyFolder/MyFile1.txt ${SVN} commit -m "Delete file" echo "### Done." echo "" echo "### Update branch to HEAD..." ${SVN} up MyProject -r HEAD --force echo "### Done." echo "" echo "### Merging trunk into branch..." ${SVN} merge ${URL}/trunk/MyProject MyProject echo "### Done." echo "" echo "" echo "### Status:" echo "" ${SVN} status --depth=infinity -v MyProject echo "" echo "### If this worked, there should be a tree conflict" echo "### because MyFolder/MyFile1.txt was deleted on this branch." cd ..