]> Tony Duckles's Git Repositories (git.nynim.org) - svn2svn.git/blob - tests/t0100-diff-repo.sh
Fix typo in comment
[svn2svn.git] / tests / t0100-diff-repo.sh
1 #!/bin/bash
2
3 test_description='Test diff-repo.sh
4 '
5 . ./test-lib.sh
6
7 author='Tony Duckles <tony@nynim.org>'
8
9
10 PWD=${TEST_DIRECTORY:-.}
11 PWDURL=$(echo "file://$PWD" | sed 's/\ /%20/g')
12 REPONAME="_repo_t0100"
13 REPO1="$PWD/${REPONAME}_tmp1"
14 REPO2="$PWD/${REPONAME}_tmp2"
15 REPO1URL="$PWDURL/_repo_t0100_tmp1"
16 REPO2URL="$PWDURL/_repo_t0100_tmp2"
17 WC="$PWD/_wc_t0100"
18
19 test_expect_success \
20 "pre-cleanup" \
21 "rm -rf \"$REPO1\" \"$REPO2\" \"$WC\""
22
23 test_expect_success \
24 "create repo1" \
25 "svnadmin create \"$REPO1\""
26
27 test_expect_success \
28 "populate repo1" \
29 "svn mkdir -q -m \"Add /trunk\" $REPO1URL/trunk && \
30 svn co -q $REPO1URL/trunk \"$WC\" && \
31 mkdir -p \"$WC/Module/ProjectA\" && \
32 echo \"Module/ProjectA/FileA1.txt (Initial)\" >> \"$WC/Module/ProjectA/FileA1.txt\" && echo \"Module/ProjectA/FileA2.txt (Initial)\" >> \"$WC/Module/ProjectA/FileA2.txt\" && \
33 svn -q add \"$WC/Module\" && \
34 svn ci -q -m \"Initial population\" \"$WC\""
35
36 test_expect_success \
37 "diff-repo: repo1/trunk == repo1/trunk" \
38 "./diff-repo.sh $REPO1URL/trunk $REPO1URL/trunk"
39
40 test_expect_failure \
41 "diff-repo: repo1/trunk != repo1/trunk/Module" \
42 "./diff-repo.sh $REPO1URL/trunk $REPO1URL/trunk/Module"
43
44 test_expect_success \
45 "rsync repo1 -> repo2" \
46 "rsync -aq \"$REPO1/\" \"$REPO2\""
47
48 test_expect_success \
49 "diff-repo: repo1/trunk == repo2/trunk (identical)" \
50 "./diff-repo.sh $REPO1URL/trunk $REPO2URL/trunk"
51
52 test_expect_success \
53 "modify repo2 content" \
54 "rm -rf \"$WC\" && \
55 svn co -q $REPO2URL/trunk \"$WC\" && \
56 echo \"Module/ProjectA/FileA1.txt (Edit)\" >> \"$WC/Module/ProjectA/FileA1.txt\" && \
57 echo \"Module/ProjectA/FileA3.txt (New File)\" >> \"$WC/Module/ProjectA/FileA3.txt\" && \
58 svn -q add \"$WC/Module/ProjectA/FileA3.txt\" && \
59 svn ci -q -m \"Second commit\" \"$WC\""
60
61 test_expect_failure \
62 "diff-repo: repo1/trunk != repo2/trunk (changed)" \
63 "./diff-repo.sh $REPO1URL/trunk $REPO2URL/trunk"
64
65 test_expect_success \
66 "cleanup" \
67 "rm -rf \"$REPO1\" \"$REPO2\" \"$WC\""
68
69 test_done