Debian Codegraph @

tests/test-subrepo-recursion.t

raw
1 Create test repository:
2
3 $ hg init repo
4 $ cd repo
5 $ echo x1 > x.txt
6
7 $ hg init foo
8 $ cd foo
9 $ echo y1 > y.txt
10
11 $ hg init bar
12 $ cd bar
13 $ echo z1 > z.txt
14
15 $ cd ..
16 $ echo 'bar = bar' > .hgsub
17
18 $ cd ..
19 $ echo 'foo = foo' > .hgsub
20
21 Add files --- .hgsub files must go first to trigger subrepos:
22
23 $ hg add -S .hgsub
24 $ hg add -S foo/.hgsub
25 $ hg add -S foo/bar
26 adding foo/bar/z.txt
27 $ hg add -S
28 adding x.txt
29 adding foo/y.txt
30
31 Test recursive status without committing anything:
32
33 $ hg status -S
34 A .hgsub
35 A foo/.hgsub
36 A foo/bar/z.txt
37 A foo/y.txt
38 A x.txt
39
40 Test recursive diff without committing anything:
41
42 $ hg diff --nodates -S foo
43 diff -r 000000000000 foo/.hgsub
44 --- /dev/null
45 +++ b/foo/.hgsub
46 @@ -0,0 +1,1 @@
47 +bar = bar
48 diff -r 000000000000 foo/y.txt
49 --- /dev/null
50 +++ b/foo/y.txt
51 @@ -0,0 +1,1 @@
52 +y1
53 diff -r 000000000000 foo/bar/z.txt
54 --- /dev/null
55 +++ b/foo/bar/z.txt
56 @@ -0,0 +1,1 @@
57 +z1
58
59 Commits:
60
61 $ hg commit -m fails
62 abort: uncommitted changes in subrepository "foo"
63 (use --subrepos for recursive commit)
64 [255]
65
66 The --subrepos flag overwrite the config setting:
67
68 $ hg commit -m 0-0-0 --config ui.commitsubrepos=No --subrepos
69 committing subrepository foo
70 committing subrepository foo/bar
71
72 $ cd foo
73 $ echo y2 >> y.txt
74 $ hg commit -m 0-1-0
75
76 $ cd bar
77 $ echo z2 >> z.txt
78 $ hg commit -m 0-1-1
79
80 $ cd ..
81 $ hg commit -m 0-2-1
82
83 $ cd ..
84 $ hg commit -m 1-2-1
85
86 Change working directory:
87
88 $ echo y3 >> foo/y.txt
89 $ echo z3 >> foo/bar/z.txt
90 $ hg status -S
91 M foo/bar/z.txt
92 M foo/y.txt
93 $ hg diff --nodates -S
94 diff -r d254738c5f5e foo/y.txt
95 --- a/foo/y.txt
96 +++ b/foo/y.txt
97 @@ -1,2 +1,3 @@
98 y1
99 y2
100 +y3
101 diff -r 9647f22de499 foo/bar/z.txt
102 --- a/foo/bar/z.txt
103 +++ b/foo/bar/z.txt
104 @@ -1,2 +1,3 @@
105 z1
106 z2
107 +z3
108
109 Status call crossing repository boundaries:
110
111 $ hg status -S foo/bar/z.txt
112 M foo/bar/z.txt
113 $ hg status -S -I 'foo/?.txt'
114 M foo/y.txt
115 $ hg status -S -I '**/?.txt'
116 M foo/bar/z.txt
117 M foo/y.txt
118 $ hg diff --nodates -S -I '**/?.txt'
119 diff -r d254738c5f5e foo/y.txt
120 --- a/foo/y.txt
121 +++ b/foo/y.txt
122 @@ -1,2 +1,3 @@
123 y1
124 y2
125 +y3
126 diff -r 9647f22de499 foo/bar/z.txt
127 --- a/foo/bar/z.txt
128 +++ b/foo/bar/z.txt
129 @@ -1,2 +1,3 @@
130 z1
131 z2
132 +z3
133
134 Status from within a subdirectory:
135
136 $ mkdir dir
137 $ cd dir
138 $ echo a1 > a.txt
139 $ hg status -S
140 M foo/bar/z.txt
141 M foo/y.txt
142 ? dir/a.txt
143 $ hg diff --nodates -S
144 diff -r d254738c5f5e foo/y.txt
145 --- a/foo/y.txt
146 +++ b/foo/y.txt
147 @@ -1,2 +1,3 @@
148 y1
149 y2
150 +y3
151 diff -r 9647f22de499 foo/bar/z.txt
152 --- a/foo/bar/z.txt
153 +++ b/foo/bar/z.txt
154 @@ -1,2 +1,3 @@
155 z1
156 z2
157 +z3
158
159 Status with relative path:
160
161 $ hg status -S ..
162 M ../foo/bar/z.txt
163 M ../foo/y.txt
164 ? a.txt
165
166 XXX: filtering lfilesrepo.status() in 3.3-rc causes these files to be listed as
167 added instead of modified.
168 $ hg status -S .. --config extensions.largefiles=
169 M ../foo/bar/z.txt
170 M ../foo/y.txt
171 ? a.txt
172
173 $ hg diff --nodates -S ..
174 diff -r d254738c5f5e foo/y.txt
175 --- a/foo/y.txt
176 +++ b/foo/y.txt
177 @@ -1,2 +1,3 @@
178 y1
179 y2
180 +y3
181 diff -r 9647f22de499 foo/bar/z.txt
182 --- a/foo/bar/z.txt
183 +++ b/foo/bar/z.txt
184 @@ -1,2 +1,3 @@
185 z1
186 z2
187 +z3
188 $ cd ..
189
190 Cleanup and final commit:
191
192 $ rm -r dir
193 $ hg commit --subrepos -m 2-3-2
194 committing subrepository foo
195 committing subrepository foo/bar
196
197 Test explicit path commands within subrepos: add/forget
198 $ echo z1 > foo/bar/z2.txt
199 $ hg status -S
200 ? foo/bar/z2.txt
201 $ hg add foo/bar/z2.txt
202 $ hg status -S
203 A foo/bar/z2.txt
204 $ hg forget foo/bar/z2.txt
205 $ hg status -S
206 ? foo/bar/z2.txt
207 $ hg forget foo/bar/z2.txt
208 not removing foo/bar/z2.txt: file is already untracked
209 [1]
210 $ hg status -S
211 ? foo/bar/z2.txt
212 $ rm foo/bar/z2.txt
213
214 Log with the relationships between repo and its subrepo:
215
216 $ hg log --template '{rev}:{node|short} {desc}\n'
217 2:1326fa26d0c0 2-3-2
218 1:4b3c9ff4f66b 1-2-1
219 0:23376cbba0d8 0-0-0
220
221 $ hg -R foo log --template '{rev}:{node|short} {desc}\n'
222 3:65903cebad86 2-3-2
223 2:d254738c5f5e 0-2-1
224 1:8629ce7dcc39 0-1-0
225 0:af048e97ade2 0-0-0
226
227 $ hg -R foo/bar log --template '{rev}:{node|short} {desc}\n'
228 2:31ecbdafd357 2-3-2
229 1:9647f22de499 0-1-1
230 0:4904098473f9 0-0-0
231
232 Status between revisions:
233
234 $ hg status -S
235 $ hg status -S --rev 0:1
236 M .hgsubstate
237 M foo/.hgsubstate
238 M foo/bar/z.txt
239 M foo/y.txt
240 $ hg diff --nodates -S -I '**/?.txt' --rev 0:1
241 diff -r af048e97ade2 -r d254738c5f5e foo/y.txt
242 --- a/foo/y.txt
243 +++ b/foo/y.txt
244 @@ -1,1 +1,2 @@
245 y1
246 +y2
247 diff -r 4904098473f9 -r 9647f22de499 foo/bar/z.txt
248 --- a/foo/bar/z.txt
249 +++ b/foo/bar/z.txt
250 @@ -1,1 +1,2 @@
251 z1
252 +z2
253
254 #if serve
255 $ cd ..
256 $ hg serve -R repo --debug -S -p $HGPORT -d --pid-file=hg1.pid -E error.log -A access.log
257 adding = $TESTTMP/repo
258 adding foo = $TESTTMP/repo/foo
259 adding foo/bar = $TESTTMP/repo/foo/bar
260 listening at http://*:$HGPORT/ (bound to *:$HGPORT) (glob) (?)
261 adding = $TESTTMP/repo (?)
262 adding foo = $TESTTMP/repo/foo (?)
263 adding foo/bar = $TESTTMP/repo/foo/bar (?)
264 $ cat hg1.pid >> $DAEMON_PIDS
265
266 $ hg clone http://localhost:$HGPORT clone --config progress.disable=True
267 requesting all changes
268 adding changesets
269 adding manifests
270 adding file changes
271 added 3 changesets with 5 changes to 3 files
272 new changesets 23376cbba0d8:1326fa26d0c0
273 updating to branch default
274 cloning subrepo foo from http://localhost:$HGPORT/foo
275 requesting all changes
276 adding changesets
277 adding manifests
278 adding file changes
279 added 4 changesets with 7 changes to 3 files
280 new changesets af048e97ade2:65903cebad86
281 cloning subrepo foo/bar from http://localhost:$HGPORT/foo/bar
282 requesting all changes
283 adding changesets
284 adding manifests
285 adding file changes
286 added 3 changesets with 3 changes to 1 files
287 new changesets 4904098473f9:31ecbdafd357
288 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
289
290 $ cat clone/foo/bar/z.txt
291 z1
292 z2
293 z3
294
295 Clone pooling from a remote URL will share the top level repo and the subrepos,
296 even if they are referenced by remote URL.
297
298 $ hg --config extensions.share= --config share.pool=$TESTTMP/pool \
299 > clone http://localhost:$HGPORT shared
300 (sharing from new pooled repository 23376cbba0d87c15906bb3652584927c140907bf)
301 requesting all changes
302 adding changesets
303 adding manifests
304 adding file changes
305 added 3 changesets with 5 changes to 3 files
306 new changesets 23376cbba0d8:1326fa26d0c0
307 searching for changes
308 no changes found
309 updating working directory
310 cloning subrepo foo from http://localhost:$HGPORT/foo
311 (sharing from new pooled repository af048e97ade2e236f754f05d07013e586af0f8bf)
312 requesting all changes
313 adding changesets
314 adding manifests
315 adding file changes
316 added 4 changesets with 7 changes to 3 files
317 new changesets af048e97ade2:65903cebad86
318 searching for changes
319 no changes found
320 cloning subrepo foo/bar from http://localhost:$HGPORT/foo/bar
321 (sharing from new pooled repository 4904098473f96c900fec436dad267edd4da59fad)
322 requesting all changes
323 adding changesets
324 adding manifests
325 adding file changes
326 added 3 changesets with 3 changes to 1 files
327 new changesets 4904098473f9:31ecbdafd357
328 searching for changes
329 no changes found
330 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
331
332 $ cat access.log
333 * "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
334 * "GET /?cmd=batch HTTP/1.1" 200 - * (glob)
335 * "GET /?cmd=getbundle HTTP/1.1" 200 - * (glob)
336 * "GET /foo?cmd=capabilities HTTP/1.1" 200 - (glob)
337 * "GET /foo?cmd=batch HTTP/1.1" 200 - * (glob)
338 * "GET /foo?cmd=getbundle HTTP/1.1" 200 - * (glob)
339 * "GET /foo/bar?cmd=capabilities HTTP/1.1" 200 - (glob)
340 * "GET /foo/bar?cmd=batch HTTP/1.1" 200 - * (glob)
341 * "GET /foo/bar?cmd=getbundle HTTP/1.1" 200 - * (glob)
342 $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
343 $LOCALIP - - [$LOGDATE$] "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=0 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
344 $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
345 $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
346 $LOCALIP - - [$LOGDATE$] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=1326fa26d0c00d2146c63b56bb6a45149d7325ac&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
347 $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D1326fa26d0c00d2146c63b56bb6a45149d7325ac x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
348 $LOCALIP - - [$LOGDATE$] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=1326fa26d0c00d2146c63b56bb6a45149d7325ac&heads=1326fa26d0c00d2146c63b56bb6a45149d7325ac&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
349 $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=capabilities HTTP/1.1" 200 - (glob)
350 $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=0 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
351 $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=capabilities HTTP/1.1" 200 - (glob)
352 $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
353 $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=65903cebad86f1a84bd4f1134f62fa7dcb7a1c98&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
354 $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D65903cebad86f1a84bd4f1134f62fa7dcb7a1c98 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
355 $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=65903cebad86f1a84bd4f1134f62fa7dcb7a1c98&heads=65903cebad86f1a84bd4f1134f62fa7dcb7a1c98&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
356 $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=capabilities HTTP/1.1" 200 - (glob)
357 $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=0 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
358 $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=capabilities HTTP/1.1" 200 - (glob)
359 $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
360 $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=31ecbdafd357f54b281c9bd1d681bb90de219e22&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
361 $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D31ecbdafd357f54b281c9bd1d681bb90de219e22 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
362 $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=31ecbdafd357f54b281c9bd1d681bb90de219e22&heads=31ecbdafd357f54b281c9bd1d681bb90de219e22&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
363
364 $ killdaemons.py
365 $ rm hg1.pid error.log access.log
366 $ cd repo
367 #endif
368
369 Enable progress extension for archive tests:
370
371 $ cp $HGRCPATH $HGRCPATH.no-progress
372 $ cat >> $HGRCPATH <<EOF
373 > [progress]
374 > disable=False
375 > assume-tty = 1
376 > delay = 0
377 > # set changedelay really large so we don't see nested topics
378 > changedelay = 30000
379 > format = topic bar number
380 > refresh = 0
381 > width = 60
382 > EOF
383
384 Test archiving to a directory tree (the doubled lines in the output
385 only show up in the test output, not in real usage):
386
387 $ hg archive --subrepos ../archive
388 \r (no-eol) (esc)
389 archiving [ ] 0/3\r (no-eol) (esc)
390 archiving [=============> ] 1/3\r (no-eol) (esc)
391 archiving [===========================> ] 2/3\r (no-eol) (esc)
392 archiving [==========================================>] 3/3\r (no-eol) (esc)
393 \r (no-eol) (esc)
394 \r (no-eol) (esc)
395 archiving (foo) [ ] 0/3\r (no-eol) (esc)
396 archiving (foo) [===========> ] 1/3\r (no-eol) (esc)
397 archiving (foo) [=======================> ] 2/3\r (no-eol) (esc)
398 archiving (foo) [====================================>] 3/3\r (no-eol) (esc)
399 \r (no-eol) (esc)
400 \r (no-eol) (esc)
401 archiving (foo/bar) [ ] 0/1\r (no-eol) (esc)
402 archiving (foo/bar) [================================>] 1/1\r (no-eol) (esc)
403 \r (no-eol) (esc)
404 $ find ../archive | sort
405 ../archive
406 ../archive/.hg_archival.txt
407 ../archive/.hgsub
408 ../archive/.hgsubstate
409 ../archive/foo
410 ../archive/foo/.hgsub
411 ../archive/foo/.hgsubstate
412 ../archive/foo/bar
413 ../archive/foo/bar/z.txt
414 ../archive/foo/y.txt
415 ../archive/x.txt
416
417 Test archiving to zip file (unzip output is unstable):
418
419 $ hg archive --subrepos --prefix '.' ../archive.zip
420 \r (no-eol) (esc)
421 archiving [ ] 0/3\r (no-eol) (esc)
422 archiving [=============> ] 1/3\r (no-eol) (esc)
423 archiving [===========================> ] 2/3\r (no-eol) (esc)
424 archiving [==========================================>] 3/3\r (no-eol) (esc)
425 \r (no-eol) (esc)
426 \r (no-eol) (esc)
427 archiving (foo) [ ] 0/3\r (no-eol) (esc)
428 archiving (foo) [===========> ] 1/3\r (no-eol) (esc)
429 archiving (foo) [=======================> ] 2/3\r (no-eol) (esc)
430 archiving (foo) [====================================>] 3/3\r (no-eol) (esc)
431 \r (no-eol) (esc)
432 \r (no-eol) (esc)
433 archiving (foo/bar) [ ] 0/1\r (no-eol) (esc)
434 archiving (foo/bar) [================================>] 1/1\r (no-eol) (esc)
435 \r (no-eol) (esc)
436
437 (unzip date formating is unstable, we do not care about it and glob it out)
438
439 $ unzip -l ../archive.zip | grep -v -- ----- | grep -E -v files$
440 Archive: ../archive.zip
441 Length [ ]* Date [ ]* Time [ ]* Name (re)
442 172 [0-9:\- ]* .hg_archival.txt (re)
443 10 [0-9:\- ]* .hgsub (re)
444 45 [0-9:\- ]* .hgsubstate (re)
445 3 [0-9:\- ]* x.txt (re)
446 10 [0-9:\- ]* foo/.hgsub (re)
447 45 [0-9:\- ]* foo/.hgsubstate (re)
448 9 [0-9:\- ]* foo/y.txt (re)
449 9 [0-9:\- ]* foo/bar/z.txt (re)
450
451 Test archiving a revision that references a subrepo that is not yet
452 cloned:
453
454 #if hardlink
455 $ hg clone -U . ../empty
456 \r (no-eol) (esc)
457 linking [===> ] 1/10\r (no-eol) (esc) (no-rust !)
458 linking [=======> ] 2/10\r (no-eol) (esc) (no-rust !)
459 linking [===========> ] 3/10\r (no-eol) (esc) (no-rust !)
460 linking [================> ] 4/10\r (no-eol) (esc) (no-rust !)
461 linking [====================> ] 5/10\r (no-eol) (esc) (no-rust !)
462 linking [========================> ] 6/10\r (no-eol) (esc) (no-rust !)
463 linking [=============================> ] 7/10\r (no-eol) (esc) (no-rust !)
464 linking [=================================> ] 8/10\r (no-eol) (esc) (no-rust !)
465 linking [=====================================> ] 9/10\r (no-eol) (esc) (no-rust !)
466 linking [==========================================>] 10/10\r (no-eol) (esc) (no-rust !)
467 linking [==> ] 1/12\r (no-eol) (esc) (rust !)
468 linking [======> ] 2/12\r (no-eol) (esc) (rust !)
469 linking [=========> ] 3/12\r (no-eol) (esc) (rust !)
470 linking [=============> ] 4/12\r (no-eol) (esc) (rust !)
471 linking [================> ] 5/12\r (no-eol) (esc) (rust !)
472 linking [====================> ] 6/12\r (no-eol) (esc) (rust !)
473 linking [========================> ] 7/12\r (no-eol) (esc) (rust !)
474 linking [===========================> ] 8/12\r (no-eol) (esc) (rust !)
475 linking [===============================> ] 9/12\r (no-eol) (esc) (rust !)
476 linking [==================================> ] 10/12\r (no-eol) (esc) (rust !)
477 linking [======================================> ] 11/12\r (no-eol) (esc) (rust !)
478 linking [==========================================>] 12/12\r (no-eol) (esc) (rust !)
479 \r (no-eol) (esc)
480 #else
481 $ hg clone -U . ../empty
482 \r (no-eol) (esc)
483 linking [ <=> ] 1 (no-eol)
484 #endif
485
486 $ cd ../empty
487 #if hardlink
488 #if rust
489 $ hg archive --subrepos -r tip --prefix './' ../archive.tar.gz
490 \r (no-eol) (esc)
491 archiving [ ] 0/3\r (no-eol) (esc)
492 archiving [=============> ] 1/3\r (no-eol) (esc)
493 archiving [===========================> ] 2/3\r (no-eol) (esc)
494 archiving [==========================================>] 3/3\r (no-eol) (esc)
495 \r (no-eol) (esc)
496 \r (no-eol) (esc)
497 linking [==> ] 1/11\r (no-eol) (esc)
498 linking [======> ] 2/11\r (no-eol) (esc)
499 linking [==========> ] 3/11\r (no-eol) (esc)
500 linking [==============> ] 4/11\r (no-eol) (esc)
501 linking [==================> ] 5/11\r (no-eol) (esc)
502 linking [======================> ] 6/11\r (no-eol) (esc)
503 linking [==========================> ] 7/11\r (no-eol) (esc)
504 linking [==============================> ] 8/11\r (no-eol) (esc)
505 linking [==================================> ] 9/11\r (no-eol) (esc)
506 linking [======================================> ] 10/11\r (no-eol) (esc)
507 linking [==========================================>] 11/11\r (no-eol) (esc)
508 \r (no-eol) (esc)
509 \r (no-eol) (esc)
510 archiving (foo) [ ] 0/3\r (no-eol) (esc)
511 archiving (foo) [===========> ] 1/3\r (no-eol) (esc)
512 archiving (foo) [=======================> ] 2/3\r (no-eol) (esc)
513 archiving (foo) [====================================>] 3/3\r (no-eol) (esc)
514 \r (no-eol) (esc)
515 \r (no-eol) (esc)
516 linking [====> ] 1/9\r (no-eol) (esc)
517 linking [=========> ] 2/9\r (no-eol) (esc)
518 linking [==============> ] 3/9\r (no-eol) (esc)
519 linking [===================> ] 4/9\r (no-eol) (esc)
520 linking [========================> ] 5/9\r (no-eol) (esc)
521 linking [=============================> ] 6/9\r (no-eol) (esc)
522 linking [==================================> ] 7/9\r (no-eol) (esc)
523 linking [=======================================> ] 8/9\r (no-eol) (esc)
524 linking [============================================>] 9/9\r (no-eol) (esc)
525 \r (no-eol) (esc)
526 \r (no-eol) (esc)
527 archiving (foo/bar) [ ] 0/1\r (no-eol) (esc)
528 archiving (foo/bar) [================================>] 1/1\r (no-eol) (esc)
529 \r (no-eol) (esc)
530 cloning subrepo foo from $TESTTMP/repo/foo
531 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar
532 #else
533 $ hg archive --subrepos -r tip --prefix './' ../archive.tar.gz
534 \r (no-eol) (esc)
535 archiving [ ] 0/3\r (no-eol) (esc)
536 archiving [=============> ] 1/3\r (no-eol) (esc)
537 archiving [===========================> ] 2/3\r (no-eol) (esc)
538 archiving [==========================================>] 3/3\r (no-eol) (esc)
539 \r (no-eol) (esc)
540 \r (no-eol) (esc)
541 linking [====> ] 1/9\r (no-eol) (esc)
542 linking [=========> ] 2/9\r (no-eol) (esc)
543 linking [==============> ] 3/9\r (no-eol) (esc)
544 linking [===================> ] 4/9\r (no-eol) (esc)
545 linking [========================> ] 5/9\r (no-eol) (esc)
546 linking [=============================> ] 6/9\r (no-eol) (esc)
547 linking [==================================> ] 7/9\r (no-eol) (esc)
548 linking [=======================================> ] 8/9\r (no-eol) (esc)
549 linking [============================================>] 9/9\r (no-eol) (esc)
550 \r (no-eol) (esc)
551 \r (no-eol) (esc)
552 archiving (foo) [ ] 0/3\r (no-eol) (esc)
553 archiving (foo) [===========> ] 1/3\r (no-eol) (esc)
554 archiving (foo) [=======================> ] 2/3\r (no-eol) (esc)
555 archiving (foo) [====================================>] 3/3\r (no-eol) (esc)
556 \r (no-eol) (esc)
557 \r (no-eol) (esc)
558 linking [=====> ] 1/7\r (no-eol) (esc)
559 linking [===========> ] 2/7\r (no-eol) (esc)
560 linking [==================> ] 3/7\r (no-eol) (esc)
561 linking [========================> ] 4/7\r (no-eol) (esc)
562 linking [===============================> ] 5/7\r (no-eol) (esc)
563 linking [=====================================> ] 6/7\r (no-eol) (esc)
564 linking [============================================>] 7/7\r (no-eol) (esc)
565 \r (no-eol) (esc)
566 \r (no-eol) (esc)
567 archiving (foo/bar) [ ] 0/1\r (no-eol) (esc)
568 archiving (foo/bar) [================================>] 1/1\r (no-eol) (esc)
569 \r (no-eol) (esc)
570 cloning subrepo foo from $TESTTMP/repo/foo
571 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar
572 #endif
573 #else
574 Note there's a slight output glitch on non-hardlink systems: the last
575 "linking" progress topic never gets closed, leading to slight output corruption on that platform.
576 $ hg archive --subrepos -r tip --prefix './' ../archive.tar.gz
577 \r (no-eol) (esc)
578 archiving [ ] 0/3\r (no-eol) (esc)
579 archiving [=============> ] 1/3\r (no-eol) (esc)
580 archiving [===========================> ] 2/3\r (no-eol) (esc)
581 archiving [==========================================>] 3/3\r (no-eol) (esc)
582 \r (no-eol) (esc)
583 \r (no-eol) (esc)
584 linking [ <=> ] 1\r (no-eol) (esc)
585 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar
586 #endif
587
588 Archive + subrepos uses '/' for all component separators
589
590 $ tar -tzf ../archive.tar.gz | sort
591 .hg_archival.txt
592 .hgsub
593 .hgsubstate
594 foo/.hgsub
595 foo/.hgsubstate
596 foo/bar/z.txt
597 foo/y.txt
598 x.txt
599
600 The newly cloned subrepos contain no working copy:
601
602 $ hg -R foo summary
603 parent: -1:000000000000 (no revision checked out)
604 branch: default
605 commit: (clean)
606 update: 4 new changesets (update)
607
608 Sharing a local repo with missing local subrepos (i.e. it was never updated
609 from null) works because the default path is copied from the source repo,
610 whereas clone should fail.
611
612 $ hg --config progress.disable=True clone -U ../empty ../empty2
613
614 $ hg --config extensions.share= --config progress.disable=True \
615 > share ../empty2 ../empty_share
616 updating working directory
617 sharing subrepo foo from $TESTTMP/empty/foo
618 sharing subrepo foo/bar from $TESTTMP/empty/foo/bar
619 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
620
621 $ hg --config progress.disable=True clone ../empty2 ../empty_clone
622 updating to branch default
623 cloning subrepo foo from $TESTTMP/empty2/foo
624 abort: repository $TESTTMP/empty2/foo not found
625 [255]
626
627 Disable progress extension and cleanup:
628
629 $ mv $HGRCPATH.no-progress $HGRCPATH
630
631 Test archiving when there is a directory in the way for a subrepo
632 created by archive:
633
634 $ hg clone -U . ../almost-empty
635 $ cd ../almost-empty
636 $ mkdir foo
637 $ echo f > foo/f
638 $ hg archive --subrepos -r tip archive
639 cloning subrepo foo from $TESTTMP/empty/foo
640 abort: destination '$TESTTMP/almost-empty/foo' is not empty (in subrepository "foo")
641 [255]
642
643 Clone and test outgoing:
644
645 $ cd ..
646 $ hg clone repo repo2
647 updating to branch default
648 cloning subrepo foo from $TESTTMP/repo/foo
649 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar
650 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
651 $ cd repo2
652 $ hg outgoing -S
653 comparing with $TESTTMP/repo
654 searching for changes
655 no changes found
656 comparing with $TESTTMP/repo/foo
657 searching for changes
658 no changes found
659 comparing with $TESTTMP/repo/foo/bar
660 searching for changes
661 no changes found
662 [1]
663
664 Make nested change:
665
666 $ echo y4 >> foo/y.txt
667 $ hg diff --nodates -S
668 diff -r 65903cebad86 foo/y.txt
669 --- a/foo/y.txt
670 +++ b/foo/y.txt
671 @@ -1,3 +1,4 @@
672 y1
673 y2
674 y3
675 +y4
676 $ hg commit --subrepos -m 3-4-2
677 committing subrepository foo
678 $ hg outgoing -S
679 comparing with $TESTTMP/repo
680 searching for changes
681 changeset: 3:2655b8ecc4ee
682 tag: tip
683 user: test
684 date: Thu Jan 01 00:00:00 1970 +0000
685 summary: 3-4-2
686
687 comparing with $TESTTMP/repo/foo
688 searching for changes
689 changeset: 4:e96193d6cb36
690 tag: tip
691 user: test
692 date: Thu Jan 01 00:00:00 1970 +0000
693 summary: 3-4-2
694
695 comparing with $TESTTMP/repo/foo/bar
696 searching for changes
697 no changes found
698
699
700 Switch to original repo and setup default path:
701
702 $ cd ../repo
703 $ echo '[paths]' >> .hg/hgrc
704 $ echo 'default = ../repo2' >> .hg/hgrc
705
706 Test incoming:
707
708 $ hg incoming -S
709 comparing with $TESTTMP/repo2
710 searching for changes
711 changeset: 3:2655b8ecc4ee
712 tag: tip
713 user: test
714 date: Thu Jan 01 00:00:00 1970 +0000
715 summary: 3-4-2
716
717 comparing with $TESTTMP/repo2/foo
718 searching for changes
719 changeset: 4:e96193d6cb36
720 tag: tip
721 user: test
722 date: Thu Jan 01 00:00:00 1970 +0000
723 summary: 3-4-2
724
725 comparing with $TESTTMP/repo2/foo/bar
726 searching for changes
727 no changes found
728
729 $ hg incoming -S --bundle incoming.hg
730 abort: cannot specify both --subrepos and --bundle
731 [10]
732
733 Test missing subrepo:
734
735 $ rm -r foo
736 $ hg status -S
737 warning: error "unknown revision '65903cebad86f1a84bd4f1134f62fa7dcb7a1c98'" in subrepository "foo"
738
739 Issue2619: IndexError: list index out of range on hg add with subrepos
740 The subrepo must sorts after the explicit filename.
741
742 $ cd ..
743 $ hg init test
744 $ cd test
745 $ hg init x
746 $ echo abc > abc.txt
747 $ hg ci -Am "abc"
748 adding abc.txt
749 $ echo "x = x" >> .hgsub
750 $ hg add .hgsub
751 $ touch a x/a
752 $ hg add a x/a
753
754 $ hg ci -Sm "added x"
755 committing subrepository x
756 $ echo abc > x/a
757 $ hg revert --rev '.^' "set:subrepo('glob:x*')"
758 abort: subrepository 'x' does not exist in 25ac2c9b3180!
759 [255]
760
761 $ cd ..