#!/bin/sh

svn="${1:-svn}"
svnadmin="${2:-svnadmin}"
repo="file://$(pwd)/repo"
repo="http://localhost/repro/repo"
rm -fr repo structure user1 user2

set -e
set -x

"$svnadmin" create repo
# r0
"$svn" checkout "$repo" structure
"$svn" mkdir structure/trunk
"$svn" mkdir structure/branch
"$svn" commit -mm structure
# r1

echo "aa" > structure/trunk/a
"$svn" add structure/trunk/a
"$svn" commit -mm structure
# r2

echo "bb" > structure/trunk/b
"$svn" add structure/trunk/b
"$svn" commit -mm structure
# r3

"$svn" checkout "$repo"/branch user1
"$svn" checkout "$repo"/branch user2

"$svn" merge -c2 "$repo"/trunk user1
"$svn" commit -mm user1
# r4
"$svn" proplist -v "$repo"/branch

"$svn" merge -c3 "$repo"/trunk user2
"$svn" commit -mm user2
# r5
"$svn" proplist -v "$repo"/branch
