2 # Compare the reference (make-ref-repo.sh) and replay (make-replay-repo.sh)
3 # repositories to check for any differences/problems with the svn2svn replay.
6 PWDURL
=$(echo "file://$PWD" | sed 's/\ /%20/g')
8 WCDUP
="$PWD/_wc_target"
11 # Create a working-copy for the reference repo
12 # Note: We assume that the replay working-copy ("_wc_target") still exists from make-replay-repo.sh
13 #svn co -q $PWDURL/_repo_ref "$WCREF"
14 svn co
-q $PWDURL/_repo_ref
/trunk
"$WCREF"
15 #svn co -q $PWDURL/_repo_ref/trunk/Module2/ProjectB "$WCREF"
17 # Check if the final list of files is the same
18 echo ">> Checking file-list..."
19 cd "$WCREF" && FILESREF
=$(find . -type f | grep -v "\.svn") && cd "$PWD"
20 cd "$WCDUP" && FILESDUP
=$(find . -type f | grep -v "\.svn") && cd "$PWD"
21 if [ "$FILESREF" != "$FILESDUP" ]; then
22 echo "$FILESREF" > _files_ref.txt
23 echo "$FILESDUP" > _files_replay.txt
24 echo "<<< _files_reference.txt"
25 echo ">>> _files_replay.txt"
26 diff _files_ref.txt _files_replay.txt
27 rm _files_ref.txt _files_replay.txt
32 # Check if the final file-contents is the same
33 echo ">> Checking file-contents..."
35 FILES
=$(find . -type f | grep -v "\.svn")
37 echo "$FILES" | while read file; do
38 fname
=$(echo "$file" | sed 's/^\.\///')
39 FILEREF
="$WCREF/$fname"
40 FILEDUP
="$WCDUP/$fname"
41 if [ -f "$FILEDUP" ]; then
42 chksum1
=$(md5sum "$FILEREF" | cut -c1-32)
43 chksum2
=$(md5sum "$FILEDUP" | cut -c1-32)
44 if [ "$chksum1" != "$chksum2" ]; then
45 echo "Checksum mismatch: $fname"
46 echo " $chksum1 $FILEREF"
47 echo " $chksum2 $FILEDUP"
51 echo "No such file: $FILEDUP"
60 # If we found any differences, exit with an error-code
61 [ "$found_diff" -eq 1 ] && exit 1