]>
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%-22s%s\n" "$revision" "$url" "$comment"
26 REPOURL
="file://$REPO"
31 echo "Creating _repo_ref..."
33 svn
mkdir -q -m "Add /trunk" $REPOURL/trunk
35 svn
mkdir -q -m "Add /branches" $REPOURL/branches
37 TRUNK
="$REPOURL/trunk"
42 mkdir -p $WC/Module
/ProjectA
43 echo "Module/ProjectA/FileA1.txt (Initial)" > $WC/Module
/ProjectA
/FileA1.txt
44 echo "Module/ProjectA/FileA2.txt (Initial)" > $WC/Module
/ProjectA
/FileA2.txt
46 svn_commit
"Initial population"
48 # Test #1: Add new file
49 # * Test simple copy-from branch
50 BRANCH
="$REPOURL/branches/test1"
51 svn copy
-q -m "Create branch" $TRUNK $BRANCH
54 mkdir -p $WC/Module
/ProjectB
55 echo "Module/ProjectB/FileB1.txt (Test 1)" > $WC/Module
/ProjectB
/FileB1.txt
56 svn add
-q $WC/Module
/ProjectB
57 svn_commit
"Test 1: Add Module/ProjectB"
60 svn_commit
"Test 1: Add Module/ProjectB"
62 # Test #2: Rename files
63 # * Test rename support
64 # * Test committing rename in two different branch commits: first deletion, then add
65 BRANCH
="$REPOURL/branches/test2"
66 svn copy
-q -m "Create branch" $TRUNK $BRANCH
69 svn
mv -q Module
/ProjectA
/FileA2.txt Module
/ProjectB
/FileB2.txt
70 echo "Module/ProjectB/FileB2.txt (Test 2)" > $WC/Module
/ProjectB
/FileB2.txt
71 svn_commit
"Test 2: Rename Module/ProjectA/FileA2.txt -> Module/ProjectB/FileB2.txt (part 1 of 2)" Module
/ProjectA
72 svn_commit
"Test 2: Rename Module/ProjectA/FileA2.txt -> Module/ProjectB/FileB2.txt (part 2 of 2)" Module
/ProjectB
75 svn_commit
"Test 2: Rename Module/ProjectA/FileA2.txt -> Module/ProjectB/FileB3.txt"
77 # Test #3: Verify rename
78 BRANCH
="$REPOURL/branches/test3"
79 svn copy
-q -m "Create branch" $TRUNK $BRANCH
82 echo "Module/ProjectB/FileB2.txt (Test 3)" >> $WC/Module
/ProjectB
/FileB2.txt
83 svn_commit
"Test 3: Verify Module/ProjectB/FileB2.txt"
86 svn_commit
"Test 3: Verify Module/ProjectB/FileB2.txt"
88 # Test #4: Replace files
89 # * Test replace support
90 BRANCH
="$REPOURL/branches/test4"
91 svn copy
-q -m "Create branch" $TRUNK $BRANCH
94 svn
rm -q Module
/ProjectA
/FileA1.txt
95 echo "Module/ProjectA/FileA1.txt (Test 4 - Replaced)" > $WC/Module
/ProjectA
/FileA1.txt
96 svn add
-q Module
/ProjectA
/FileA1.txt
97 svn_commit
"Test 4: Replace Module/ProjectA/FileA1.txt"
100 svn_commit
"Test 4: Replace Module/ProjectA/FileA1.txt"
102 # Test #5: Rename files + folders
103 # * Test rename support
104 # * Create complex find-ancestors case, where files are renamed within a renamed folder on a branch
105 BRANCH
="$REPOURL/branches/test5"
106 svn copy
-q -m "Create branch" $TRUNK $BRANCH
107 svn switch
-q $BRANCH
109 svn
mv -q Module
/ProjectB Module
/ProjectC
110 svn
mv -q Module
/ProjectC
/FileB1.txt Module
/ProjectC
/FileC1.txt
111 echo "Module/ProjectC/FileC1.txt (Test 5)" >> $WC/Module
/ProjectC
/FileC1.txt
112 svn
mv -q Module
/ProjectC
/FileB2.txt Module
/ProjectC
/FileC2.txt
113 echo "Module/ProjectC/FileC2.txt (Test 5)" >> $WC/Module
/ProjectC
/FileC2.txt
114 svn_commit
"Test 5: Rename Module/ProjectB -> Module/ProjectC"
117 svn_commit
"Test 5: Rename Module/ProjectB -> Module/ProjectC"
119 # Test #6: Verify rename
120 BRANCH
="$REPOURL/branches/test6"
121 svn copy
-q -m "Create branch" $TRUNK $BRANCH
122 svn switch
-q $BRANCH
124 echo "Module/ProjectC/FileC1.txt (Test 6)" >> $WC/Module
/ProjectC
/FileC1.txt
125 echo "Module/ProjectC/FileC2.txt (Test 6)" >> $WC/Module
/ProjectC
/FileC2.txt
126 svn_commit
"Test 6: Verify Module/ProjectC/FileC*.txt"
129 svn_commit
"Test 6: Verify Module/ProjectC/FileC*.txt"
131 # Test #7: Rename files
132 # * Test rename support
133 # * Rename multiple files in the same folder
134 BRANCH
="$REPOURL/branches/test7"
135 svn copy
-q -m "Create branch" $TRUNK $BRANCH
136 svn switch
-q $BRANCH
138 svn
mv -q Module
/ProjectC
/FileC1.txt Module
/ProjectC
/FileC3.txt
139 echo "Module/ProjectC/FileC3.txt (Test 7)" >> $WC/Module
/ProjectC
/FileC3.txt
140 svn
mv -q Module
/ProjectC
/FileC2.txt Module
/ProjectC
/FileC4.txt
141 echo "Module/ProjectC/FileC4.txt (Test 7)" >> $WC/Module
/ProjectC
/FileC4.txt
142 svn_commit
"Test 7: Rename Module/ProjectC/FileC*.txt"
145 svn_commit
"Test 7: Rename Module/ProjectC/FileC*.txt"
147 # Test #8: Verify rename
148 BRANCH
="$REPOURL/branches/test8"
149 svn copy
-q -m "Create branch" $TRUNK $BRANCH
150 svn switch
-q $BRANCH
152 echo "Module/ProjectC/FileC3.txt (Test 8)" >> $WC/Module
/ProjectC
/FileC3.txt
153 echo "Module/ProjectC/FileC4.txt (Test 8)" >> $WC/Module
/ProjectC
/FileC4.txt
154 svn_commit
"Test 8: Verify Module/ProjectC/FileC*.txt"
157 svn_commit
"Test 8: Verify Module/ProjectC/FileC*.txt"
159 # Test #9: Copy from older revision
160 svn copy
-q -r 8 $TRUNK/Module
/ProjectA
/FileA2.txt@
8 $WC/Module
/ProjectA
/FileA2.txt
161 svn propdel
-q svn
:mergeinfo Module
/ProjectA
/FileA2.txt
162 svn_commit
"Test 9: Restore Module/ProjectA/FileA2.txt"
164 # Test #10: Verify copy
165 BRANCH
="$REPOURL/branches/test10"
166 svn copy
-q -m "Create branch" $TRUNK $BRANCH
167 svn switch
-q $BRANCH
169 echo "Module/ProjectA/FileA2.txt (Test 10)" >> $WC/Module
/ProjectA
/FileA2.txt
170 svn_commit
"Test 10: Verify Module/ProjectA/FileA2.txt"
173 svn_commit
"Test 10: Verify Module/ProjectA/FileA2.txt"
175 # Test #11: Rename files + folders, multiple chained renames
176 # * Test rename support
177 # * Create complicated find-ancestors case, where files/folders are renamed multiple times on branch
178 BRANCH
="$REPOURL/branches/test11"
179 svn copy
-q -m "Create branch" $TRUNK $BRANCH
180 svn switch
-q $BRANCH
182 svn
mv -q Module
/ProjectC Module
/ProjectD
183 svn
mv -q Module
/ProjectD
/FileC3.txt Module
/ProjectD
/FileD1.txt
184 echo "Module/ProjectD/FileD1.txt (Test 11)" >> $WC/Module
/ProjectD
/FileD1.txt
185 svn
mv -q Module
/ProjectD
/FileC4.txt Module
/ProjectD
/FileD2.txt
186 echo "Module/ProjectD/FileD2.txt (Test 11)" >> $WC/Module
/ProjectD
/FileD2.txt
187 svn_commit
"Test 11: Rename Module/ProjectC -> Module/ProjectD (part 1 of 2)" Module
/ProjectC Module
/ProjectD
/FileC3.txt Module
/ProjectD
/FileC4.txt
188 svn_commit
"Test 11: Rename Module/ProjectC -> Module/ProjectD (part 2 of 2)"
189 BRANCH
="$REPOURL/branches/test11-1"
190 svn copy
-q -m "Create branch" $TRUNK $BRANCH
191 svn switch
-q $BRANCH
193 svn merge
-q $REPOURL/branches
/test11
194 svn_commit
"Test 11: Re-branch"
195 svn
mv -q Module
/ProjectD Module
/ProjectE
196 svn
mv -q Module
/ProjectE
/FileD1.txt Module
/ProjectE
/FileE1.txt
197 echo "Module/ProjectE/FileE1.txt (Test 11-1)" >> $WC/Module
/ProjectE
/FileE1.txt
198 svn
mv -q Module
/ProjectE
/FileD2.txt Module
/ProjectE
/FileE2.txt
199 echo "Module/ProjectE/FileE2.txt (Test 11-1)" >> $WC/Module
/ProjectE
/FileE2.txt
200 svn_commit
"Test 11: Rename Module/ProjectD -> Module/ProjectE (part 1 of 2)" Module
/ProjectD Module
/ProjectE
/FileD1.txt Module
/ProjectE
/FileD2.txt
201 svn_commit
"Test 11: Rename Module/ProjectD -> Module/ProjectE (part 2 of 2)"
204 svn_commit
"Test 11: Rename Module/ProjectC -> Module/ProjectE"
206 # Test #12: Verify renames
207 BRANCH
="$REPOURL/branches/test12"
208 svn copy
-q -m "Create branch" $TRUNK $BRANCH
209 svn switch
-q $BRANCH
211 echo "Module/ProjectE/FileE1.txt (Test 12)" >> $WC/Module
/ProjectE
/FileE1.txt
212 echo "Module/ProjectE/FileE2.txt (Test 12)" >> $WC/Module
/ProjectE
/FileE2.txt
213 svn_commit
"Test 12: Verify Module/ProjectE/FileE*.txt"
216 svn_commit
"Test 12: Verify Module/ProjectE/FileE*.txt"
218 # Test #13: Replaces and add's inside a parent renamed folder.
219 BRANCH
="$REPOURL/branches/test13"
220 svn copy
-q -m "Create branch" $TRUNK $BRANCH
221 svn switch
-q $BRANCH
223 svn copy
-q Module
/ProjectA Module
/ProjectB
224 echo "Module/ProjectB/FileA1.txt (Test 13-1)" >> $WC/Module
/ProjectB
/FileA1.txt
225 echo "Module/ProjectB/FileA2.txt (Test 13-1)" >> $WC/Module
/ProjectB
/FileA2.txt
226 svn_commit
"Test 13: Copy Module/ProjectA -> Module/ProjectB"
227 svn
mv -q Module
/ProjectB
/FileA1.txt Module
/ProjectB
/FileB1.txt
228 echo "Module/ProjectB/FileB1.txt (Test 13-2)" >> $WC/Module
/ProjectB
/FileB1.txt
229 svn
mv -q Module
/ProjectB
/FileA2.txt Module
/ProjectB
/FileB2.txt
230 echo "Module/ProjectB/FileB2.txt (Test 13-2)" >> $WC/Module
/ProjectB
/FileB2.txt
231 svn_commit
"Test 13: Rename Module/ProjectB/FileA*.txt -> FileB*.txt"
232 svn copy
-q Module
/ProjectB
/FileB2.txt Module
/ProjectB
/FileB3.txt
233 echo "Module/ProjectB/FileB3.txt (Test 13-3)" >> $WC/Module
/ProjectB
/FileB3.txt
234 svn
rm -q Module
/ProjectB
/FileB1.txt
235 echo "Module/ProjectB/FileB1.txt (Test 13-3 - Replaced)" >> $WC/Module
/ProjectB
/FileB1.txt
236 svn add
-q Module
/ProjectB
/FileB1.txt
237 svn_commit
"Test 13: Edits to Module/ProjectB/FileB*.txt"
240 svn_commit
"Test 13: Create Module/ProjectB from Module/ProjectA"
242 # Test #14: Verify renames
243 BRANCH
="$REPOURL/branches/test14"
244 svn copy
-q -m "Create branch" $TRUNK $BRANCH
245 svn switch
-q $BRANCH
247 echo "Module/ProjectB/FileB1.txt (Test 14)" >> $WC/Module
/ProjectB
/FileB1.txt
248 echo "Module/ProjectB/FileB2.txt (Test 14)" >> $WC/Module
/ProjectB
/FileB2.txt
249 echo "Module/ProjectB/FileB3.txt (Test 14)" >> $WC/Module
/ProjectB
/FileB3.txt
250 svn_commit
"Test 14: Verify Module/ProjectB/FileB*.txt"
253 svn_commit
"Test 14: Verify Module/ProjectB/FileB*.txt"
255 # Test #15: Replace copy-from
256 BRANCH
="$REPOURL/branches/test15"
257 svn copy
-q -m "Create branch" $TRUNK $BRANCH
258 svn switch
-q $BRANCH
260 svn
rm -q Module
/ProjectB
/FileB2.txt
261 svn copy
-q -r 22 $TRUNK/Module
/ProjectC
/FileC1.txt@
22 Module
/ProjectB
/FileB2.txt
262 echo "Module/ProjectB/FileB2.txt (Test 15 - Replaced)" >> $WC/Module
/ProjectB
/FileB2.txt
263 svn_commit
"Test 15: Replace Module/ProjectB/FileB2.txt from earlier Module/ProjectC/FileC1.txt"
266 svn_commit
"Test 15: Replace Module/ProjectB/FileB2.txt from earlier Module/ProjectC/FileC1.txt"
268 # Test #16: Verify replace
269 BRANCH
="$REPOURL/branches/test16"
270 svn copy
-q -m "Create branch" $TRUNK $BRANCH
271 svn switch
-q $BRANCH
273 echo "Module/ProjectB/FileB2.txt (Test 16)" >> $WC/Module
/ProjectB
/FileB2.txt
274 svn_commit
"Test 16: Verify Module/ProjectB/FileB2.txt"
277 svn_commit
"Test 16: Verify Module/ProjectB/FileB2.txt"
279 # Test #17: Copy-from replaces and add's inside top-level initial-add folder
280 BRANCH
="$REPOURL/branches/test17"
281 svn copy
-q -m "Create branch" $TRUNK $BRANCH
282 svn switch
-q $BRANCH
285 svn copy
-q Module
/ProjectB Module
2/ProjectB
286 echo "Module2/ProjectB/FileB1.txt (Test 17-1)" >> $WC/Module
2/ProjectB
/FileB1.txt
287 echo "Module2/ProjectB/FileB2.txt (Test 17-1)" >> $WC/Module
2/ProjectB
/FileB2.txt
288 echo "Module2/ProjectB/FileB3.txt (Test 17-1)" >> $WC/Module
2/ProjectB
/FileB3.txt
289 svn_commit
"Test 17: Copy Module/ProjectB -> Module2/ProjectB"
290 svn
rm -q Module
2/ProjectB
/FileB1.txt
291 svn copy
-q -r 22 $TRUNK/Module
/ProjectC
/FileC2.txt@
22 Module
2/ProjectB
/FileB1.txt
292 echo "Module2/ProjectB/FileB1.txt (Test 17-2)" >> $WC/Module
2/ProjectB
/FileB1.txt
293 svn_commit
"Test 17: Replace Module2/ProjectB/FileB1.txt from earlier Module/ProjectC/FileC2.txt"
296 svn_commit
"Test 17: Create Module2/ProjectB from Module/ProjectB"
299 echo "Cleaning-up..."