All pastes #73034 Raw Edit

Generate test repo

public text v1 · immutable
#73034 ·published 2006-06-27 11:12 UTC
rendered paste body
#!/bin/sh

repo=file://$1

if [ "$1x" = "x" ]; then
        echo "usage: $0 /path/to/repo"
        exit
fi

# Blow away repo directory, and WC
rm -rf $1/*
rm -rf repo

# Create new repo, check it out, cd(1) to it.
svnadmin create $1
svn checkout $repo
cd repo

# Create trunk/ and branches/
mkdir trunk branches
svn add trunk branches
svn commit -m 'trunk branches' trunk branches

# Create two files in trunk/
cd trunk
touch foo bar
svn add foo bar
svn commit -m 'Add foo and bar'

# Suggested by Alan Barrett -- make sure that I don't have a mixed
# working copy.
svn update
svn info .

# Copy trunk/ to branches/test1/, using a WC -> WC copy, and ::Ra and
# ::Repos both handle this properly
cd ..
svn copy trunk branches/test1
svn commit -m 'Create test1 with "svn copy trunk branches/test1"'
svn update

# Make a change to branches/test1/bar and commit.
cd branches/test1
echo bar > bar
svn commit -m "Add 'bar'"

# Copy trunk/ to branches/test2/, using a URL -> URL copy.  ::Ra wil have
# problems with this.
svn copy $repo/trunk $repo/branches/test2 -m 'Create test2 with immediate copy'
cd ..
svn update

# Make a change to branches/test2/bar, and commit.  ::Ra and ::Repos will now
# agree on the youngest rev for branches/test2/bar, but they will disagree
# on the youngest rev for branches/test2/foo (which has not been changed
# since it was copied).  This is the issue.
cd test2
echo bar > bar
svn commit -m "Add 'bar'"

echo Now run:
echo
echo "    perl test.pl $1"