##// END OF EJS Templates
test-subrepo-svn: fix non-determinism...
Patrick Mezard -
r16526:f2cc0ffb stable
parent child Browse files
Show More
@@ -1,550 +1,550
1 $ "$TESTDIR/hghave" svn15 || exit 80
1 $ "$TESTDIR/hghave" svn15 || exit 80
2
2
3 $ fix_path()
3 $ fix_path()
4 > {
4 > {
5 > tr '\\' /
5 > tr '\\' /
6 > }
6 > }
7
7
8 SVN wants all paths to start with a slash. Unfortunately, Windows ones
8 SVN wants all paths to start with a slash. Unfortunately, Windows ones
9 don't. Handle that.
9 don't. Handle that.
10
10
11 $ escapedwd=`pwd | fix_path`
11 $ escapedwd=`pwd | fix_path`
12 $ expr "$escapedwd" : '\/' > /dev/null || escapedwd="/$escapedwd"
12 $ expr "$escapedwd" : '\/' > /dev/null || escapedwd="/$escapedwd"
13 $ escapedwd=`python -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$escapedwd"`
13 $ escapedwd=`python -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$escapedwd"`
14
14
15 create subversion repo
15 create subversion repo
16
16
17 $ SVNREPO="file://$escapedwd/svn-repo"
17 $ SVNREPO="file://$escapedwd/svn-repo"
18 $ WCROOT="`pwd`/svn-wc"
18 $ WCROOT="`pwd`/svn-wc"
19 $ svnadmin create svn-repo
19 $ svnadmin create svn-repo
20 $ svn co "$SVNREPO" svn-wc
20 $ svn co "$SVNREPO" svn-wc
21 Checked out revision 0.
21 Checked out revision 0.
22 $ cd svn-wc
22 $ cd svn-wc
23 $ mkdir src
23 $ mkdir src
24 $ echo alpha > src/alpha
24 $ echo alpha > src/alpha
25 $ svn add src
25 $ svn add src
26 A src
26 A src
27 A src/alpha
27 A src/alpha
28 $ mkdir externals
28 $ mkdir externals
29 $ echo other > externals/other
29 $ echo other > externals/other
30 $ svn add externals
30 $ svn add externals
31 A externals
31 A externals
32 A externals/other
32 A externals/other
33 $ svn ci -m 'Add alpha'
33 $ svn ci -m 'Add alpha'
34 Adding externals
34 Adding externals
35 Adding externals/other
35 Adding externals/other
36 Adding src
36 Adding src
37 Adding src/alpha
37 Adding src/alpha
38 Transmitting file data ..
38 Transmitting file data ..
39 Committed revision 1.
39 Committed revision 1.
40 $ svn up -q
40 $ svn up -q
41 $ echo "externals -r1 $SVNREPO/externals" > extdef
41 $ echo "externals -r1 $SVNREPO/externals" > extdef
42 $ svn propset -F extdef svn:externals src
42 $ svn propset -F extdef svn:externals src
43 property 'svn:externals' set on 'src'
43 property 'svn:externals' set on 'src'
44 $ svn ci -m 'Setting externals'
44 $ svn ci -m 'Setting externals'
45 Sending src
45 Sending src
46
46
47 Committed revision 2.
47 Committed revision 2.
48 $ cd ..
48 $ cd ..
49
49
50 create hg repo
50 create hg repo
51
51
52 $ mkdir sub
52 $ mkdir sub
53 $ cd sub
53 $ cd sub
54 $ hg init t
54 $ hg init t
55 $ cd t
55 $ cd t
56
56
57 first revision, no sub
57 first revision, no sub
58
58
59 $ echo a > a
59 $ echo a > a
60 $ hg ci -Am0
60 $ hg ci -Am0
61 adding a
61 adding a
62
62
63 add first svn sub with leading whitespaces
63 add first svn sub with leading whitespaces
64
64
65 $ echo "s = [svn] $SVNREPO/src" >> .hgsub
65 $ echo "s = [svn] $SVNREPO/src" >> .hgsub
66 $ echo "subdir/s = [svn] $SVNREPO/src" >> .hgsub
66 $ echo "subdir/s = [svn] $SVNREPO/src" >> .hgsub
67 $ svn co --quiet "$SVNREPO"/src s
67 $ svn co --quiet "$SVNREPO"/src s
68 $ mkdir subdir
68 $ mkdir subdir
69 $ svn co --quiet "$SVNREPO"/src subdir/s
69 $ svn co --quiet "$SVNREPO"/src subdir/s
70 $ hg add .hgsub
70 $ hg add .hgsub
71 $ hg ci -m1
71 $ hg ci -m1
72
72
73 make sure we avoid empty commits (issue2445)
73 make sure we avoid empty commits (issue2445)
74
74
75 $ hg sum
75 $ hg sum
76 parent: 1:* tip (glob)
76 parent: 1:* tip (glob)
77 1
77 1
78 branch: default
78 branch: default
79 commit: (clean)
79 commit: (clean)
80 update: (current)
80 update: (current)
81 $ hg ci -moops
81 $ hg ci -moops
82 nothing changed
82 nothing changed
83 [1]
83 [1]
84
84
85 debugsub
85 debugsub
86
86
87 $ hg debugsub
87 $ hg debugsub
88 path s
88 path s
89 source file://*/svn-repo/src (glob)
89 source file://*/svn-repo/src (glob)
90 revision 2
90 revision 2
91 path subdir/s
91 path subdir/s
92 source file://*/svn-repo/src (glob)
92 source file://*/svn-repo/src (glob)
93 revision 2
93 revision 2
94
94
95 change file in svn and hg, commit
95 change file in svn and hg, commit
96
96
97 $ echo a >> a
97 $ echo a >> a
98 $ echo alpha >> s/alpha
98 $ echo alpha >> s/alpha
99 $ hg sum
99 $ hg sum
100 parent: 1:* tip (glob)
100 parent: 1:* tip (glob)
101 1
101 1
102 branch: default
102 branch: default
103 commit: 1 modified, 1 subrepos
103 commit: 1 modified, 1 subrepos
104 update: (current)
104 update: (current)
105 $ hg commit --subrepos -m 'Message!' | grep -v Updating
105 $ hg commit --subrepos -m 'Message!' | grep -v Updating
106 committing subrepository s
106 committing subrepository s
107 Sending*s/alpha (glob)
107 Sending*s/alpha (glob)
108 Transmitting file data .
108 Transmitting file data .
109 Committed revision 3.
109 Committed revision 3.
110
110
111 Fetching external item into '*s/externals'* (glob)
111 Fetching external item into '*s/externals'* (glob)
112 External at revision 1.
112 External at revision 1.
113
113
114 At revision 3.
114 At revision 3.
115 $ hg debugsub
115 $ hg debugsub
116 path s
116 path s
117 source file://*/svn-repo/src (glob)
117 source file://*/svn-repo/src (glob)
118 revision 3
118 revision 3
119 path subdir/s
119 path subdir/s
120 source file://*/svn-repo/src (glob)
120 source file://*/svn-repo/src (glob)
121 revision 2
121 revision 2
122
122
123 add an unrelated revision in svn and update the subrepo to without
123 add an unrelated revision in svn and update the subrepo to without
124 bringing any changes.
124 bringing any changes.
125
125
126 $ svn mkdir "$SVNREPO/unrelated" -m 'create unrelated'
126 $ svn mkdir "$SVNREPO/unrelated" -m 'create unrelated'
127
127
128 Committed revision 4.
128 Committed revision 4.
129 $ svn up -q s
129 $ svn up -q s
130 $ hg sum
130 $ hg sum
131 parent: 2:* tip (glob)
131 parent: 2:* tip (glob)
132 Message!
132 Message!
133 branch: default
133 branch: default
134 commit: (clean)
134 commit: (clean)
135 update: (current)
135 update: (current)
136
136
137 $ echo a > s/a
137 $ echo a > s/a
138
138
139 should be empty despite change to s/a
139 should be empty despite change to s/a
140
140
141 $ hg st
141 $ hg st
142
142
143 add a commit from svn
143 add a commit from svn
144
144
145 $ cd "$WCROOT"/src
145 $ cd "$WCROOT"/src
146 $ svn up -q
146 $ svn up -q
147 $ echo xyz >> alpha
147 $ echo xyz >> alpha
148 $ svn propset svn:mime-type 'text/xml' alpha
148 $ svn propset svn:mime-type 'text/xml' alpha
149 property 'svn:mime-type' set on 'alpha'
149 property 'svn:mime-type' set on 'alpha'
150 $ svn ci -m 'amend a from svn'
150 $ svn ci -m 'amend a from svn'
151 Sending *alpha (glob)
151 Sending *alpha (glob)
152 Transmitting file data .
152 Transmitting file data .
153 Committed revision 5.
153 Committed revision 5.
154 $ cd ../../sub/t
154 $ cd ../../sub/t
155
155
156 this commit from hg will fail
156 this commit from hg will fail
157
157
158 $ echo zzz >> s/alpha
158 $ echo zzz >> s/alpha
159 $ (hg ci --subrepos -m 'amend alpha from hg' 2>&1; echo "[$?]") | grep -vi 'out of date'
159 $ (hg ci --subrepos -m 'amend alpha from hg' 2>&1; echo "[$?]") | grep -vi 'out of date'
160 committing subrepository s
160 committing subrepository s
161 abort: svn:*Commit failed (details follow): (glob)
161 abort: svn:*Commit failed (details follow): (glob)
162 [255]
162 [255]
163 $ svn revert -q s/alpha
163 $ svn revert -q s/alpha
164
164
165 this commit fails because of meta changes
165 this commit fails because of meta changes
166
166
167 $ svn propset svn:mime-type 'text/html' s/alpha
167 $ svn propset svn:mime-type 'text/html' s/alpha
168 property 'svn:mime-type' set on 's/alpha'
168 property 'svn:mime-type' set on 's/alpha'
169 $ (hg ci --subrepos -m 'amend alpha from hg' 2>&1; echo "[$?]") | grep -vi 'out of date'
169 $ (hg ci --subrepos -m 'amend alpha from hg' 2>&1; echo "[$?]") | grep -vi 'out of date'
170 committing subrepository s
170 committing subrepository s
171 abort: svn:*Commit failed (details follow): (glob)
171 abort: svn:*Commit failed (details follow): (glob)
172 [255]
172 [255]
173 $ svn revert -q s/alpha
173 $ svn revert -q s/alpha
174
174
175 this commit fails because of externals changes
175 this commit fails because of externals changes
176
176
177 $ echo zzz > s/externals/other
177 $ echo zzz > s/externals/other
178 $ hg ci --subrepos -m 'amend externals from hg'
178 $ hg ci --subrepos -m 'amend externals from hg'
179 committing subrepository s
179 committing subrepository s
180 abort: cannot commit svn externals
180 abort: cannot commit svn externals
181 [255]
181 [255]
182 $ hg diff --subrepos -r 1:2 | grep -v diff
182 $ hg diff --subrepos -r 1:2 | grep -v diff
183 --- a/.hgsubstate Thu Jan 01 00:00:00 1970 +0000
183 --- a/.hgsubstate Thu Jan 01 00:00:00 1970 +0000
184 +++ b/.hgsubstate Thu Jan 01 00:00:00 1970 +0000
184 +++ b/.hgsubstate Thu Jan 01 00:00:00 1970 +0000
185 @@ -1,2 +1,2 @@
185 @@ -1,2 +1,2 @@
186 -2 s
186 -2 s
187 +3 s
187 +3 s
188 2 subdir/s
188 2 subdir/s
189 --- a/a Thu Jan 01 00:00:00 1970 +0000
189 --- a/a Thu Jan 01 00:00:00 1970 +0000
190 +++ b/a Thu Jan 01 00:00:00 1970 +0000
190 +++ b/a Thu Jan 01 00:00:00 1970 +0000
191 @@ -1,1 +1,2 @@
191 @@ -1,1 +1,2 @@
192 a
192 a
193 +a
193 +a
194 $ svn revert -q s/externals/other
194 $ svn revert -q s/externals/other
195
195
196 this commit fails because of externals meta changes
196 this commit fails because of externals meta changes
197
197
198 $ svn propset svn:mime-type 'text/html' s/externals/other
198 $ svn propset svn:mime-type 'text/html' s/externals/other
199 property 'svn:mime-type' set on 's/externals/other'
199 property 'svn:mime-type' set on 's/externals/other'
200 $ hg ci --subrepos -m 'amend externals from hg'
200 $ hg ci --subrepos -m 'amend externals from hg'
201 committing subrepository s
201 committing subrepository s
202 abort: cannot commit svn externals
202 abort: cannot commit svn externals
203 [255]
203 [255]
204 $ svn revert -q s/externals/other
204 $ svn revert -q s/externals/other
205
205
206 clone
206 clone
207
207
208 $ cd ..
208 $ cd ..
209 $ hg clone t tc | fix_path
209 $ hg clone t tc | fix_path
210 updating to branch default
210 updating to branch default
211 A tc/s/alpha
211 A tc/s/alpha
212 U tc/s
212 U tc/s
213
213
214 Fetching external item into 'tc/s/externals'* (glob)
214 Fetching external item into 'tc/s/externals'* (glob)
215 A tc/s/externals/other
215 A tc/s/externals/other
216 Checked out external at revision 1.
216 Checked out external at revision 1.
217
217
218 Checked out revision 3.
218 Checked out revision 3.
219 A tc/subdir/s/alpha
219 A tc/subdir/s/alpha
220 U tc/subdir/s
220 U tc/subdir/s
221
221
222 Fetching external item into 'tc/subdir/s/externals'* (glob)
222 Fetching external item into 'tc/subdir/s/externals'* (glob)
223 A tc/subdir/s/externals/other
223 A tc/subdir/s/externals/other
224 Checked out external at revision 1.
224 Checked out external at revision 1.
225
225
226 Checked out revision 2.
226 Checked out revision 2.
227 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
227 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
228 $ cd tc
228 $ cd tc
229
229
230 debugsub in clone
230 debugsub in clone
231
231
232 $ hg debugsub
232 $ hg debugsub
233 path s
233 path s
234 source file://*/svn-repo/src (glob)
234 source file://*/svn-repo/src (glob)
235 revision 3
235 revision 3
236 path subdir/s
236 path subdir/s
237 source file://*/svn-repo/src (glob)
237 source file://*/svn-repo/src (glob)
238 revision 2
238 revision 2
239
239
240 verify subrepo is contained within the repo directory
240 verify subrepo is contained within the repo directory
241
241
242 $ python -c "import os.path; print os.path.exists('s')"
242 $ python -c "import os.path; print os.path.exists('s')"
243 True
243 True
244
244
245 update to nullrev (must delete the subrepo)
245 update to nullrev (must delete the subrepo)
246
246
247 $ hg up null
247 $ hg up null
248 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
248 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
249 $ ls
249 $ ls
250
250
251 Check hg update --clean
251 Check hg update --clean
252 $ cd $TESTTMP/sub/t
252 $ cd $TESTTMP/sub/t
253 $ cd s
253 $ cd s
254 $ echo c0 > alpha
254 $ echo c0 > alpha
255 $ echo c1 > f1
255 $ echo c1 > f1
256 $ echo c1 > f2
256 $ echo c1 > f2
257 $ svn add f1 -q
257 $ svn add f1 -q
258 $ svn status | sort
258 $ svn status | sort
259
259
260 ? * a (glob)
260 ? * a (glob)
261 ? * f2 (glob)
261 ? * f2 (glob)
262 A * f1 (glob)
262 A * f1 (glob)
263 M * alpha (glob)
263 M * alpha (glob)
264 Performing status on external item at 'externals'* (glob)
264 Performing status on external item at 'externals'* (glob)
265 X * externals (glob)
265 X * externals (glob)
266 $ cd ../..
266 $ cd ../..
267 $ hg -R t update -C
267 $ hg -R t update -C
268
268
269 Fetching external item into 't/s/externals'* (glob)
269 Fetching external item into 't/s/externals'* (glob)
270 Checked out external at revision 1.
270 Checked out external at revision 1.
271
271
272 Checked out revision 3.
272 Checked out revision 3.
273 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
273 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
274 $ cd t/s
274 $ cd t/s
275 $ svn status
275 $ svn status | sort
276
276 ? * a (glob)
277 ? * a (glob)
277 X * externals (glob)
278 ? * f1 (glob)
278 ? * f1 (glob)
279 ? * f2 (glob)
279 ? * f2 (glob)
280
281 Performing status on external item at 'externals'* (glob)
280 Performing status on external item at 'externals'* (glob)
281 X * externals (glob)
282
282
283 Sticky subrepositories, no changes
283 Sticky subrepositories, no changes
284 $ cd $TESTTMP/sub/t
284 $ cd $TESTTMP/sub/t
285 $ hg id -n
285 $ hg id -n
286 2
286 2
287 $ cd s
287 $ cd s
288 $ svnversion
288 $ svnversion
289 3
289 3
290 $ cd ..
290 $ cd ..
291 $ hg update 1
291 $ hg update 1
292 U *s/alpha (glob)
292 U *s/alpha (glob)
293
293
294 Fetching external item into '*s/externals'* (glob)
294 Fetching external item into '*s/externals'* (glob)
295 Checked out external at revision 1.
295 Checked out external at revision 1.
296
296
297 Checked out revision 2.
297 Checked out revision 2.
298 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
298 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
299 $ hg id -n
299 $ hg id -n
300 1
300 1
301 $ cd s
301 $ cd s
302 $ svnversion
302 $ svnversion
303 2
303 2
304 $ cd ..
304 $ cd ..
305
305
306 Sticky subrepositorys, file changes
306 Sticky subrepositorys, file changes
307 $ touch s/f1
307 $ touch s/f1
308 $ cd s
308 $ cd s
309 $ svn add f1
309 $ svn add f1
310 A f1
310 A f1
311 $ cd ..
311 $ cd ..
312 $ hg id -n
312 $ hg id -n
313 1
313 1
314 $ cd s
314 $ cd s
315 $ svnversion
315 $ svnversion
316 2M
316 2M
317 $ cd ..
317 $ cd ..
318 $ hg update tip
318 $ hg update tip
319 subrepository sources for s differ
319 subrepository sources for s differ
320 use (l)ocal source (2) or (r)emote source (3)?
320 use (l)ocal source (2) or (r)emote source (3)?
321 l
321 l
322 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
322 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
323 $ hg id -n
323 $ hg id -n
324 2+
324 2+
325 $ cd s
325 $ cd s
326 $ svnversion
326 $ svnversion
327 2M
327 2M
328 $ cd ..
328 $ cd ..
329 $ hg update --clean tip
329 $ hg update --clean tip
330 U *s/alpha (glob)
330 U *s/alpha (glob)
331
331
332 Fetching external item into '*s/externals'* (glob)
332 Fetching external item into '*s/externals'* (glob)
333 Checked out external at revision 1.
333 Checked out external at revision 1.
334
334
335 Checked out revision 3.
335 Checked out revision 3.
336 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
336 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
337
337
338 Sticky subrepository, revision updates
338 Sticky subrepository, revision updates
339 $ hg id -n
339 $ hg id -n
340 2
340 2
341 $ cd s
341 $ cd s
342 $ svnversion
342 $ svnversion
343 3
343 3
344 $ cd ..
344 $ cd ..
345 $ cd s
345 $ cd s
346 $ svn update -qr 1
346 $ svn update -qr 1
347 $ cd ..
347 $ cd ..
348 $ hg update 1
348 $ hg update 1
349 subrepository sources for s differ (in checked out version)
349 subrepository sources for s differ (in checked out version)
350 use (l)ocal source (1) or (r)emote source (2)?
350 use (l)ocal source (1) or (r)emote source (2)?
351 l
351 l
352 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
352 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
353 $ hg id -n
353 $ hg id -n
354 1+
354 1+
355 $ cd s
355 $ cd s
356 $ svnversion
356 $ svnversion
357 1
357 1
358 $ cd ..
358 $ cd ..
359
359
360 Sticky subrepository, file changes and revision updates
360 Sticky subrepository, file changes and revision updates
361 $ touch s/f1
361 $ touch s/f1
362 $ cd s
362 $ cd s
363 $ svn add f1
363 $ svn add f1
364 A f1
364 A f1
365 $ svnversion
365 $ svnversion
366 1M
366 1M
367 $ cd ..
367 $ cd ..
368 $ hg id -n
368 $ hg id -n
369 1+
369 1+
370 $ hg update tip
370 $ hg update tip
371 subrepository sources for s differ
371 subrepository sources for s differ
372 use (l)ocal source (1) or (r)emote source (3)?
372 use (l)ocal source (1) or (r)emote source (3)?
373 l
373 l
374 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
374 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
375 $ hg id -n
375 $ hg id -n
376 2
376 2
377 $ cd s
377 $ cd s
378 $ svnversion
378 $ svnversion
379 1M
379 1M
380 $ cd ..
380 $ cd ..
381
381
382 Sticky repository, update --clean
382 Sticky repository, update --clean
383 $ hg update --clean tip | grep -v s/externals/other
383 $ hg update --clean tip | grep -v s/externals/other
384 U *s/alpha (glob)
384 U *s/alpha (glob)
385 U *s (glob)
385 U *s (glob)
386
386
387 Fetching external item into '*s/externals'* (glob)
387 Fetching external item into '*s/externals'* (glob)
388 Checked out external at revision 1.
388 Checked out external at revision 1.
389
389
390 Checked out revision 3.
390 Checked out revision 3.
391 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
391 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
392 $ hg id -n
392 $ hg id -n
393 2
393 2
394 $ cd s
394 $ cd s
395 $ svnversion
395 $ svnversion
396 3
396 3
397 $ cd ..
397 $ cd ..
398
398
399 Test subrepo already at intended revision:
399 Test subrepo already at intended revision:
400 $ cd s
400 $ cd s
401 $ svn update -qr 2
401 $ svn update -qr 2
402 $ cd ..
402 $ cd ..
403 $ hg update 1
403 $ hg update 1
404 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
404 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
405 $ hg id -n
405 $ hg id -n
406 1+
406 1+
407 $ cd s
407 $ cd s
408 $ svnversion
408 $ svnversion
409 2
409 2
410 $ cd ..
410 $ cd ..
411
411
412 Test case where subversion would fail to update the subrepo because there
412 Test case where subversion would fail to update the subrepo because there
413 are unknown directories being replaced by tracked ones (happens with rebase).
413 are unknown directories being replaced by tracked ones (happens with rebase).
414
414
415 $ cd $WCROOT/src
415 $ cd $WCROOT/src
416 $ mkdir dir
416 $ mkdir dir
417 $ echo epsilon.py > dir/epsilon.py
417 $ echo epsilon.py > dir/epsilon.py
418 $ svn add dir
418 $ svn add dir
419 A dir
419 A dir
420 A dir/epsilon.py
420 A dir/epsilon.py
421 $ svn ci -m 'Add dir/epsilon.py'
421 $ svn ci -m 'Add dir/epsilon.py'
422 Adding *dir (glob)
422 Adding *dir (glob)
423 Adding *dir/epsilon.py (glob)
423 Adding *dir/epsilon.py (glob)
424 Transmitting file data .
424 Transmitting file data .
425 Committed revision 6.
425 Committed revision 6.
426 $ cd ../..
426 $ cd ../..
427 $ hg init rebaserepo
427 $ hg init rebaserepo
428 $ cd rebaserepo
428 $ cd rebaserepo
429 $ svn co -r5 --quiet "$SVNREPO"/src s
429 $ svn co -r5 --quiet "$SVNREPO"/src s
430 $ echo "s = [svn] $SVNREPO/src" >> .hgsub
430 $ echo "s = [svn] $SVNREPO/src" >> .hgsub
431 $ hg add .hgsub
431 $ hg add .hgsub
432 $ hg ci -m addsub
432 $ hg ci -m addsub
433 $ echo a > a
433 $ echo a > a
434 $ hg ci -Am adda
434 $ hg ci -Am adda
435 adding a
435 adding a
436 $ hg up 0
436 $ hg up 0
437 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
437 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
438 $ svn up -qr6 s
438 $ svn up -qr6 s
439 $ hg ci -m updatesub
439 $ hg ci -m updatesub
440 created new head
440 created new head
441 $ echo pyc > s/dir/epsilon.pyc
441 $ echo pyc > s/dir/epsilon.pyc
442 $ hg up 1
442 $ hg up 1
443 D *s/dir (glob)
443 D *s/dir (glob)
444
444
445 Fetching external item into '*s/externals'* (glob)
445 Fetching external item into '*s/externals'* (glob)
446 Checked out external at revision 1.
446 Checked out external at revision 1.
447
447
448 Checked out revision 5.
448 Checked out revision 5.
449 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
449 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
450 $ if "$TESTDIR/hghave" -q svn15; then
450 $ if "$TESTDIR/hghave" -q svn15; then
451 > hg up 2 >/dev/null 2>&1 || echo update failed
451 > hg up 2 >/dev/null 2>&1 || echo update failed
452 > fi
452 > fi
453
453
454 Modify one of the externals to point to a different path so we can
454 Modify one of the externals to point to a different path so we can
455 test having obstructions when switching branches on checkout:
455 test having obstructions when switching branches on checkout:
456 $ hg checkout tip
456 $ hg checkout tip
457 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
457 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
458 $ echo "obstruct = [svn] $SVNREPO/externals" >> .hgsub
458 $ echo "obstruct = [svn] $SVNREPO/externals" >> .hgsub
459 $ svn co -r5 --quiet "$SVNREPO"/externals obstruct
459 $ svn co -r5 --quiet "$SVNREPO"/externals obstruct
460 $ hg commit -m 'Start making obstructed working copy'
460 $ hg commit -m 'Start making obstructed working copy'
461 $ hg book other
461 $ hg book other
462 $ hg co -r 'p1(tip)'
462 $ hg co -r 'p1(tip)'
463 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
463 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
464 $ echo "obstruct = [svn] $SVNREPO/src" >> .hgsub
464 $ echo "obstruct = [svn] $SVNREPO/src" >> .hgsub
465 $ svn co -r5 --quiet "$SVNREPO"/src obstruct
465 $ svn co -r5 --quiet "$SVNREPO"/src obstruct
466 $ hg commit -m 'Other branch which will be obstructed'
466 $ hg commit -m 'Other branch which will be obstructed'
467 created new head
467 created new head
468
468
469 Switching back to the head where we have another path mapped to the
469 Switching back to the head where we have another path mapped to the
470 same subrepo should work if the subrepo is clean.
470 same subrepo should work if the subrepo is clean.
471 $ hg co other
471 $ hg co other
472 A *obstruct/other (glob)
472 A *obstruct/other (glob)
473 Checked out revision 1.
473 Checked out revision 1.
474 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
474 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
475
475
476 This is surprising, but is also correct based on the current code:
476 This is surprising, but is also correct based on the current code:
477 $ echo "updating should (maybe) fail" > obstruct/other
477 $ echo "updating should (maybe) fail" > obstruct/other
478 $ hg co tip
478 $ hg co tip
479 abort: crosses branches (merge branches or use --clean to discard changes)
479 abort: crosses branches (merge branches or use --clean to discard changes)
480 [255]
480 [255]
481
481
482 Point to a Subversion branch which has since been deleted and recreated
482 Point to a Subversion branch which has since been deleted and recreated
483 First, create that condition in the repository.
483 First, create that condition in the repository.
484
484
485 $ hg ci --subrepos -m cleanup | grep -v Updating
485 $ hg ci --subrepos -m cleanup | grep -v Updating
486 committing subrepository obstruct
486 committing subrepository obstruct
487 Sending obstruct/other
487 Sending obstruct/other
488 Transmitting file data .
488 Transmitting file data .
489 Committed revision 7.
489 Committed revision 7.
490 At revision 7.
490 At revision 7.
491 $ svn mkdir -m "baseline" $SVNREPO/trunk
491 $ svn mkdir -m "baseline" $SVNREPO/trunk
492
492
493 Committed revision 8.
493 Committed revision 8.
494 $ svn copy -m "initial branch" $SVNREPO/trunk $SVNREPO/branch
494 $ svn copy -m "initial branch" $SVNREPO/trunk $SVNREPO/branch
495
495
496 Committed revision 9.
496 Committed revision 9.
497 $ svn co --quiet "$SVNREPO"/branch tempwc
497 $ svn co --quiet "$SVNREPO"/branch tempwc
498 $ cd tempwc
498 $ cd tempwc
499 $ echo "something old" > somethingold
499 $ echo "something old" > somethingold
500 $ svn add somethingold
500 $ svn add somethingold
501 A somethingold
501 A somethingold
502 $ svn ci -m 'Something old'
502 $ svn ci -m 'Something old'
503 Adding somethingold
503 Adding somethingold
504 Transmitting file data .
504 Transmitting file data .
505 Committed revision 10.
505 Committed revision 10.
506 $ svn rm -m "remove branch" $SVNREPO/branch
506 $ svn rm -m "remove branch" $SVNREPO/branch
507
507
508 Committed revision 11.
508 Committed revision 11.
509 $ svn copy -m "recreate branch" $SVNREPO/trunk $SVNREPO/branch
509 $ svn copy -m "recreate branch" $SVNREPO/trunk $SVNREPO/branch
510
510
511 Committed revision 12.
511 Committed revision 12.
512 $ svn up -q
512 $ svn up -q
513 $ echo "something new" > somethingnew
513 $ echo "something new" > somethingnew
514 $ svn add somethingnew
514 $ svn add somethingnew
515 A somethingnew
515 A somethingnew
516 $ svn ci -m 'Something new'
516 $ svn ci -m 'Something new'
517 Adding somethingnew
517 Adding somethingnew
518 Transmitting file data .
518 Transmitting file data .
519 Committed revision 13.
519 Committed revision 13.
520 $ cd ..
520 $ cd ..
521 $ rm -rf tempwc
521 $ rm -rf tempwc
522 $ svn co "$SVNREPO/branch"@10 recreated
522 $ svn co "$SVNREPO/branch"@10 recreated
523 A recreated/somethingold
523 A recreated/somethingold
524 Checked out revision 10.
524 Checked out revision 10.
525 $ echo "recreated = [svn] $SVNREPO/branch" >> .hgsub
525 $ echo "recreated = [svn] $SVNREPO/branch" >> .hgsub
526 $ hg ci -m addsub
526 $ hg ci -m addsub
527 $ cd recreated
527 $ cd recreated
528 $ svn up -q
528 $ svn up -q
529 $ cd ..
529 $ cd ..
530 $ hg ci -m updatesub
530 $ hg ci -m updatesub
531 $ hg up -r-2
531 $ hg up -r-2
532 D *recreated/somethingnew (glob)
532 D *recreated/somethingnew (glob)
533 A *recreated/somethingold (glob)
533 A *recreated/somethingold (glob)
534 Checked out revision 10.
534 Checked out revision 10.
535 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
535 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
536 $ test -f recreated/somethingold
536 $ test -f recreated/somethingold
537
537
538 Test archive
538 Test archive
539
539
540 $ hg archive -S ../archive-all --debug
540 $ hg archive -S ../archive-all --debug
541 archiving: 0/2 files (0.00%)
541 archiving: 0/2 files (0.00%)
542 archiving: .hgsub 1/2 files (50.00%)
542 archiving: .hgsub 1/2 files (50.00%)
543 archiving: .hgsubstate 2/2 files (100.00%)
543 archiving: .hgsubstate 2/2 files (100.00%)
544 archiving (obstruct): 0/1 files (0.00%)
544 archiving (obstruct): 0/1 files (0.00%)
545 archiving (obstruct): 1/1 files (100.00%)
545 archiving (obstruct): 1/1 files (100.00%)
546 archiving (s): 0/2 files (0.00%)
546 archiving (s): 0/2 files (0.00%)
547 archiving (s): 1/2 files (50.00%)
547 archiving (s): 1/2 files (50.00%)
548 archiving (s): 2/2 files (100.00%)
548 archiving (s): 2/2 files (100.00%)
549 archiving (recreated): 0/1 files (0.00%)
549 archiving (recreated): 0/1 files (0.00%)
550 archiving (recreated): 1/1 files (100.00%)
550 archiving (recreated): 1/1 files (100.00%)
General Comments 0
You need to be logged in to leave comments. Login now