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"
11 REPOS_URL
="file://$TMP_DIR/repos"
12 SCRIPT_DIR
=$
(python
-c "import os; print os.path.abspath(\"`dirname $0`\")")
17 echo 'Creating repository, and populating it with baseline data...'
20 mkdir wc
/trunk wc
/branches wc
/tags
21 echo 'hello world' > wc
/trunk
/hello-world.txt
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
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.'
36 # Run the migration script, passing on any arguments.
37 $SCRIPT_DIR/svnmerge-migrate-history.py
$TMP_DIR/repos
-v /branches
40 EXPECTED_MERGEINFO
='/trunk:1,4-7'
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