#!/bin/sh
SVN=svn

svnadmin create --fs-type=fsfs svn.$$
export SVNROOT=file://$PWD/svn.$$

# import the directories
mkdir import
cd import
mkdir -p trunk branches tags
$SVN import -m 'initial import' $SVNROOT
cd ..

# add a directory and file to the trunk
$SVN co $SVNROOT/trunk
cd trunk
mkdir dir1
touch dir1/file1
$SVN add dir1
$SVN commit -m 'added dir1/file1'
cd ..

# merge the changes from the trunk into a working copy from a tag
$SVN co $SVNROOT/tags
cd tags
$SVN merge -r1:2 $SVNROOT/trunk

# revert the added file and commit
$SVN revert dir1/file1
$SVN status
$SVN commit -m 'reverted dir1/file1'

# list the contents of that directory
$SVN ls $SVNROOT/tags/dir1


