]>
Tony Duckles's Git Repositories (git.nynim.org) - svn2svn.git/blob - tests/diff-repo.sh
2 # Compare the contents of two different SVN repositories.
5 echo "usage: $0 [repo1] [repo2]"
10 WC1
="$PWD/_wc_tmp1_$$"
11 WC2
="$PWD/_wc_tmp2_$$"
14 # Create a working-copy for the reference repo
15 # Note: We assume that the replay working-copy ("_wc_target") still exists from t*.sh
20 # Check if the final list of files is the same
21 cd "$WC1" && FILES1
=$(find . -type f | grep -v "\.svn" | sed 's/^\.\///') && cd "$PWD"
22 cd "$WC2" && FILES2
=$(find . -type f | grep -v "\.svn" | sed 's/^\.\///') && cd "$PWD"
23 if [ "$FILES1" != "$FILES2" ]; then
24 echo "Found file-list differences:"
25 echo "$FILES1" > _files1.txt
26 echo "$FILES2" > _files2.txt
29 diff _files1.txt _files2.txt
30 rm _files1.txt _files2.txt
34 # Check if the final file-contents is the same
36 FILES
=$(find . -type f | grep -v "\.svn")
39 fname
=$(echo "$file" | sed 's/^\.\///')
42 if [ -f "$FILE2" ]; then
43 chksum1
=$(md5sum "$FILE1" | cut -c1-32)
44 chksum2
=$(md5sum "$FILE2" | cut -c1-32)
45 if [ "$chksum1" != "$chksum2" ]; then
46 echo "Checksum mismatch: $fname"
47 echo "<<< @A $fname $chksum1"
48 echo ">>> @B $fname $chksum2"
54 done < <(echo "$FILES")
59 # If we found any differences, exit with an error-code
60 [ "$found_diff" -eq 1 ] && exit 1