Follow-up to r29036: Now that the "mergeinfo" transaction file is no
[svn.git] / contrib / client-side / svnmerge / svnmerge-migrate-test.sh
blob06391e93e81f2ed17cbda6bcefce2957cff40366
1 #!/bin/bash
3 # A test harness for validation of svnmerge-migrate-history.py.
5 SUBVERSION_PREFIX='/usr/local/subversion'
6 export PATH="$SUBVERSION_PREFIX/bin:$PATH"
7 export PYTHONPATH="$SUBVERSION_PREFIX/lib/svn-python"
9 INITIAL_DIR="`pwd`"
10 TMP_DIR='/tmp'
11 REPOS_URL="file://$TMP_DIR/repos"
12 SCRIPT_DIR=$(python -c "import os; print os.path.abspath(\"`dirname $0`\")")
14 cd $TMP_DIR
15 rm -rf repos wc
17 echo 'Creating repository, and populating it with baseline data...'
18 svnadmin create repos
19 svn co $REPOS_URL wc
20 mkdir wc/trunk wc/branches wc/tags
21 echo 'hello world' > wc/trunk/hello-world.txt
22 svn add wc/*
23 svn ci -m 'Populate repos with skeletal data.' wc
25 echo 'Creating a branch, and initializing merge tracking data...'
26 svn cp wc/trunk wc/branches/B
27 svn ci -m 'Create branch B.' wc
28 cd wc/branches/B
29 $HOME/src/subversion/contrib/client-side/svnmerge/svnmerge.py init
30 svn ci -m 'Initialize svnmerge.py merge tracking info on branch B.'
31 #svn merge --record-only -r4:7 $REPOS_URL/trunk ### Not working (?)
32 svn ps svn:mergeinfo '/trunk:4-7' .
33 svn ci -m 'Mix in Subversion 1.5 merge tracking info on branch B.'
34 cd -
36 # Run the migration script, passing on any arguments.
37 $SCRIPT_DIR/svnmerge-migrate-history.py $TMP_DIR/repos -v /branches
39 # Report the results.
40 EXPECTED_MERGEINFO='/trunk:1,4-7'
41 svn up wc
42 svn pl -vR wc | grep $EXPECTED_MERGEINFO && echo 'PASS' || \
43 (echo 'FAIL: Unexpected mergeinfo:' && svn pl -vR wc && \
44 echo "Expected (regex): $EXPECTED_MERGEINFO") >&2 && exit 1