Show More
@@ -1,56 +1,53 | |||
|
1 | 1 | #require svn13 |
|
2 | 2 | |
|
3 | 3 | $ cat <<EOF >> $HGRCPATH |
|
4 | 4 | > [extensions] |
|
5 | 5 | > mq = |
|
6 | 6 | > [diff] |
|
7 | 7 | > nodates = 1 |
|
8 | 8 | > EOF |
|
9 | 9 | |
|
10 | 10 | fn to create new repository, and cd into it |
|
11 | 11 | $ mkrepo() { |
|
12 | 12 | > hg init $1 |
|
13 | 13 | > cd $1 |
|
14 | 14 | > hg qinit |
|
15 | 15 | > } |
|
16 | 16 | |
|
17 | 17 | |
|
18 | 18 | handle svn subrepos safely |
|
19 | 19 | |
|
20 | 20 | $ svnadmin create svn-repo-2499 |
|
21 | 21 | |
|
22 | 22 | $ SVNREPOPATH=`pwd`/svn-repo-2499/project |
|
23 | 23 | #if windows |
|
24 | 24 | $ SVNREPOURL=file:///`$PYTHON -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"` |
|
25 | 25 | #else |
|
26 | 26 | $ SVNREPOURL=file://`$PYTHON -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"` |
|
27 | 27 | #endif |
|
28 | 28 | |
|
29 | 29 | $ mkdir -p svn-project-2499/trunk |
|
30 | $ svn import -m 'init project' svn-project-2499 "$SVNREPOURL" | |
|
31 | Adding svn-project-2499/trunk (glob) | |
|
32 | ||
|
33 | Committed revision 1. | |
|
30 | $ svn import -qm 'init project' svn-project-2499 "$SVNREPOURL" | |
|
34 | 31 | |
|
35 | 32 | qnew on repo w/svn subrepo |
|
36 | 33 | $ mkrepo repo-2499-svn-subrepo |
|
37 | 34 | $ svn co "$SVNREPOURL"/trunk sub |
|
38 | 35 | Checked out revision 1. |
|
39 | 36 | $ echo 'sub = [svn]sub' >> .hgsub |
|
40 | 37 | $ hg add .hgsub |
|
41 | 38 | $ hg status -S -X '**/format' |
|
42 | 39 | A .hgsub |
|
43 | 40 | $ hg qnew -m0 0.diff |
|
44 | 41 | $ cd sub |
|
45 | 42 | $ echo a > a |
|
46 | 43 | $ svn add a |
|
47 | 44 | A a |
|
48 | 45 | $ svn st |
|
49 | 46 | A* a (glob) |
|
50 | 47 | $ cd .. |
|
51 | 48 | $ hg status -S # doesn't show status for svn subrepos (yet) |
|
52 | 49 | $ hg qnew -m1 1.diff |
|
53 | 50 | abort: uncommitted changes in subrepository 'sub' |
|
54 | 51 | [255] |
|
55 | 52 | |
|
56 | 53 | $ cd .. |
@@ -1,687 +1,643 | |||
|
1 | 1 | #require svn15 |
|
2 | 2 | |
|
3 | 3 | $ SVNREPOPATH=`pwd`/svn-repo |
|
4 | 4 | #if windows |
|
5 | 5 | $ SVNREPOURL=file:///`$PYTHON -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"` |
|
6 | 6 | #else |
|
7 | 7 | $ SVNREPOURL=file://`$PYTHON -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"` |
|
8 | 8 | #endif |
|
9 | 9 | |
|
10 | $ filter_svn_output () { | |
|
11 | > egrep -v 'Committing|Transmitting|Updating' || true | |
|
12 | > } | |
|
13 | ||
|
10 | 14 | create subversion repo |
|
11 | 15 | |
|
12 | 16 | $ WCROOT="`pwd`/svn-wc" |
|
13 | 17 | $ svnadmin create svn-repo |
|
14 | 18 | $ svn co "$SVNREPOURL" svn-wc |
|
15 | 19 | Checked out revision 0. |
|
16 | 20 | $ cd svn-wc |
|
17 | 21 | $ mkdir src |
|
18 | 22 | $ echo alpha > src/alpha |
|
19 | 23 | $ svn add src |
|
20 | 24 | A src |
|
21 | 25 | A src/alpha (glob) |
|
22 | 26 | $ mkdir externals |
|
23 | 27 | $ echo other > externals/other |
|
24 | 28 | $ svn add externals |
|
25 | 29 | A externals |
|
26 | 30 | A externals/other (glob) |
|
27 | $ svn ci -m 'Add alpha' | |
|
28 | Adding externals | |
|
29 | Adding externals/other (glob) | |
|
30 | Adding src | |
|
31 | Adding src/alpha (glob) | |
|
32 | Transmitting file data .. | |
|
33 | Committed revision 1. | |
|
31 | $ svn ci -qm 'Add alpha' | |
|
34 | 32 | $ svn up -q |
|
35 | 33 | $ echo "externals -r1 $SVNREPOURL/externals" > extdef |
|
36 | 34 | $ svn propset -F extdef svn:externals src |
|
37 | 35 | property 'svn:externals' set on 'src' |
|
38 | $ svn ci -m 'Setting externals' | |
|
39 | Sending src | |
|
40 | ||
|
41 | Committed revision 2. | |
|
36 | $ svn ci -qm 'Setting externals' | |
|
42 | 37 | $ cd .. |
|
43 | 38 | |
|
44 | 39 | create hg repo |
|
45 | 40 | |
|
46 | 41 | $ mkdir sub |
|
47 | 42 | $ cd sub |
|
48 | 43 | $ hg init t |
|
49 | 44 | $ cd t |
|
50 | 45 | |
|
51 | 46 | first revision, no sub |
|
52 | 47 | |
|
53 | 48 | $ echo a > a |
|
54 | 49 | $ hg ci -Am0 |
|
55 | 50 | adding a |
|
56 | 51 | |
|
57 | 52 | add first svn sub with leading whitespaces |
|
58 | 53 | |
|
59 | 54 | $ echo "s = [svn] $SVNREPOURL/src" >> .hgsub |
|
60 | 55 | $ echo "subdir/s = [svn] $SVNREPOURL/src" >> .hgsub |
|
61 | 56 | $ svn co --quiet "$SVNREPOURL"/src s |
|
62 | 57 | $ mkdir subdir |
|
63 | 58 | $ svn co --quiet "$SVNREPOURL"/src subdir/s |
|
64 | 59 | $ hg add .hgsub |
|
65 | 60 | $ hg ci -m1 |
|
66 | 61 | |
|
67 | 62 | make sure we avoid empty commits (issue2445) |
|
68 | 63 | |
|
69 | 64 | $ hg sum |
|
70 | 65 | parent: 1:* tip (glob) |
|
71 | 66 | 1 |
|
72 | 67 | branch: default |
|
73 | 68 | commit: (clean) |
|
74 | 69 | update: (current) |
|
75 | 70 | phases: 2 draft |
|
76 | 71 | $ hg ci -moops |
|
77 | 72 | nothing changed |
|
78 | 73 | [1] |
|
79 | 74 | |
|
80 | 75 | debugsub |
|
81 | 76 | |
|
82 | 77 | $ hg debugsub |
|
83 | 78 | path s |
|
84 | 79 | source file://*/svn-repo/src (glob) |
|
85 | 80 | revision 2 |
|
86 | 81 | path subdir/s |
|
87 | 82 | source file://*/svn-repo/src (glob) |
|
88 | 83 | revision 2 |
|
89 | 84 | |
|
90 | 85 | change file in svn and hg, commit |
|
91 | 86 | |
|
92 | 87 | $ echo a >> a |
|
93 | 88 | $ echo alpha >> s/alpha |
|
94 | 89 | $ hg sum |
|
95 | 90 | parent: 1:* tip (glob) |
|
96 | 91 | 1 |
|
97 | 92 | branch: default |
|
98 | 93 | commit: 1 modified, 1 subrepos |
|
99 | 94 | update: (current) |
|
100 | 95 | phases: 2 draft |
|
101 |
$ hg commit --subrepos -m 'Message!' | |
|
|
96 | $ hg commit --subrepos -m 'Message!' | filter_svn_output | |
|
102 | 97 | committing subrepository s |
|
103 | 98 | Sending*s/alpha (glob) |
|
104 | Transmitting file data . | |
|
105 | 99 | Committed revision 3. |
|
106 | 100 | |
|
107 | 101 | Fetching external item into '*s/externals'* (glob) |
|
108 | 102 | External at revision 1. |
|
109 | 103 | |
|
110 | 104 | At revision 3. |
|
111 | 105 | $ hg debugsub |
|
112 | 106 | path s |
|
113 | 107 | source file://*/svn-repo/src (glob) |
|
114 | 108 | revision 3 |
|
115 | 109 | path subdir/s |
|
116 | 110 | source file://*/svn-repo/src (glob) |
|
117 | 111 | revision 2 |
|
118 | 112 | |
|
119 | 113 | missing svn file, commit should fail |
|
120 | 114 | |
|
121 | 115 | $ rm s/alpha |
|
122 | 116 | $ hg commit --subrepos -m 'abort on missing file' |
|
123 | 117 | committing subrepository s |
|
124 | 118 | abort: cannot commit missing svn entries (in subrepo s) |
|
125 | 119 | [255] |
|
126 | 120 | $ svn revert s/alpha > /dev/null |
|
127 | 121 | |
|
128 | 122 | add an unrelated revision in svn and update the subrepo to without |
|
129 | 123 | bringing any changes. |
|
130 | 124 | |
|
131 | $ svn mkdir "$SVNREPOURL/unrelated" -m 'create unrelated' | |
|
132 | ||
|
133 | Committed revision 4. | |
|
125 | $ svn mkdir "$SVNREPOURL/unrelated" -qm 'create unrelated' | |
|
134 | 126 | $ svn up -q s |
|
135 | 127 | $ hg sum |
|
136 | 128 | parent: 2:* tip (glob) |
|
137 | 129 | Message! |
|
138 | 130 | branch: default |
|
139 | 131 | commit: (clean) |
|
140 | 132 | update: (current) |
|
141 | 133 | phases: 3 draft |
|
142 | 134 | |
|
143 | 135 | $ echo a > s/a |
|
144 | 136 | |
|
145 | 137 | should be empty despite change to s/a |
|
146 | 138 | |
|
147 | 139 | $ hg st |
|
148 | 140 | |
|
149 | 141 | add a commit from svn |
|
150 | 142 | |
|
151 | 143 | $ cd "$WCROOT/src" |
|
152 | 144 | $ svn up -q |
|
153 | 145 | $ echo xyz >> alpha |
|
154 | 146 | $ svn propset svn:mime-type 'text/xml' alpha |
|
155 | 147 | property 'svn:mime-type' set on 'alpha' |
|
156 | $ svn ci -m 'amend a from svn' | |
|
157 | Sending *alpha (glob) | |
|
158 | Transmitting file data . | |
|
159 | Committed revision 5. | |
|
148 | $ svn ci -qm 'amend a from svn' | |
|
160 | 149 | $ cd ../../sub/t |
|
161 | 150 | |
|
162 | 151 | this commit from hg will fail |
|
163 | 152 | |
|
164 | 153 | $ echo zzz >> s/alpha |
|
165 | 154 | $ (hg ci --subrepos -m 'amend alpha from hg' 2>&1; echo "[$?]") | grep -vi 'out of date' |
|
166 | 155 | committing subrepository s |
|
167 | 156 | abort: svn:*Commit failed (details follow): (glob) |
|
168 | 157 | [255] |
|
169 | 158 | $ svn revert -q s/alpha |
|
170 | 159 | |
|
171 | 160 | this commit fails because of meta changes |
|
172 | 161 | |
|
173 | 162 | $ svn propset svn:mime-type 'text/html' s/alpha |
|
174 | 163 | property 'svn:mime-type' set on 's/alpha' (glob) |
|
175 | 164 | $ (hg ci --subrepos -m 'amend alpha from hg' 2>&1; echo "[$?]") | grep -vi 'out of date' |
|
176 | 165 | committing subrepository s |
|
177 | 166 | abort: svn:*Commit failed (details follow): (glob) |
|
178 | 167 | [255] |
|
179 | 168 | $ svn revert -q s/alpha |
|
180 | 169 | |
|
181 | 170 | this commit fails because of externals changes |
|
182 | 171 | |
|
183 | 172 | $ echo zzz > s/externals/other |
|
184 | 173 | $ hg ci --subrepos -m 'amend externals from hg' |
|
185 | 174 | committing subrepository s |
|
186 | 175 | abort: cannot commit svn externals (in subrepo s) |
|
187 | 176 | [255] |
|
188 | 177 | $ hg diff --subrepos -r 1:2 | grep -v diff |
|
189 | 178 | --- a/.hgsubstate Thu Jan 01 00:00:00 1970 +0000 |
|
190 | 179 | +++ b/.hgsubstate Thu Jan 01 00:00:00 1970 +0000 |
|
191 | 180 | @@ -1,2 +1,2 @@ |
|
192 | 181 | -2 s |
|
193 | 182 | +3 s |
|
194 | 183 | 2 subdir/s |
|
195 | 184 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
196 | 185 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 |
|
197 | 186 | @@ -1,1 +1,2 @@ |
|
198 | 187 | a |
|
199 | 188 | +a |
|
200 | 189 | $ svn revert -q s/externals/other |
|
201 | 190 | |
|
202 | 191 | this commit fails because of externals meta changes |
|
203 | 192 | |
|
204 | 193 | $ svn propset svn:mime-type 'text/html' s/externals/other |
|
205 | 194 | property 'svn:mime-type' set on 's/externals/other' (glob) |
|
206 | 195 | $ hg ci --subrepos -m 'amend externals from hg' |
|
207 | 196 | committing subrepository s |
|
208 | 197 | abort: cannot commit svn externals (in subrepo s) |
|
209 | 198 | [255] |
|
210 | 199 | $ svn revert -q s/externals/other |
|
211 | 200 | |
|
212 | 201 | clone |
|
213 | 202 | |
|
214 | 203 | $ cd .. |
|
215 | 204 | $ hg clone t tc |
|
216 | 205 | updating to branch default |
|
217 | 206 | A tc/s/alpha (glob) |
|
218 | 207 | U tc/s (glob) |
|
219 | 208 | |
|
220 | 209 | Fetching external item into 'tc/s/externals'* (glob) |
|
221 | 210 | A tc/s/externals/other (glob) |
|
222 | 211 | Checked out external at revision 1. |
|
223 | 212 | |
|
224 | 213 | Checked out revision 3. |
|
225 | 214 | A tc/subdir/s/alpha (glob) |
|
226 | 215 | U tc/subdir/s (glob) |
|
227 | 216 | |
|
228 | 217 | Fetching external item into 'tc/subdir/s/externals'* (glob) |
|
229 | 218 | A tc/subdir/s/externals/other (glob) |
|
230 | 219 | Checked out external at revision 1. |
|
231 | 220 | |
|
232 | 221 | Checked out revision 2. |
|
233 | 222 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
234 | 223 | $ cd tc |
|
235 | 224 | |
|
236 | 225 | debugsub in clone |
|
237 | 226 | |
|
238 | 227 | $ hg debugsub |
|
239 | 228 | path s |
|
240 | 229 | source file://*/svn-repo/src (glob) |
|
241 | 230 | revision 3 |
|
242 | 231 | path subdir/s |
|
243 | 232 | source file://*/svn-repo/src (glob) |
|
244 | 233 | revision 2 |
|
245 | 234 | |
|
246 | 235 | verify subrepo is contained within the repo directory |
|
247 | 236 | |
|
248 | 237 | $ $PYTHON -c "import os.path; print os.path.exists('s')" |
|
249 | 238 | True |
|
250 | 239 | |
|
251 | 240 | update to nullrev (must delete the subrepo) |
|
252 | 241 | |
|
253 | 242 | $ hg up null |
|
254 | 243 | 0 files updated, 0 files merged, 3 files removed, 0 files unresolved |
|
255 | 244 | $ ls |
|
256 | 245 | |
|
257 | 246 | Check hg update --clean |
|
258 | 247 | $ cd "$TESTTMP/sub/t" |
|
259 | 248 | $ cd s |
|
260 | 249 | $ echo c0 > alpha |
|
261 | 250 | $ echo c1 > f1 |
|
262 | 251 | $ echo c1 > f2 |
|
263 | 252 | $ svn add f1 -q |
|
264 | 253 | $ svn status | sort |
|
265 | 254 | |
|
266 | 255 | ? * a (glob) |
|
267 | 256 | ? * f2 (glob) |
|
268 | 257 | A * f1 (glob) |
|
269 | 258 | M * alpha (glob) |
|
270 | 259 | Performing status on external item at 'externals'* (glob) |
|
271 | 260 | X * externals (glob) |
|
272 | 261 | $ cd ../.. |
|
273 | 262 | $ hg -R t update -C |
|
274 | 263 | |
|
275 | 264 | Fetching external item into 't/s/externals'* (glob) |
|
276 | 265 | Checked out external at revision 1. |
|
277 | 266 | |
|
278 | 267 | Checked out revision 3. |
|
279 | 268 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
280 | 269 | $ cd t/s |
|
281 | 270 | $ svn status | sort |
|
282 | 271 | |
|
283 | 272 | ? * a (glob) |
|
284 | 273 | ? * f1 (glob) |
|
285 | 274 | ? * f2 (glob) |
|
286 | 275 | Performing status on external item at 'externals'* (glob) |
|
287 | 276 | X * externals (glob) |
|
288 | 277 | |
|
289 | 278 | Sticky subrepositories, no changes |
|
290 | 279 | $ cd "$TESTTMP/sub/t" |
|
291 | 280 | $ hg id -n |
|
292 | 281 | 2 |
|
293 | 282 | $ cd s |
|
294 | 283 | $ svnversion |
|
295 | 284 | 3 |
|
296 | 285 | $ cd .. |
|
297 | 286 | $ hg update 1 |
|
298 | 287 | U *s/alpha (glob) |
|
299 | 288 | |
|
300 | 289 | Fetching external item into '*s/externals'* (glob) |
|
301 | 290 | Checked out external at revision 1. |
|
302 | 291 | |
|
303 | 292 | Checked out revision 2. |
|
304 | 293 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
305 | 294 | $ hg id -n |
|
306 | 295 | 1 |
|
307 | 296 | $ cd s |
|
308 | 297 | $ svnversion |
|
309 | 298 | 2 |
|
310 | 299 | $ cd .. |
|
311 | 300 | |
|
312 | 301 | Sticky subrepositories, file changes |
|
313 | 302 | $ touch s/f1 |
|
314 | 303 | $ cd s |
|
315 | 304 | $ svn add f1 |
|
316 | 305 | A f1 |
|
317 | 306 | $ cd .. |
|
318 | 307 | $ hg id -n |
|
319 | 308 | 1+ |
|
320 | 309 | $ cd s |
|
321 | 310 | $ svnversion |
|
322 | 311 | 2M |
|
323 | 312 | $ cd .. |
|
324 | 313 | $ hg update tip |
|
325 | 314 | subrepository s diverged (local revision: 2, remote revision: 3) |
|
326 | 315 | (M)erge, keep (l)ocal or keep (r)emote? m |
|
327 | 316 | subrepository sources for s differ |
|
328 | 317 | use (l)ocal source (2) or (r)emote source (3)? l |
|
329 | 318 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
330 | 319 | $ hg id -n |
|
331 | 320 | 2+ |
|
332 | 321 | $ cd s |
|
333 | 322 | $ svnversion |
|
334 | 323 | 2M |
|
335 | 324 | $ cd .. |
|
336 | 325 | $ hg update --clean tip |
|
337 | 326 | U *s/alpha (glob) |
|
338 | 327 | |
|
339 | 328 | Fetching external item into '*s/externals'* (glob) |
|
340 | 329 | Checked out external at revision 1. |
|
341 | 330 | |
|
342 | 331 | Checked out revision 3. |
|
343 | 332 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
344 | 333 | |
|
345 | 334 | Sticky subrepository, revision updates |
|
346 | 335 | $ hg id -n |
|
347 | 336 | 2 |
|
348 | 337 | $ cd s |
|
349 | 338 | $ svnversion |
|
350 | 339 | 3 |
|
351 | 340 | $ cd .. |
|
352 | 341 | $ cd s |
|
353 | 342 | $ svn update -qr 1 |
|
354 | 343 | $ cd .. |
|
355 | 344 | $ hg update 1 |
|
356 | 345 | subrepository s diverged (local revision: 3, remote revision: 2) |
|
357 | 346 | (M)erge, keep (l)ocal or keep (r)emote? m |
|
358 | 347 | subrepository sources for s differ (in checked out version) |
|
359 | 348 | use (l)ocal source (1) or (r)emote source (2)? l |
|
360 | 349 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
361 | 350 | $ hg id -n |
|
362 | 351 | 1+ |
|
363 | 352 | $ cd s |
|
364 | 353 | $ svnversion |
|
365 | 354 | 1 |
|
366 | 355 | $ cd .. |
|
367 | 356 | |
|
368 | 357 | Sticky subrepository, file changes and revision updates |
|
369 | 358 | $ touch s/f1 |
|
370 | 359 | $ cd s |
|
371 | 360 | $ svn add f1 |
|
372 | 361 | A f1 |
|
373 | 362 | $ svnversion |
|
374 | 363 | 1M |
|
375 | 364 | $ cd .. |
|
376 | 365 | $ hg id -n |
|
377 | 366 | 1+ |
|
378 | 367 | $ hg update tip |
|
379 | 368 | subrepository s diverged (local revision: 3, remote revision: 3) |
|
380 | 369 | (M)erge, keep (l)ocal or keep (r)emote? m |
|
381 | 370 | subrepository sources for s differ |
|
382 | 371 | use (l)ocal source (1) or (r)emote source (3)? l |
|
383 | 372 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
384 | 373 | $ hg id -n |
|
385 | 374 | 2+ |
|
386 | 375 | $ cd s |
|
387 | 376 | $ svnversion |
|
388 | 377 | 1M |
|
389 | 378 | $ cd .. |
|
390 | 379 | |
|
391 | 380 | Sticky repository, update --clean |
|
392 | 381 | $ hg update --clean tip | grep -v 's[/\]externals[/\]other' |
|
393 | 382 | U *s/alpha (glob) |
|
394 | 383 | U *s (glob) |
|
395 | 384 | |
|
396 | 385 | Fetching external item into '*s/externals'* (glob) |
|
397 | 386 | Checked out external at revision 1. |
|
398 | 387 | |
|
399 | 388 | Checked out revision 3. |
|
400 | 389 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
401 | 390 | $ hg id -n |
|
402 | 391 | 2 |
|
403 | 392 | $ cd s |
|
404 | 393 | $ svnversion |
|
405 | 394 | 3 |
|
406 | 395 | $ cd .. |
|
407 | 396 | |
|
408 | 397 | Test subrepo already at intended revision: |
|
409 | 398 | $ cd s |
|
410 | 399 | $ svn update -qr 2 |
|
411 | 400 | $ cd .. |
|
412 | 401 | $ hg update 1 |
|
413 | 402 | subrepository s diverged (local revision: 3, remote revision: 2) |
|
414 | 403 | (M)erge, keep (l)ocal or keep (r)emote? m |
|
415 | 404 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
416 | 405 | $ hg id -n |
|
417 | 406 | 1+ |
|
418 | 407 | $ cd s |
|
419 | 408 | $ svnversion |
|
420 | 409 | 2 |
|
421 | 410 | $ cd .. |
|
422 | 411 | |
|
423 | 412 | Test case where subversion would fail to update the subrepo because there |
|
424 | 413 | are unknown directories being replaced by tracked ones (happens with rebase). |
|
425 | 414 | |
|
426 | 415 | $ cd "$WCROOT/src" |
|
427 | 416 | $ mkdir dir |
|
428 | 417 | $ echo epsilon.py > dir/epsilon.py |
|
429 | 418 | $ svn add dir |
|
430 | 419 | A dir |
|
431 | 420 | A dir/epsilon.py (glob) |
|
432 | $ svn ci -m 'Add dir/epsilon.py' | |
|
433 | Adding *dir (glob) | |
|
434 | Adding *dir/epsilon.py (glob) | |
|
435 | Transmitting file data . | |
|
436 | Committed revision 6. | |
|
421 | $ svn ci -qm 'Add dir/epsilon.py' | |
|
437 | 422 | $ cd ../.. |
|
438 | 423 | $ hg init rebaserepo |
|
439 | 424 | $ cd rebaserepo |
|
440 | 425 | $ svn co -r5 --quiet "$SVNREPOURL"/src s |
|
441 | 426 | $ echo "s = [svn] $SVNREPOURL/src" >> .hgsub |
|
442 | 427 | $ hg add .hgsub |
|
443 | 428 | $ hg ci -m addsub |
|
444 | 429 | $ echo a > a |
|
445 | 430 | $ hg add . |
|
446 | 431 | adding a |
|
447 | 432 | $ hg ci -m adda |
|
448 | 433 | $ hg up 0 |
|
449 | 434 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
450 | 435 | $ svn up -qr6 s |
|
451 | 436 | $ hg ci -m updatesub |
|
452 | 437 | created new head |
|
453 | 438 | $ echo pyc > s/dir/epsilon.pyc |
|
454 | 439 | $ hg up 1 |
|
455 | 440 | D *s/dir (glob) |
|
456 | 441 | |
|
457 | 442 | Fetching external item into '*s/externals'* (glob) |
|
458 | 443 | Checked out external at revision 1. |
|
459 | 444 | |
|
460 | 445 | Checked out revision 5. |
|
461 | 446 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
462 | 447 | $ hg up -q 2 |
|
463 | 448 | |
|
464 | 449 | Modify one of the externals to point to a different path so we can |
|
465 | 450 | test having obstructions when switching branches on checkout: |
|
466 | 451 | $ hg checkout tip |
|
467 | 452 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
468 | 453 | $ echo "obstruct = [svn] $SVNREPOURL/externals" >> .hgsub |
|
469 | 454 | $ svn co -r5 --quiet "$SVNREPOURL"/externals obstruct |
|
470 | 455 | $ hg commit -m 'Start making obstructed working copy' |
|
471 | 456 | $ hg book other |
|
472 | 457 | $ hg co -r 'p1(tip)' |
|
473 | 458 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
474 | 459 | (leaving bookmark other) |
|
475 | 460 | $ echo "obstruct = [svn] $SVNREPOURL/src" >> .hgsub |
|
476 | 461 | $ svn co -r5 --quiet "$SVNREPOURL"/src obstruct |
|
477 | 462 | $ hg commit -m 'Other branch which will be obstructed' |
|
478 | 463 | created new head |
|
479 | 464 | |
|
480 | 465 | Switching back to the head where we have another path mapped to the |
|
481 | 466 | same subrepo should work if the subrepo is clean. |
|
482 | 467 | $ hg co other |
|
483 | 468 | A *obstruct/other (glob) |
|
484 | 469 | Checked out revision 1. |
|
485 | 470 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
486 | 471 | (activating bookmark other) |
|
487 | 472 | |
|
488 | 473 | This is surprising, but is also correct based on the current code: |
|
489 | 474 | $ echo "updating should (maybe) fail" > obstruct/other |
|
490 | 475 | $ hg co tip |
|
491 | 476 | abort: uncommitted changes |
|
492 | 477 | (commit or update --clean to discard changes) |
|
493 | 478 | [255] |
|
494 | 479 | |
|
495 | 480 | Point to a Subversion branch which has since been deleted and recreated |
|
496 | 481 | First, create that condition in the repository. |
|
497 | 482 | |
|
498 |
$ hg ci --subrepos -m cleanup | |
|
|
483 | $ hg ci --subrepos -m cleanup | filter_svn_output | |
|
499 | 484 | committing subrepository obstruct |
|
500 | 485 | Sending obstruct/other (glob) |
|
501 | Transmitting file data . | |
|
502 | 486 | Committed revision 7. |
|
503 | 487 | At revision 7. |
|
504 | $ svn mkdir -m "baseline" $SVNREPOURL/trunk | |
|
505 | ||
|
506 | Committed revision 8. | |
|
507 | $ svn copy -m "initial branch" $SVNREPOURL/trunk $SVNREPOURL/branch | |
|
508 | ||
|
509 | Committed revision 9. | |
|
488 | $ svn mkdir -qm "baseline" $SVNREPOURL/trunk | |
|
489 | $ svn copy -qm "initial branch" $SVNREPOURL/trunk $SVNREPOURL/branch | |
|
510 | 490 | $ svn co --quiet "$SVNREPOURL"/branch tempwc |
|
511 | 491 | $ cd tempwc |
|
512 | 492 | $ echo "something old" > somethingold |
|
513 | 493 | $ svn add somethingold |
|
514 | 494 | A somethingold |
|
515 | $ svn ci -m 'Something old' | |
|
516 | Adding somethingold | |
|
517 | Transmitting file data . | |
|
518 | Committed revision 10. | |
|
519 | $ svn rm -m "remove branch" $SVNREPOURL/branch | |
|
520 | ||
|
521 | Committed revision 11. | |
|
522 | $ svn copy -m "recreate branch" $SVNREPOURL/trunk $SVNREPOURL/branch | |
|
523 | ||
|
524 | Committed revision 12. | |
|
495 | $ svn ci -qm 'Something old' | |
|
496 | $ svn rm -qm "remove branch" $SVNREPOURL/branch | |
|
497 | $ svn copy -qm "recreate branch" $SVNREPOURL/trunk $SVNREPOURL/branch | |
|
525 | 498 | $ svn up -q |
|
526 | 499 | $ echo "something new" > somethingnew |
|
527 | 500 | $ svn add somethingnew |
|
528 | 501 | A somethingnew |
|
529 | $ svn ci -m 'Something new' | |
|
530 | Adding somethingnew | |
|
531 | Transmitting file data . | |
|
532 | Committed revision 13. | |
|
502 | $ svn ci -qm 'Something new' | |
|
533 | 503 | $ cd .. |
|
534 | 504 | $ rm -rf tempwc |
|
535 | 505 | $ svn co "$SVNREPOURL/branch"@10 recreated |
|
536 | 506 | A recreated/somethingold (glob) |
|
537 | 507 | Checked out revision 10. |
|
538 | 508 | $ echo "recreated = [svn] $SVNREPOURL/branch" >> .hgsub |
|
539 | 509 | $ hg ci -m addsub |
|
540 | 510 | $ cd recreated |
|
541 | 511 | $ svn up -q |
|
542 | 512 | $ cd .. |
|
543 | 513 | $ hg ci -m updatesub |
|
544 | 514 | $ hg up -r-2 |
|
545 | 515 | D *recreated/somethingnew (glob) |
|
546 | 516 | A *recreated/somethingold (glob) |
|
547 | 517 | Checked out revision 10. |
|
548 | 518 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
549 | 519 | (leaving bookmark other) |
|
550 | 520 | $ test -f recreated/somethingold |
|
551 | 521 | |
|
552 | 522 | Test archive |
|
553 | 523 | |
|
554 | 524 | $ hg archive -S ../archive-all --debug --config progress.debug=true |
|
555 | 525 | archiving: 0/2 files (0.00%) |
|
556 | 526 | archiving: .hgsub 1/2 files (50.00%) |
|
557 | 527 | archiving: .hgsubstate 2/2 files (100.00%) |
|
558 | 528 | archiving (obstruct): 0/1 files (0.00%) |
|
559 | 529 | archiving (obstruct): 1/1 files (100.00%) |
|
560 | 530 | archiving (recreated): 0/1 files (0.00%) |
|
561 | 531 | archiving (recreated): 1/1 files (100.00%) |
|
562 | 532 | archiving (s): 0/2 files (0.00%) |
|
563 | 533 | archiving (s): 1/2 files (50.00%) |
|
564 | 534 | archiving (s): 2/2 files (100.00%) |
|
565 | 535 | |
|
566 | 536 | $ hg archive -S ../archive-exclude --debug --config progress.debug=true -X **old |
|
567 | 537 | archiving: 0/2 files (0.00%) |
|
568 | 538 | archiving: .hgsub 1/2 files (50.00%) |
|
569 | 539 | archiving: .hgsubstate 2/2 files (100.00%) |
|
570 | 540 | archiving (obstruct): 0/1 files (0.00%) |
|
571 | 541 | archiving (obstruct): 1/1 files (100.00%) |
|
572 | 542 | archiving (recreated): 0 files |
|
573 | 543 | archiving (s): 0/2 files (0.00%) |
|
574 | 544 | archiving (s): 1/2 files (50.00%) |
|
575 | 545 | archiving (s): 2/2 files (100.00%) |
|
576 | 546 | $ find ../archive-exclude | sort |
|
577 | 547 | ../archive-exclude |
|
578 | 548 | ../archive-exclude/.hg_archival.txt |
|
579 | 549 | ../archive-exclude/.hgsub |
|
580 | 550 | ../archive-exclude/.hgsubstate |
|
581 | 551 | ../archive-exclude/obstruct |
|
582 | 552 | ../archive-exclude/obstruct/other |
|
583 | 553 | ../archive-exclude/s |
|
584 | 554 | ../archive-exclude/s/alpha |
|
585 | 555 | ../archive-exclude/s/dir |
|
586 | 556 | ../archive-exclude/s/dir/epsilon.py |
|
587 | 557 | |
|
588 | 558 | Test forgetting files, not implemented in svn subrepo, used to |
|
589 | 559 | traceback |
|
590 | 560 | |
|
591 | 561 | #if no-windows |
|
592 | 562 | $ hg forget 'notafile*' |
|
593 | 563 | notafile*: No such file or directory |
|
594 | 564 | [1] |
|
595 | 565 | #else |
|
596 | 566 | $ hg forget 'notafile' |
|
597 | 567 | notafile: * (glob) |
|
598 | 568 | [1] |
|
599 | 569 | #endif |
|
600 | 570 | |
|
601 | 571 | Test a subrepo referencing a just moved svn path. Last commit rev will |
|
602 | 572 | be different from the revision, and the path will be different as |
|
603 | 573 | well. |
|
604 | 574 | |
|
605 | 575 | $ cd "$WCROOT" |
|
606 | 576 | $ svn up > /dev/null |
|
607 | 577 | $ mkdir trunk/subdir branches |
|
608 | 578 | $ echo a > trunk/subdir/a |
|
609 | 579 | $ svn add trunk/subdir branches |
|
610 | 580 | A trunk/subdir (glob) |
|
611 | 581 | A trunk/subdir/a (glob) |
|
612 | 582 | A branches |
|
613 | $ svn ci -m addsubdir | |
|
614 | Adding branches | |
|
615 | Adding trunk/subdir (glob) | |
|
616 | Adding trunk/subdir/a (glob) | |
|
617 | Transmitting file data . | |
|
618 | Committed revision 14. | |
|
619 | $ svn cp -m branchtrunk $SVNREPOURL/trunk $SVNREPOURL/branches/somebranch | |
|
620 | ||
|
621 | Committed revision 15. | |
|
583 | $ svn ci -qm addsubdir | |
|
584 | $ svn cp -qm branchtrunk $SVNREPOURL/trunk $SVNREPOURL/branches/somebranch | |
|
622 | 585 | $ cd .. |
|
623 | 586 | |
|
624 | 587 | $ hg init repo2 |
|
625 | 588 | $ cd repo2 |
|
626 | 589 | $ svn co $SVNREPOURL/branches/somebranch/subdir |
|
627 | 590 | A subdir/a (glob) |
|
628 | 591 | Checked out revision 15. |
|
629 | 592 | $ echo "subdir = [svn] $SVNREPOURL/branches/somebranch/subdir" > .hgsub |
|
630 | 593 | $ hg add .hgsub |
|
631 | 594 | $ hg ci -m addsub |
|
632 | 595 | $ hg up null |
|
633 | 596 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
634 | 597 | $ hg up |
|
635 | 598 | A *subdir/a (glob) |
|
636 | 599 | Checked out revision 15. |
|
637 | 600 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
638 | 601 | $ cd .. |
|
639 | 602 | |
|
640 | 603 | Test sanitizing ".hg/hgrc" in subrepo |
|
641 | 604 | |
|
642 | 605 | $ cd sub/t |
|
643 | 606 | $ hg update -q -C tip |
|
644 | 607 | $ cd s |
|
645 | 608 | $ mkdir .hg |
|
646 | 609 | $ echo '.hg/hgrc in svn repo' > .hg/hgrc |
|
647 | 610 | $ mkdir -p sub/.hg |
|
648 | 611 | $ echo 'sub/.hg/hgrc in svn repo' > sub/.hg/hgrc |
|
649 | 612 | $ svn add .hg sub |
|
650 | 613 | A .hg |
|
651 | 614 | A .hg/hgrc (glob) |
|
652 | 615 | A sub |
|
653 | 616 | A sub/.hg (glob) |
|
654 | 617 | A sub/.hg/hgrc (glob) |
|
655 | $ svn ci -m 'add .hg/hgrc to be sanitized at hg update' | |
|
656 | Adding .hg | |
|
657 | Adding .hg/hgrc (glob) | |
|
658 | Adding sub | |
|
659 | Adding sub/.hg (glob) | |
|
660 | Adding sub/.hg/hgrc (glob) | |
|
661 | Transmitting file data .. | |
|
662 | Committed revision 16. | |
|
618 | $ svn ci -qm 'add .hg/hgrc to be sanitized at hg update' | |
|
663 | 619 | $ svn up -q |
|
664 | 620 | $ cd .. |
|
665 | 621 | $ hg commit -S -m 'commit with svn revision including .hg/hgrc' |
|
666 | 622 | $ grep ' s$' .hgsubstate |
|
667 | 623 | 16 s |
|
668 | 624 | $ cd .. |
|
669 | 625 | |
|
670 | 626 | $ hg -R tc pull -u -q 2>&1 | sort |
|
671 | 627 | warning: removing potentially hostile 'hgrc' in '$TESTTMP/sub/tc/s/.hg' (glob) |
|
672 | 628 | warning: removing potentially hostile 'hgrc' in '$TESTTMP/sub/tc/s/sub/.hg' (glob) |
|
673 | 629 | $ cd tc |
|
674 | 630 | $ grep ' s$' .hgsubstate |
|
675 | 631 | 16 s |
|
676 | 632 | $ test -f s/.hg/hgrc |
|
677 | 633 | [1] |
|
678 | 634 | $ test -f s/sub/.hg/hgrc |
|
679 | 635 | [1] |
|
680 | 636 | |
|
681 | 637 | Test that sanitizing is omitted in meta data area: |
|
682 | 638 | |
|
683 | 639 | $ mkdir s/.svn/.hg |
|
684 | 640 | $ echo '.hg/hgrc in svn metadata area' > s/.svn/.hg/hgrc |
|
685 | 641 | $ hg update -q -C '.^1' |
|
686 | 642 | |
|
687 | 643 | $ cd ../.. |
General Comments 0
You need to be logged in to leave comments.
Login now