]>
Tony Duckles's Git Repositories (git.nynim.org) - svn2svn.git/blob - tests/make-ref-repo.sh
2 # Create a reference repo with both /trunk and /branches history
5 LOG
=$(svn log -l1 $REPOURL)
6 revision
=$(echo "$LOG" | head -n 2 | tail -n 1| cut -d \| -f 1)
7 comment
=$(echo "$LOG" | head -n 4 | tail -n 1)
10 len
=$(expr ${#REPOURL} + 7)
11 url
=$(svn info $WC | grep "URL:" | cut -c$len-)
14 printf "%-6s%-18s%s\n" "$revision" "$url" "$comment"
26 REPOURL
="file://$REPO"
34 echo "Creating _repo_ref..."
36 svn
mkdir -q -m "Add /trunk" $REPOURL/trunk
38 svn
mkdir -q -m "Add /branches" $REPOURL/branches
40 TRUNK
="$REPOURL/trunk"
45 mkdir -p $WC/Module
/ProjectA
46 echo "Module/ProjectA/FileA1.txt" > $WC/Module
/ProjectA
/FileA1.txt
47 echo "Module/ProjectA/FileA2.txt" > $WC/Module
/ProjectA
/FileA2.txt
48 echo "Module/ProjectA/FileA3.txt" > $WC/Module
/ProjectA
/FileA3.txt
50 svn_commit
"Initial population"
53 # * Test simple copy-from branch
54 BRANCH
="$REPOURL/branches/fix1"
55 svn copy
-q -m "Create branch" $TRUNK $BRANCH
58 mkdir -p $WC/Module
/ProjectB
59 echo "Module/ProjectB/FileB1.txt" > $WC/Module
/ProjectB
/FileB1.txt
60 echo "Module/ProjectB/FileB2.txt" > $WC/Module
/ProjectB
/FileB2.txt
61 svn add
-q $WC/Module
/ProjectB
62 svn_commit
"Fix 1: Add Module/ProjectB"
65 svn_commit
"Fix 1: Add Module/ProjectB"
68 # * Test rename support
69 # * Test committing rename in two different branch commits: first deletion, then add
70 BRANCH
="$REPOURL/branches/fix2"
71 svn copy
-q -m "Create branch" $TRUNK $BRANCH
74 svn
mv -q Module
/ProjectA
/FileA2.txt Module
/ProjectB
/FileB3.txt
75 svn_commit
"Fix 2: Rename Module/ProjectA/FileA2.txt -> Module/ProjectB/FileB3.txt (part 1 of 2)" Module
/ProjectA
76 svn_commit
"Fix 2: Rename Module/ProjectA/FileA2.txt -> Module/ProjectB/FileB3.txt (part 2 of 2)" Module
/ProjectB
79 svn_commit
"Fix 2: Rename Module/ProjectA/FileA2.txt -> Module/ProjectB/FileB3.txt"
82 BRANCH
="$REPOURL/branches/fix3"
83 svn copy
-q -m "Create branch" $TRUNK $BRANCH
86 echo "Module/ProjectB/FileB3.txt (from Fix 3)" >> $WC/Module
/ProjectB
/FileB3.txt
87 svn_commit
"Fix 3: Modify Module/ProjectB/FileB3.txt"
90 svn_commit
"Fix 3: Modify Module/ProjectB/FileB3.txt"
92 # Rename files + folders
93 # * Test rename support
94 # * Create complicated find-ancestors case, where files/folders are renamed multiple times on branch
95 BRANCH
="$REPOURL/branches/fix4"
96 svn copy
-q -m "Create branch" $TRUNK $BRANCH
99 svn
mv -q Module
/ProjectB Module
/ProjectC
100 svn
mv -q Module
/ProjectC
/FileB1.txt Module
/ProjectC
/FileC1.txt
101 echo "Module/ProjectC/FileC1.txt" >> $WC/Module
/ProjectC
/FileC1.txt
102 svn
mv -q Module
/ProjectC
/FileB2.txt Module
/ProjectC
/FileC2.txt
103 echo "Module/ProjectC/FileC2.txt" >> $WC/Module
/ProjectC
/FileC2.txt
104 svn
mv -q Module
/ProjectC
/FileB3.txt Module
/ProjectC
/FileC3.txt
105 echo "Module/ProjectC/FileC3.txt" >> $WC/Module
/ProjectC
/FileC3.txt
106 svn_commit
"Fix 4: Rename Module/ProjectB -> Module/ProjectC"
109 svn_commit
"Fix 4: Rename Module/ProjectB -> Module/ProjectC"
112 BRANCH
="$REPOURL/branches/fix5"
113 svn copy
-q -m "Create branch" $TRUNK $BRANCH
114 svn switch
-q $BRANCH
116 echo "Module/ProjectC/FileC1.txt (from Fix 5)" >> $WC/Module
/ProjectC
/FileC1.txt
117 echo "Module/ProjectC/FileC2.txt (from Fix 5)" >> $WC/Module
/ProjectC
/FileC2.txt
118 echo "Module/ProjectC/FileC3.txt (from Fix 5)" >> $WC/Module
/ProjectC
/FileC3.txt
119 svn_commit
"Fix 5: Modify Module/ProjectC/FileC*.txt"
122 svn_commit
"Fix 5: Modify Module/ProjectC/FileC*.txt"
124 # Copy from older revision
125 svn copy
-q -r 8 $TRUNK/Module
/ProjectA
/FileA2.txt@
8 $WC/Module
/ProjectA
/FileA2.txt
126 svn_commit
"Fix 6: Restore Module/ProjectA/FileA2.txt"
129 BRANCH
="$REPOURL/branches/fix7"
130 svn copy
-q -m "Create branch" $TRUNK $BRANCH
131 svn switch
-q $BRANCH
133 echo "Module/ProjectA/FileA2.txt (from Fix 7)" >> $WC/Module
/ProjectA
/FileA2.txt
134 svn_commit
"Fix 7: Modify Module/ProjectA/FileA2.txt"
137 svn_commit
"Fix 7: Modify Module/ProjectA/FileA2.txt"