##// END OF EJS Templates
tests: add subrepo recursion tests for add/forget with explicit paths...
David M. Carr -
r15910:2b8d5c55 default
parent child Browse files
Show More
@@ -1,477 +1,501 b''
1 Create test repository:
1 Create test repository:
2
2
3 $ hg init repo
3 $ hg init repo
4 $ cd repo
4 $ cd repo
5 $ echo x1 > x.txt
5 $ echo x1 > x.txt
6
6
7 $ hg init foo
7 $ hg init foo
8 $ cd foo
8 $ cd foo
9 $ echo y1 > y.txt
9 $ echo y1 > y.txt
10
10
11 $ hg init bar
11 $ hg init bar
12 $ cd bar
12 $ cd bar
13 $ echo z1 > z.txt
13 $ echo z1 > z.txt
14
14
15 $ cd ..
15 $ cd ..
16 $ echo 'bar = bar' > .hgsub
16 $ echo 'bar = bar' > .hgsub
17
17
18 $ cd ..
18 $ cd ..
19 $ echo 'foo = foo' > .hgsub
19 $ echo 'foo = foo' > .hgsub
20
20
21 Add files --- .hgsub files must go first to trigger subrepos:
21 Add files --- .hgsub files must go first to trigger subrepos:
22
22
23 $ hg add -S .hgsub
23 $ hg add -S .hgsub
24 $ hg add -S foo/.hgsub
24 $ hg add -S foo/.hgsub
25 $ hg add -S foo/bar
25 $ hg add -S foo/bar
26 adding foo/bar/z.txt (glob)
26 adding foo/bar/z.txt (glob)
27 $ hg add -S
27 $ hg add -S
28 adding x.txt
28 adding x.txt
29 adding foo/y.txt (glob)
29 adding foo/y.txt (glob)
30
30
31 Test recursive status without committing anything:
31 Test recursive status without committing anything:
32
32
33 $ hg status -S
33 $ hg status -S
34 A .hgsub
34 A .hgsub
35 A foo/.hgsub
35 A foo/.hgsub
36 A foo/bar/z.txt
36 A foo/bar/z.txt
37 A foo/y.txt
37 A foo/y.txt
38 A x.txt
38 A x.txt
39
39
40 Test recursive diff without committing anything:
40 Test recursive diff without committing anything:
41
41
42 $ hg diff --nodates -S foo
42 $ hg diff --nodates -S foo
43 diff -r 000000000000 foo/.hgsub
43 diff -r 000000000000 foo/.hgsub
44 --- /dev/null
44 --- /dev/null
45 +++ b/foo/.hgsub
45 +++ b/foo/.hgsub
46 @@ -0,0 +1,1 @@
46 @@ -0,0 +1,1 @@
47 +bar = bar
47 +bar = bar
48 diff -r 000000000000 foo/y.txt
48 diff -r 000000000000 foo/y.txt
49 --- /dev/null
49 --- /dev/null
50 +++ b/foo/y.txt
50 +++ b/foo/y.txt
51 @@ -0,0 +1,1 @@
51 @@ -0,0 +1,1 @@
52 +y1
52 +y1
53 diff -r 000000000000 foo/bar/z.txt
53 diff -r 000000000000 foo/bar/z.txt
54 --- /dev/null
54 --- /dev/null
55 +++ b/foo/bar/z.txt
55 +++ b/foo/bar/z.txt
56 @@ -0,0 +1,1 @@
56 @@ -0,0 +1,1 @@
57 +z1
57 +z1
58
58
59 Commits:
59 Commits:
60
60
61 $ hg commit -m fails
61 $ hg commit -m fails
62 abort: uncommitted changes in subrepo foo
62 abort: uncommitted changes in subrepo foo
63 (use --subrepos for recursive commit)
63 (use --subrepos for recursive commit)
64 [255]
64 [255]
65
65
66 The --subrepos flag overwrite the config setting:
66 The --subrepos flag overwrite the config setting:
67
67
68 $ hg commit -m 0-0-0 --config ui.commitsubrepos=No --subrepos
68 $ hg commit -m 0-0-0 --config ui.commitsubrepos=No --subrepos
69 committing subrepository foo
69 committing subrepository foo
70 committing subrepository foo/bar (glob)
70 committing subrepository foo/bar (glob)
71
71
72 $ cd foo
72 $ cd foo
73 $ echo y2 >> y.txt
73 $ echo y2 >> y.txt
74 $ hg commit -m 0-1-0
74 $ hg commit -m 0-1-0
75
75
76 $ cd bar
76 $ cd bar
77 $ echo z2 >> z.txt
77 $ echo z2 >> z.txt
78 $ hg commit -m 0-1-1
78 $ hg commit -m 0-1-1
79
79
80 $ cd ..
80 $ cd ..
81 $ hg commit -m 0-2-1
81 $ hg commit -m 0-2-1
82 committing subrepository bar
82 committing subrepository bar
83
83
84 $ cd ..
84 $ cd ..
85 $ hg commit -m 1-2-1
85 $ hg commit -m 1-2-1
86 committing subrepository foo
86 committing subrepository foo
87
87
88 Change working directory:
88 Change working directory:
89
89
90 $ echo y3 >> foo/y.txt
90 $ echo y3 >> foo/y.txt
91 $ echo z3 >> foo/bar/z.txt
91 $ echo z3 >> foo/bar/z.txt
92 $ hg status -S
92 $ hg status -S
93 M foo/bar/z.txt
93 M foo/bar/z.txt
94 M foo/y.txt
94 M foo/y.txt
95 $ hg diff --nodates -S
95 $ hg diff --nodates -S
96 diff -r d254738c5f5e foo/y.txt
96 diff -r d254738c5f5e foo/y.txt
97 --- a/foo/y.txt
97 --- a/foo/y.txt
98 +++ b/foo/y.txt
98 +++ b/foo/y.txt
99 @@ -1,2 +1,3 @@
99 @@ -1,2 +1,3 @@
100 y1
100 y1
101 y2
101 y2
102 +y3
102 +y3
103 diff -r 9647f22de499 foo/bar/z.txt
103 diff -r 9647f22de499 foo/bar/z.txt
104 --- a/foo/bar/z.txt
104 --- a/foo/bar/z.txt
105 +++ b/foo/bar/z.txt
105 +++ b/foo/bar/z.txt
106 @@ -1,2 +1,3 @@
106 @@ -1,2 +1,3 @@
107 z1
107 z1
108 z2
108 z2
109 +z3
109 +z3
110
110
111 Status call crossing repository boundaries:
111 Status call crossing repository boundaries:
112
112
113 $ hg status -S foo/bar/z.txt
113 $ hg status -S foo/bar/z.txt
114 M foo/bar/z.txt
114 M foo/bar/z.txt
115 $ hg status -S -I 'foo/?.txt'
115 $ hg status -S -I 'foo/?.txt'
116 M foo/y.txt
116 M foo/y.txt
117 $ hg status -S -I '**/?.txt'
117 $ hg status -S -I '**/?.txt'
118 M foo/bar/z.txt
118 M foo/bar/z.txt
119 M foo/y.txt
119 M foo/y.txt
120 $ hg diff --nodates -S -I '**/?.txt'
120 $ hg diff --nodates -S -I '**/?.txt'
121 diff -r d254738c5f5e foo/y.txt
121 diff -r d254738c5f5e foo/y.txt
122 --- a/foo/y.txt
122 --- a/foo/y.txt
123 +++ b/foo/y.txt
123 +++ b/foo/y.txt
124 @@ -1,2 +1,3 @@
124 @@ -1,2 +1,3 @@
125 y1
125 y1
126 y2
126 y2
127 +y3
127 +y3
128 diff -r 9647f22de499 foo/bar/z.txt
128 diff -r 9647f22de499 foo/bar/z.txt
129 --- a/foo/bar/z.txt
129 --- a/foo/bar/z.txt
130 +++ b/foo/bar/z.txt
130 +++ b/foo/bar/z.txt
131 @@ -1,2 +1,3 @@
131 @@ -1,2 +1,3 @@
132 z1
132 z1
133 z2
133 z2
134 +z3
134 +z3
135
135
136 Status from within a subdirectory:
136 Status from within a subdirectory:
137
137
138 $ mkdir dir
138 $ mkdir dir
139 $ cd dir
139 $ cd dir
140 $ echo a1 > a.txt
140 $ echo a1 > a.txt
141 $ hg status -S
141 $ hg status -S
142 M foo/bar/z.txt
142 M foo/bar/z.txt
143 M foo/y.txt
143 M foo/y.txt
144 ? dir/a.txt
144 ? dir/a.txt
145 $ hg diff --nodates -S
145 $ hg diff --nodates -S
146 diff -r d254738c5f5e foo/y.txt
146 diff -r d254738c5f5e foo/y.txt
147 --- a/foo/y.txt
147 --- a/foo/y.txt
148 +++ b/foo/y.txt
148 +++ b/foo/y.txt
149 @@ -1,2 +1,3 @@
149 @@ -1,2 +1,3 @@
150 y1
150 y1
151 y2
151 y2
152 +y3
152 +y3
153 diff -r 9647f22de499 foo/bar/z.txt
153 diff -r 9647f22de499 foo/bar/z.txt
154 --- a/foo/bar/z.txt
154 --- a/foo/bar/z.txt
155 +++ b/foo/bar/z.txt
155 +++ b/foo/bar/z.txt
156 @@ -1,2 +1,3 @@
156 @@ -1,2 +1,3 @@
157 z1
157 z1
158 z2
158 z2
159 +z3
159 +z3
160
160
161 Status with relative path:
161 Status with relative path:
162
162
163 $ hg status -S ..
163 $ hg status -S ..
164 M ../foo/bar/z.txt
164 M ../foo/bar/z.txt
165 M ../foo/y.txt
165 M ../foo/y.txt
166 ? a.txt
166 ? a.txt
167 $ hg diff --nodates -S ..
167 $ hg diff --nodates -S ..
168 diff -r d254738c5f5e foo/y.txt
168 diff -r d254738c5f5e foo/y.txt
169 --- a/foo/y.txt
169 --- a/foo/y.txt
170 +++ b/foo/y.txt
170 +++ b/foo/y.txt
171 @@ -1,2 +1,3 @@
171 @@ -1,2 +1,3 @@
172 y1
172 y1
173 y2
173 y2
174 +y3
174 +y3
175 diff -r 9647f22de499 foo/bar/z.txt
175 diff -r 9647f22de499 foo/bar/z.txt
176 --- a/foo/bar/z.txt
176 --- a/foo/bar/z.txt
177 +++ b/foo/bar/z.txt
177 +++ b/foo/bar/z.txt
178 @@ -1,2 +1,3 @@
178 @@ -1,2 +1,3 @@
179 z1
179 z1
180 z2
180 z2
181 +z3
181 +z3
182 $ cd ..
182 $ cd ..
183
183
184 Cleanup and final commit:
184 Cleanup and final commit:
185
185
186 $ rm -r dir
186 $ rm -r dir
187 $ hg commit --subrepos -m 2-3-2
187 $ hg commit --subrepos -m 2-3-2
188 committing subrepository foo
188 committing subrepository foo
189 committing subrepository foo/bar (glob)
189 committing subrepository foo/bar (glob)
190
190
191 Test explicit path commands within subrepos: add/forget
192 $ echo z1 > foo/bar/z2.txt
193 $ hg status -S
194 ? foo/bar/z2.txt
195 $ hg add foo/bar/z2.txt
196 This is expected to add the file, but is currently broken
197 $ hg status -S
198 ? foo/bar/z2.txt
199 When fixed, remove the next two commands
200 $ hg add -R foo/bar foo/bar/z2.txt
201 $ hg status -S
202 A foo/bar/z2.txt
203 This is expected to forget the file, but is currently broken
204 $ hg forget foo/bar/z2.txt
205 not removing foo/bar/z2.txt: file is already untracked
206 [1]
207 $ hg status -S
208 A foo/bar/z2.txt
209 When fixed, remove the next two commands
210 $ hg forget -R foo/bar foo/bar/z2.txt
211 $ hg status -S
212 ? foo/bar/z2.txt
213 $ rm foo/bar/z2.txt
214
191 Log with the relationships between repo and its subrepo:
215 Log with the relationships between repo and its subrepo:
192
216
193 $ hg log --template '{rev}:{node|short} {desc}\n'
217 $ hg log --template '{rev}:{node|short} {desc}\n'
194 2:1326fa26d0c0 2-3-2
218 2:1326fa26d0c0 2-3-2
195 1:4b3c9ff4f66b 1-2-1
219 1:4b3c9ff4f66b 1-2-1
196 0:23376cbba0d8 0-0-0
220 0:23376cbba0d8 0-0-0
197
221
198 $ hg -R foo log --template '{rev}:{node|short} {desc}\n'
222 $ hg -R foo log --template '{rev}:{node|short} {desc}\n'
199 3:65903cebad86 2-3-2
223 3:65903cebad86 2-3-2
200 2:d254738c5f5e 0-2-1
224 2:d254738c5f5e 0-2-1
201 1:8629ce7dcc39 0-1-0
225 1:8629ce7dcc39 0-1-0
202 0:af048e97ade2 0-0-0
226 0:af048e97ade2 0-0-0
203
227
204 $ hg -R foo/bar log --template '{rev}:{node|short} {desc}\n'
228 $ hg -R foo/bar log --template '{rev}:{node|short} {desc}\n'
205 2:31ecbdafd357 2-3-2
229 2:31ecbdafd357 2-3-2
206 1:9647f22de499 0-1-1
230 1:9647f22de499 0-1-1
207 0:4904098473f9 0-0-0
231 0:4904098473f9 0-0-0
208
232
209 Status between revisions:
233 Status between revisions:
210
234
211 $ hg status -S
235 $ hg status -S
212 $ hg status -S --rev 0:1
236 $ hg status -S --rev 0:1
213 M .hgsubstate
237 M .hgsubstate
214 M foo/.hgsubstate
238 M foo/.hgsubstate
215 M foo/bar/z.txt
239 M foo/bar/z.txt
216 M foo/y.txt
240 M foo/y.txt
217 $ hg diff --nodates -S -I '**/?.txt' --rev 0:1
241 $ hg diff --nodates -S -I '**/?.txt' --rev 0:1
218 diff -r af048e97ade2 -r d254738c5f5e foo/y.txt
242 diff -r af048e97ade2 -r d254738c5f5e foo/y.txt
219 --- a/foo/y.txt
243 --- a/foo/y.txt
220 +++ b/foo/y.txt
244 +++ b/foo/y.txt
221 @@ -1,1 +1,2 @@
245 @@ -1,1 +1,2 @@
222 y1
246 y1
223 +y2
247 +y2
224 diff -r 4904098473f9 -r 9647f22de499 foo/bar/z.txt
248 diff -r 4904098473f9 -r 9647f22de499 foo/bar/z.txt
225 --- a/foo/bar/z.txt
249 --- a/foo/bar/z.txt
226 +++ b/foo/bar/z.txt
250 +++ b/foo/bar/z.txt
227 @@ -1,1 +1,2 @@
251 @@ -1,1 +1,2 @@
228 z1
252 z1
229 +z2
253 +z2
230
254
231 Enable progress extension for archive tests:
255 Enable progress extension for archive tests:
232
256
233 $ cp $HGRCPATH $HGRCPATH.no-progress
257 $ cp $HGRCPATH $HGRCPATH.no-progress
234 $ cat >> $HGRCPATH <<EOF
258 $ cat >> $HGRCPATH <<EOF
235 > [extensions]
259 > [extensions]
236 > progress =
260 > progress =
237 > [progress]
261 > [progress]
238 > assume-tty = 1
262 > assume-tty = 1
239 > delay = 0
263 > delay = 0
240 > format = topic bar number
264 > format = topic bar number
241 > refresh = 0
265 > refresh = 0
242 > width = 60
266 > width = 60
243 > EOF
267 > EOF
244
268
245 Test archiving to a directory tree (the doubled lines in the output
269 Test archiving to a directory tree (the doubled lines in the output
246 only show up in the test output, not in real usage):
270 only show up in the test output, not in real usage):
247
271
248 $ hg archive --subrepos ../archive 2>&1 | $TESTDIR/filtercr.py
272 $ hg archive --subrepos ../archive 2>&1 | $TESTDIR/filtercr.py
249
273
250 archiving [ ] 0/3
274 archiving [ ] 0/3
251 archiving [ ] 0/3
275 archiving [ ] 0/3
252 archiving [=============> ] 1/3
276 archiving [=============> ] 1/3
253 archiving [=============> ] 1/3
277 archiving [=============> ] 1/3
254 archiving [===========================> ] 2/3
278 archiving [===========================> ] 2/3
255 archiving [===========================> ] 2/3
279 archiving [===========================> ] 2/3
256 archiving [==========================================>] 3/3
280 archiving [==========================================>] 3/3
257 archiving [==========================================>] 3/3
281 archiving [==========================================>] 3/3
258
282
259 archiving (foo) [ ] 0/3
283 archiving (foo) [ ] 0/3
260 archiving (foo) [ ] 0/3
284 archiving (foo) [ ] 0/3
261 archiving (foo) [===========> ] 1/3
285 archiving (foo) [===========> ] 1/3
262 archiving (foo) [===========> ] 1/3
286 archiving (foo) [===========> ] 1/3
263 archiving (foo) [=======================> ] 2/3
287 archiving (foo) [=======================> ] 2/3
264 archiving (foo) [=======================> ] 2/3
288 archiving (foo) [=======================> ] 2/3
265 archiving (foo) [====================================>] 3/3
289 archiving (foo) [====================================>] 3/3
266 archiving (foo) [====================================>] 3/3
290 archiving (foo) [====================================>] 3/3
267
291
268 archiving (foo/bar) [ ] 0/1 (glob)
292 archiving (foo/bar) [ ] 0/1 (glob)
269 archiving (foo/bar) [ ] 0/1 (glob)
293 archiving (foo/bar) [ ] 0/1 (glob)
270 archiving (foo/bar) [================================>] 1/1 (glob)
294 archiving (foo/bar) [================================>] 1/1 (glob)
271 archiving (foo/bar) [================================>] 1/1 (glob)
295 archiving (foo/bar) [================================>] 1/1 (glob)
272 \r (esc)
296 \r (esc)
273 $ find ../archive | sort
297 $ find ../archive | sort
274 ../archive
298 ../archive
275 ../archive/.hg_archival.txt
299 ../archive/.hg_archival.txt
276 ../archive/.hgsub
300 ../archive/.hgsub
277 ../archive/.hgsubstate
301 ../archive/.hgsubstate
278 ../archive/foo
302 ../archive/foo
279 ../archive/foo/.hgsub
303 ../archive/foo/.hgsub
280 ../archive/foo/.hgsubstate
304 ../archive/foo/.hgsubstate
281 ../archive/foo/bar
305 ../archive/foo/bar
282 ../archive/foo/bar/z.txt
306 ../archive/foo/bar/z.txt
283 ../archive/foo/y.txt
307 ../archive/foo/y.txt
284 ../archive/x.txt
308 ../archive/x.txt
285
309
286 Test archiving to zip file (unzip output is unstable):
310 Test archiving to zip file (unzip output is unstable):
287
311
288 $ hg archive --subrepos ../archive.zip 2>&1 | $TESTDIR/filtercr.py
312 $ hg archive --subrepos ../archive.zip 2>&1 | $TESTDIR/filtercr.py
289
313
290 archiving [ ] 0/3
314 archiving [ ] 0/3
291 archiving [ ] 0/3
315 archiving [ ] 0/3
292 archiving [=============> ] 1/3
316 archiving [=============> ] 1/3
293 archiving [=============> ] 1/3
317 archiving [=============> ] 1/3
294 archiving [===========================> ] 2/3
318 archiving [===========================> ] 2/3
295 archiving [===========================> ] 2/3
319 archiving [===========================> ] 2/3
296 archiving [==========================================>] 3/3
320 archiving [==========================================>] 3/3
297 archiving [==========================================>] 3/3
321 archiving [==========================================>] 3/3
298
322
299 archiving (foo) [ ] 0/3
323 archiving (foo) [ ] 0/3
300 archiving (foo) [ ] 0/3
324 archiving (foo) [ ] 0/3
301 archiving (foo) [===========> ] 1/3
325 archiving (foo) [===========> ] 1/3
302 archiving (foo) [===========> ] 1/3
326 archiving (foo) [===========> ] 1/3
303 archiving (foo) [=======================> ] 2/3
327 archiving (foo) [=======================> ] 2/3
304 archiving (foo) [=======================> ] 2/3
328 archiving (foo) [=======================> ] 2/3
305 archiving (foo) [====================================>] 3/3
329 archiving (foo) [====================================>] 3/3
306 archiving (foo) [====================================>] 3/3
330 archiving (foo) [====================================>] 3/3
307
331
308 archiving (foo/bar) [ ] 0/1 (glob)
332 archiving (foo/bar) [ ] 0/1 (glob)
309 archiving (foo/bar) [ ] 0/1 (glob)
333 archiving (foo/bar) [ ] 0/1 (glob)
310 archiving (foo/bar) [================================>] 1/1 (glob)
334 archiving (foo/bar) [================================>] 1/1 (glob)
311 archiving (foo/bar) [================================>] 1/1 (glob)
335 archiving (foo/bar) [================================>] 1/1 (glob)
312 \r (esc)
336 \r (esc)
313
337
314 Test archiving a revision that references a subrepo that is not yet
338 Test archiving a revision that references a subrepo that is not yet
315 cloned:
339 cloned:
316
340
317 $ hg clone -U . ../empty
341 $ hg clone -U . ../empty
318 $ cd ../empty
342 $ cd ../empty
319 $ hg archive --subrepos -r tip ../archive.tar.gz 2>&1 | $TESTDIR/filtercr.py
343 $ hg archive --subrepos -r tip ../archive.tar.gz 2>&1 | $TESTDIR/filtercr.py
320
344
321 archiving [ ] 0/3
345 archiving [ ] 0/3
322 archiving [ ] 0/3
346 archiving [ ] 0/3
323 archiving [=============> ] 1/3
347 archiving [=============> ] 1/3
324 archiving [=============> ] 1/3
348 archiving [=============> ] 1/3
325 archiving [===========================> ] 2/3
349 archiving [===========================> ] 2/3
326 archiving [===========================> ] 2/3
350 archiving [===========================> ] 2/3
327 archiving [==========================================>] 3/3
351 archiving [==========================================>] 3/3
328 archiving [==========================================>] 3/3
352 archiving [==========================================>] 3/3
329
353
330 archiving (foo) [ ] 0/3
354 archiving (foo) [ ] 0/3
331 archiving (foo) [ ] 0/3
355 archiving (foo) [ ] 0/3
332 archiving (foo) [===========> ] 1/3
356 archiving (foo) [===========> ] 1/3
333 archiving (foo) [===========> ] 1/3
357 archiving (foo) [===========> ] 1/3
334 archiving (foo) [=======================> ] 2/3
358 archiving (foo) [=======================> ] 2/3
335 archiving (foo) [=======================> ] 2/3
359 archiving (foo) [=======================> ] 2/3
336 archiving (foo) [====================================>] 3/3
360 archiving (foo) [====================================>] 3/3
337 archiving (foo) [====================================>] 3/3
361 archiving (foo) [====================================>] 3/3
338
362
339 archiving (foo/bar) [ ] 0/1 (glob)
363 archiving (foo/bar) [ ] 0/1 (glob)
340 archiving (foo/bar) [ ] 0/1 (glob)
364 archiving (foo/bar) [ ] 0/1 (glob)
341 archiving (foo/bar) [================================>] 1/1 (glob)
365 archiving (foo/bar) [================================>] 1/1 (glob)
342 archiving (foo/bar) [================================>] 1/1 (glob)
366 archiving (foo/bar) [================================>] 1/1 (glob)
343
367
344 cloning subrepo foo from $TESTTMP/repo/foo
368 cloning subrepo foo from $TESTTMP/repo/foo
345 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar (glob)
369 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar (glob)
346
370
347 The newly cloned subrepos contain no working copy:
371 The newly cloned subrepos contain no working copy:
348
372
349 $ hg -R foo summary
373 $ hg -R foo summary
350 parent: -1:000000000000 (no revision checked out)
374 parent: -1:000000000000 (no revision checked out)
351 branch: default
375 branch: default
352 commit: (clean)
376 commit: (clean)
353 update: 4 new changesets (update)
377 update: 4 new changesets (update)
354
378
355 Disable progress extension and cleanup:
379 Disable progress extension and cleanup:
356
380
357 $ mv $HGRCPATH.no-progress $HGRCPATH
381 $ mv $HGRCPATH.no-progress $HGRCPATH
358
382
359 Test archiving when there is a directory in the way for a subrepo
383 Test archiving when there is a directory in the way for a subrepo
360 created by archive:
384 created by archive:
361
385
362 $ hg clone -U . ../almost-empty
386 $ hg clone -U . ../almost-empty
363 $ cd ../almost-empty
387 $ cd ../almost-empty
364 $ mkdir foo
388 $ mkdir foo
365 $ echo f > foo/f
389 $ echo f > foo/f
366 $ hg archive --subrepos -r tip archive
390 $ hg archive --subrepos -r tip archive
367 cloning subrepo foo from $TESTTMP/empty/foo
391 cloning subrepo foo from $TESTTMP/empty/foo
368 abort: destination '$TESTTMP/almost-empty/foo' is not empty (glob)
392 abort: destination '$TESTTMP/almost-empty/foo' is not empty (glob)
369 [255]
393 [255]
370
394
371 Clone and test outgoing:
395 Clone and test outgoing:
372
396
373 $ cd ..
397 $ cd ..
374 $ hg clone repo repo2
398 $ hg clone repo repo2
375 updating to branch default
399 updating to branch default
376 cloning subrepo foo from $TESTTMP/repo/foo
400 cloning subrepo foo from $TESTTMP/repo/foo
377 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar (glob)
401 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar (glob)
378 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
402 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
379 $ cd repo2
403 $ cd repo2
380 $ hg outgoing -S
404 $ hg outgoing -S
381 comparing with $TESTTMP/repo (glob)
405 comparing with $TESTTMP/repo (glob)
382 searching for changes
406 searching for changes
383 no changes found
407 no changes found
384 comparing with $TESTTMP/repo/foo
408 comparing with $TESTTMP/repo/foo
385 searching for changes
409 searching for changes
386 no changes found
410 no changes found
387 comparing with $TESTTMP/repo/foo/bar
411 comparing with $TESTTMP/repo/foo/bar
388 searching for changes
412 searching for changes
389 no changes found
413 no changes found
390 [1]
414 [1]
391
415
392 Make nested change:
416 Make nested change:
393
417
394 $ echo y4 >> foo/y.txt
418 $ echo y4 >> foo/y.txt
395 $ hg diff --nodates -S
419 $ hg diff --nodates -S
396 diff -r 65903cebad86 foo/y.txt
420 diff -r 65903cebad86 foo/y.txt
397 --- a/foo/y.txt
421 --- a/foo/y.txt
398 +++ b/foo/y.txt
422 +++ b/foo/y.txt
399 @@ -1,3 +1,4 @@
423 @@ -1,3 +1,4 @@
400 y1
424 y1
401 y2
425 y2
402 y3
426 y3
403 +y4
427 +y4
404 $ hg commit --subrepos -m 3-4-2
428 $ hg commit --subrepos -m 3-4-2
405 committing subrepository foo
429 committing subrepository foo
406 $ hg outgoing -S
430 $ hg outgoing -S
407 comparing with $TESTTMP/repo (glob)
431 comparing with $TESTTMP/repo (glob)
408 searching for changes
432 searching for changes
409 changeset: 3:2655b8ecc4ee
433 changeset: 3:2655b8ecc4ee
410 tag: tip
434 tag: tip
411 user: test
435 user: test
412 date: Thu Jan 01 00:00:00 1970 +0000
436 date: Thu Jan 01 00:00:00 1970 +0000
413 summary: 3-4-2
437 summary: 3-4-2
414
438
415 comparing with $TESTTMP/repo/foo
439 comparing with $TESTTMP/repo/foo
416 searching for changes
440 searching for changes
417 changeset: 4:e96193d6cb36
441 changeset: 4:e96193d6cb36
418 tag: tip
442 tag: tip
419 user: test
443 user: test
420 date: Thu Jan 01 00:00:00 1970 +0000
444 date: Thu Jan 01 00:00:00 1970 +0000
421 summary: 3-4-2
445 summary: 3-4-2
422
446
423 comparing with $TESTTMP/repo/foo/bar
447 comparing with $TESTTMP/repo/foo/bar
424 searching for changes
448 searching for changes
425 no changes found
449 no changes found
426
450
427
451
428 Switch to original repo and setup default path:
452 Switch to original repo and setup default path:
429
453
430 $ cd ../repo
454 $ cd ../repo
431 $ echo '[paths]' >> .hg/hgrc
455 $ echo '[paths]' >> .hg/hgrc
432 $ echo 'default = ../repo2' >> .hg/hgrc
456 $ echo 'default = ../repo2' >> .hg/hgrc
433
457
434 Test incoming:
458 Test incoming:
435
459
436 $ hg incoming -S
460 $ hg incoming -S
437 comparing with $TESTTMP/repo2 (glob)
461 comparing with $TESTTMP/repo2 (glob)
438 searching for changes
462 searching for changes
439 changeset: 3:2655b8ecc4ee
463 changeset: 3:2655b8ecc4ee
440 tag: tip
464 tag: tip
441 user: test
465 user: test
442 date: Thu Jan 01 00:00:00 1970 +0000
466 date: Thu Jan 01 00:00:00 1970 +0000
443 summary: 3-4-2
467 summary: 3-4-2
444
468
445 comparing with $TESTTMP/repo2/foo
469 comparing with $TESTTMP/repo2/foo
446 searching for changes
470 searching for changes
447 changeset: 4:e96193d6cb36
471 changeset: 4:e96193d6cb36
448 tag: tip
472 tag: tip
449 user: test
473 user: test
450 date: Thu Jan 01 00:00:00 1970 +0000
474 date: Thu Jan 01 00:00:00 1970 +0000
451 summary: 3-4-2
475 summary: 3-4-2
452
476
453 comparing with $TESTTMP/repo2/foo/bar
477 comparing with $TESTTMP/repo2/foo/bar
454 searching for changes
478 searching for changes
455 no changes found
479 no changes found
456
480
457 $ hg incoming -S --bundle incoming.hg
481 $ hg incoming -S --bundle incoming.hg
458 abort: cannot combine --bundle and --subrepos
482 abort: cannot combine --bundle and --subrepos
459 [255]
483 [255]
460
484
461 Test missing subrepo:
485 Test missing subrepo:
462
486
463 $ rm -r foo
487 $ rm -r foo
464 $ hg status -S
488 $ hg status -S
465 warning: error "unknown revision '65903cebad86f1a84bd4f1134f62fa7dcb7a1c98'" in subrepository "foo"
489 warning: error "unknown revision '65903cebad86f1a84bd4f1134f62fa7dcb7a1c98'" in subrepository "foo"
466
490
467 Issue2619: IndexError: list index out of range on hg add with subrepos
491 Issue2619: IndexError: list index out of range on hg add with subrepos
468 The subrepo must sorts after the explicit filename.
492 The subrepo must sorts after the explicit filename.
469
493
470 $ cd ..
494 $ cd ..
471 $ hg init test
495 $ hg init test
472 $ cd test
496 $ cd test
473 $ hg init x
497 $ hg init x
474 $ echo "x = x" >> .hgsub
498 $ echo "x = x" >> .hgsub
475 $ hg add .hgsub
499 $ hg add .hgsub
476 $ touch a x/a
500 $ touch a x/a
477 $ hg add a x/a
501 $ hg add a x/a
General Comments 0
You need to be logged in to leave comments. Login now