##// END OF EJS Templates
tests: fix globs for Windows...
Matt Harbison -
r23348:bbe56e07 default
parent child Browse files
Show More
@@ -1,92 +1,92 b''
1 1 hide outer repo
2 2 $ hg init
3 3
4 4 Invalid syntax: no value
5 5
6 6 $ cat > .hg/hgrc << EOF
7 7 > novaluekey
8 8 > EOF
9 9 $ hg showconfig
10 hg: parse error at $TESTTMP/.hg/hgrc:1: novaluekey
10 hg: parse error at $TESTTMP/.hg/hgrc:1: novaluekey (glob)
11 11 [255]
12 12
13 13 Invalid syntax: no key
14 14
15 15 $ cat > .hg/hgrc << EOF
16 16 > =nokeyvalue
17 17 > EOF
18 18 $ hg showconfig
19 hg: parse error at $TESTTMP/.hg/hgrc:1: =nokeyvalue
19 hg: parse error at $TESTTMP/.hg/hgrc:1: =nokeyvalue (glob)
20 20 [255]
21 21
22 22 Test hint about invalid syntax from leading white space
23 23
24 24 $ cat > .hg/hgrc << EOF
25 25 > key=value
26 26 > EOF
27 27 $ hg showconfig
28 hg: parse error at $TESTTMP/.hg/hgrc:1: key=value
28 hg: parse error at $TESTTMP/.hg/hgrc:1: key=value (glob)
29 29 unexpected leading whitespace
30 30 [255]
31 31
32 32 $ cat > .hg/hgrc << EOF
33 33 > [section]
34 34 > key=value
35 35 > EOF
36 36 $ hg showconfig
37 hg: parse error at $TESTTMP/.hg/hgrc:1: [section]
37 hg: parse error at $TESTTMP/.hg/hgrc:1: [section] (glob)
38 38 unexpected leading whitespace
39 39 [255]
40 40
41 41 Reset hgrc
42 42
43 43 $ echo > .hg/hgrc
44 44
45 45 Test case sensitive configuration
46 46
47 47 $ cat <<EOF >> $HGRCPATH
48 48 > [Section]
49 49 > KeY = Case Sensitive
50 50 > key = lower case
51 51 > EOF
52 52
53 53 $ hg showconfig Section
54 54 Section.KeY=Case Sensitive
55 55 Section.key=lower case
56 56
57 57 Test "%unset"
58 58
59 59 $ cat >> $HGRCPATH <<EOF
60 60 > [unsettest]
61 61 > local-hgrcpath = should be unset (HGRCPATH)
62 62 > %unset local-hgrcpath
63 63 >
64 64 > global = should be unset (HGRCPATH)
65 65 >
66 66 > both = should be unset (HGRCPATH)
67 67 >
68 68 > set-after-unset = should be unset (HGRCPATH)
69 69 > EOF
70 70
71 71 $ cat >> .hg/hgrc <<EOF
72 72 > [unsettest]
73 73 > local-hgrc = should be unset (.hg/hgrc)
74 74 > %unset local-hgrc
75 75 >
76 76 > %unset global
77 77 >
78 78 > both = should be unset (.hg/hgrc)
79 79 > %unset both
80 80 >
81 81 > set-after-unset = should be unset (.hg/hgrc)
82 82 > %unset set-after-unset
83 83 > set-after-unset = should be set (.hg/hgrc)
84 84 > EOF
85 85
86 86 $ hg showconfig unsettest
87 87 unsettest.set-after-unset=should be set (.hg/hgrc)
88 88
89 89 Test exit code when no config matches
90 90
91 91 $ hg config Section.idontexist
92 92 [1]
@@ -1,864 +1,864 b''
1 1 This file contains testcases that tend to be related to special cases or less
2 2 common commands affecting largefile.
3 3
4 4 Each sections should be independent of each others.
5 5
6 6 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
7 7 $ mkdir "${USERCACHE}"
8 8 $ cat >> $HGRCPATH <<EOF
9 9 > [extensions]
10 10 > largefiles=
11 11 > purge=
12 12 > rebase=
13 13 > transplant=
14 14 > [phases]
15 15 > publish=False
16 16 > [largefiles]
17 17 > minsize=2
18 18 > patterns=glob:**.dat
19 19 > usercache=${USERCACHE}
20 20 > [hooks]
21 21 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
22 22 > EOF
23 23
24 24
25 25
26 26 Test copies and moves from a directory other than root (issue3516)
27 27 =========================================================================
28 28
29 29 $ hg init lf_cpmv
30 30 $ cd lf_cpmv
31 31 $ mkdir dira
32 32 $ mkdir dira/dirb
33 33 $ touch dira/dirb/largefile
34 34 $ hg add --large dira/dirb/largefile
35 35 $ hg commit -m "added"
36 36 Invoking status precommit hook
37 37 A dira/dirb/largefile
38 38 $ cd dira
39 39 $ hg cp dirb/largefile foo/largefile
40 40 $ hg ci -m "deep copy"
41 41 Invoking status precommit hook
42 42 A dira/foo/largefile
43 43 $ find . | sort
44 44 .
45 45 ./dirb
46 46 ./dirb/largefile
47 47 ./foo
48 48 ./foo/largefile
49 49 $ hg mv foo/largefile baz/largefile
50 50 $ hg ci -m "moved"
51 51 Invoking status precommit hook
52 52 A dira/baz/largefile
53 53 R dira/foo/largefile
54 54 $ find . | sort
55 55 .
56 56 ./baz
57 57 ./baz/largefile
58 58 ./dirb
59 59 ./dirb/largefile
60 60 $ cd ..
61 61 $ hg mv dira dirc
62 62 moving .hglf/dira/baz/largefile to .hglf/dirc/baz/largefile (glob)
63 63 moving .hglf/dira/dirb/largefile to .hglf/dirc/dirb/largefile (glob)
64 64 $ find * | sort
65 65 dirc
66 66 dirc/baz
67 67 dirc/baz/largefile
68 68 dirc/dirb
69 69 dirc/dirb/largefile
70 70 $ hg up -qC
71 71 $ cd ..
72 72
73 73 Clone a local repository owned by another user
74 74 ===================================================
75 75
76 76 #if unix-permissions
77 77
78 78 We have to simulate that here by setting $HOME and removing write permissions
79 79 $ ORIGHOME="$HOME"
80 80 $ mkdir alice
81 81 $ HOME="`pwd`/alice"
82 82 $ cd alice
83 83 $ hg init pubrepo
84 84 $ cd pubrepo
85 85 $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null
86 86 $ hg add --large a-large-file
87 87 $ hg commit -m "Add a large file"
88 88 Invoking status precommit hook
89 89 A a-large-file
90 90 $ cd ..
91 91 $ chmod -R a-w pubrepo
92 92 $ cd ..
93 93 $ mkdir bob
94 94 $ HOME="`pwd`/bob"
95 95 $ cd bob
96 96 $ hg clone --pull ../alice/pubrepo pubrepo
97 97 requesting all changes
98 98 adding changesets
99 99 adding manifests
100 100 adding file changes
101 101 added 1 changesets with 1 changes to 1 files
102 102 updating to branch default
103 103 getting changed largefiles
104 104 1 largefiles updated, 0 removed
105 105 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
106 106 $ cd ..
107 107 $ chmod -R u+w alice/pubrepo
108 108 $ HOME="$ORIGHOME"
109 109
110 110 #endif
111 111
112 112
113 113 Symlink to a large largefile should behave the same as a symlink to a normal file
114 114 =====================================================================================
115 115
116 116 #if symlink
117 117
118 118 $ hg init largesymlink
119 119 $ cd largesymlink
120 120 $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null
121 121 $ hg add --large largefile
122 122 $ hg commit -m "commit a large file"
123 123 Invoking status precommit hook
124 124 A largefile
125 125 $ ln -s largefile largelink
126 126 $ hg add largelink
127 127 $ hg commit -m "commit a large symlink"
128 128 Invoking status precommit hook
129 129 A largelink
130 130 $ rm -f largelink
131 131 $ hg up >/dev/null
132 132 $ test -f largelink
133 133 [1]
134 134 $ test -L largelink
135 135 [1]
136 136 $ rm -f largelink # make next part of the test independent of the previous
137 137 $ hg up -C >/dev/null
138 138 $ test -f largelink
139 139 $ test -L largelink
140 140 $ cd ..
141 141
142 142 #endif
143 143
144 144
145 145 test for pattern matching on 'hg status':
146 146 ==============================================
147 147
148 148
149 149 to boost performance, largefiles checks whether specified patterns are
150 150 related to largefiles in working directory (NOT to STANDIN) or not.
151 151
152 152 $ hg init statusmatch
153 153 $ cd statusmatch
154 154
155 155 $ mkdir -p a/b/c/d
156 156 $ echo normal > a/b/c/d/e.normal.txt
157 157 $ hg add a/b/c/d/e.normal.txt
158 158 $ echo large > a/b/c/d/e.large.txt
159 159 $ hg add --large a/b/c/d/e.large.txt
160 160 $ mkdir -p a/b/c/x
161 161 $ echo normal > a/b/c/x/y.normal.txt
162 162 $ hg add a/b/c/x/y.normal.txt
163 163 $ hg commit -m 'add files'
164 164 Invoking status precommit hook
165 165 A a/b/c/d/e.large.txt
166 166 A a/b/c/d/e.normal.txt
167 167 A a/b/c/x/y.normal.txt
168 168
169 169 (1) no pattern: no performance boost
170 170 $ hg status -A
171 171 C a/b/c/d/e.large.txt
172 172 C a/b/c/d/e.normal.txt
173 173 C a/b/c/x/y.normal.txt
174 174
175 175 (2) pattern not related to largefiles: performance boost
176 176 $ hg status -A a/b/c/x
177 177 C a/b/c/x/y.normal.txt
178 178
179 179 (3) pattern related to largefiles: no performance boost
180 180 $ hg status -A a/b/c/d
181 181 C a/b/c/d/e.large.txt
182 182 C a/b/c/d/e.normal.txt
183 183
184 184 (4) pattern related to STANDIN (not to largefiles): performance boost
185 185 $ hg status -A .hglf/a
186 186 C .hglf/a/b/c/d/e.large.txt
187 187
188 188 (5) mixed case: no performance boost
189 189 $ hg status -A a/b/c/x a/b/c/d
190 190 C a/b/c/d/e.large.txt
191 191 C a/b/c/d/e.normal.txt
192 192 C a/b/c/x/y.normal.txt
193 193
194 194 verify that largefiles doesn't break filesets
195 195
196 196 $ hg log --rev . --exclude "set:binary()"
197 197 changeset: 0:41bd42f10efa
198 198 tag: tip
199 199 user: test
200 200 date: Thu Jan 01 00:00:00 1970 +0000
201 201 summary: add files
202 202
203 203 verify that large files in subrepos handled properly
204 204 $ hg init subrepo
205 205 $ echo "subrepo = subrepo" > .hgsub
206 206 $ hg add .hgsub
207 207 $ hg ci -m "add subrepo"
208 208 Invoking status precommit hook
209 209 A .hgsub
210 210 ? .hgsubstate
211 211 $ echo "rev 1" > subrepo/large.txt
212 212 $ hg -R subrepo add --large subrepo/large.txt
213 213 $ hg sum
214 214 parent: 1:8ee150ea2e9c tip
215 215 add subrepo
216 216 branch: default
217 217 commit: 1 subrepos
218 218 update: (current)
219 219 $ hg st
220 220 $ hg st -S
221 221 A subrepo/large.txt
222 222 $ hg ci -S -m "commit top repo"
223 223 committing subrepository subrepo
224 224 Invoking status precommit hook
225 225 A large.txt
226 226 Invoking status precommit hook
227 227 M .hgsubstate
228 228 # No differences
229 229 $ hg st -S
230 230 $ hg sum
231 231 parent: 2:ce4cd0c527a6 tip
232 232 commit top repo
233 233 branch: default
234 234 commit: (clean)
235 235 update: (current)
236 236 $ echo "rev 2" > subrepo/large.txt
237 237 $ hg st -S
238 238 M subrepo/large.txt
239 239 $ hg sum
240 240 parent: 2:ce4cd0c527a6 tip
241 241 commit top repo
242 242 branch: default
243 243 commit: 1 subrepos
244 244 update: (current)
245 245 $ hg ci -m "this commit should fail without -S"
246 246 abort: uncommitted changes in subrepo subrepo
247 247 (use --subrepos for recursive commit)
248 248 [255]
249 249
250 250 Add a normal file to the subrepo, then test archiving
251 251
252 252 $ echo 'normal file' > subrepo/normal.txt
253 253 $ hg -R subrepo add subrepo/normal.txt
254 254
255 255 Lock in subrepo, otherwise the change isn't archived
256 256
257 257 $ hg ci -S -m "add normal file to top level"
258 258 committing subrepository subrepo
259 259 Invoking status precommit hook
260 260 M large.txt
261 261 A normal.txt
262 262 Invoking status precommit hook
263 263 M .hgsubstate
264 264 $ hg archive -S ../lf_subrepo_archive
265 265 $ find ../lf_subrepo_archive | sort
266 266 ../lf_subrepo_archive
267 267 ../lf_subrepo_archive/.hg_archival.txt
268 268 ../lf_subrepo_archive/.hgsub
269 269 ../lf_subrepo_archive/.hgsubstate
270 270 ../lf_subrepo_archive/a
271 271 ../lf_subrepo_archive/a/b
272 272 ../lf_subrepo_archive/a/b/c
273 273 ../lf_subrepo_archive/a/b/c/d
274 274 ../lf_subrepo_archive/a/b/c/d/e.large.txt
275 275 ../lf_subrepo_archive/a/b/c/d/e.normal.txt
276 276 ../lf_subrepo_archive/a/b/c/x
277 277 ../lf_subrepo_archive/a/b/c/x/y.normal.txt
278 278 ../lf_subrepo_archive/subrepo
279 279 ../lf_subrepo_archive/subrepo/large.txt
280 280 ../lf_subrepo_archive/subrepo/normal.txt
281 281
282 282 Test update with subrepos.
283 283
284 284 $ hg update 0
285 285 getting changed largefiles
286 286 0 largefiles updated, 1 removed
287 287 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
288 288 $ hg status -S
289 289 $ hg update tip
290 290 getting changed largefiles
291 291 1 largefiles updated, 0 removed
292 292 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
293 293 $ hg status -S
294 294 # modify a large file
295 295 $ echo "modified" > subrepo/large.txt
296 296 $ hg st -S
297 297 M subrepo/large.txt
298 298 # update -C should revert the change.
299 299 $ hg update -C
300 300 getting changed largefiles
301 301 1 largefiles updated, 0 removed
302 302 getting changed largefiles
303 303 0 largefiles updated, 0 removed
304 304 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
305 305 $ hg status -S
306 306
307 307 Test archiving a revision that references a subrepo that is not yet
308 308 cloned (see test-subrepo-recursion.t):
309 309
310 310 $ hg clone -U . ../empty
311 311 $ cd ../empty
312 312 $ hg archive --subrepos -r tip ../archive.tar.gz
313 313 cloning subrepo subrepo from $TESTTMP/statusmatch/subrepo
314 314 $ cd ..
315 315
316 316
317 317
318 318
319 319
320 320
321 321 Test addremove, forget and others
322 322 ==============================================
323 323
324 324 Test that addremove picks up largefiles prior to the initial commit (issue3541)
325 325
326 326 $ hg init addrm2
327 327 $ cd addrm2
328 328 $ touch large.dat
329 329 $ touch large2.dat
330 330 $ touch normal
331 331 $ hg add --large large.dat
332 332 $ hg addremove -v
333 333 adding large2.dat as a largefile
334 334 adding normal
335 335
336 336 Test that forgetting all largefiles reverts to islfilesrepo() == False
337 337 (addremove will add *.dat as normal files now)
338 338 $ hg forget large.dat
339 339 $ hg forget large2.dat
340 340 $ hg addremove -v
341 341 adding large.dat
342 342 adding large2.dat
343 343
344 344 Test commit's addremove option prior to the first commit
345 345 $ hg forget large.dat
346 346 $ hg forget large2.dat
347 347 $ hg add --large large.dat
348 348 $ hg ci -Am "commit"
349 349 adding large2.dat as a largefile
350 350 Invoking status precommit hook
351 351 A large.dat
352 352 A large2.dat
353 353 A normal
354 354 $ find .hglf | sort
355 355 .hglf
356 356 .hglf/large.dat
357 357 .hglf/large2.dat
358 358
359 359 Test actions on largefiles using relative paths from subdir
360 360
361 361 $ mkdir sub
362 362 $ cd sub
363 363 $ echo anotherlarge > anotherlarge
364 364 $ hg add --large anotherlarge
365 365 $ hg st
366 366 A sub/anotherlarge
367 367 $ hg st anotherlarge
368 368 A anotherlarge
369 369 $ hg commit -m anotherlarge anotherlarge
370 370 Invoking status precommit hook
371 371 A sub/anotherlarge
372 372 $ hg log anotherlarge
373 373 changeset: 1:9627a577c5e9
374 374 tag: tip
375 375 user: test
376 376 date: Thu Jan 01 00:00:00 1970 +0000
377 377 summary: anotherlarge
378 378
379 379 $ hg log -G anotherlarge
380 380 @ changeset: 1:9627a577c5e9
381 381 | tag: tip
382 382 | user: test
383 383 | date: Thu Jan 01 00:00:00 1970 +0000
384 384 | summary: anotherlarge
385 385 |
386 386 $ echo more >> anotherlarge
387 387 $ hg st .
388 388 M anotherlarge
389 389 $ hg cat anotherlarge
390 390 anotherlarge
391 391 $ hg revert anotherlarge
392 392 $ hg st
393 393 ? sub/anotherlarge.orig
394 394 $ cd ..
395 395
396 396 $ cd ..
397 397
398 398 Check error message while exchange
399 399 =========================================================
400 400
401 401 issue3651: summary/outgoing with largefiles shows "no remote repo"
402 402 unexpectedly
403 403
404 404 $ mkdir issue3651
405 405 $ cd issue3651
406 406
407 407 $ hg init src
408 408 $ echo a > src/a
409 409 $ hg -R src add --large src/a
410 410 $ hg -R src commit -m '#0'
411 411 Invoking status precommit hook
412 412 A a
413 413
414 414 check messages when no remote repository is specified:
415 415 "no remote repo" route for "hg outgoing --large" is not tested here,
416 416 because it can't be reproduced easily.
417 417
418 418 $ hg init clone1
419 419 $ hg -R clone1 -q pull src
420 420 $ hg -R clone1 -q update
421 421 $ hg -R clone1 paths | grep default
422 422 [1]
423 423
424 424 $ hg -R clone1 summary --large
425 425 parent: 0:fc0bd45326d3 tip
426 426 #0
427 427 branch: default
428 428 commit: (clean)
429 429 update: (current)
430 430 largefiles: (no remote repo)
431 431
432 432 check messages when there is no files to upload:
433 433
434 434 $ hg -q clone src clone2
435 435 $ hg -R clone2 paths | grep default
436 436 default = $TESTTMP/issue3651/src (glob)
437 437
438 438 $ hg -R clone2 summary --large
439 439 parent: 0:fc0bd45326d3 tip
440 440 #0
441 441 branch: default
442 442 commit: (clean)
443 443 update: (current)
444 444 largefiles: (no files to upload)
445 445 $ hg -R clone2 outgoing --large
446 446 comparing with $TESTTMP/issue3651/src (glob)
447 447 searching for changes
448 448 no changes found
449 449 largefiles: no files to upload
450 450 [1]
451 451
452 452 $ hg -R clone2 outgoing --large --graph --template "{rev}"
453 453 comparing with $TESTTMP/issue3651/src (glob)
454 454 searching for changes
455 455 no changes found
456 456 largefiles: no files to upload
457 457
458 458 check messages when there are files to upload:
459 459
460 460 $ echo b > clone2/b
461 461 $ hg -R clone2 add --large clone2/b
462 462 $ hg -R clone2 commit -m '#1'
463 463 Invoking status precommit hook
464 464 A b
465 465 $ hg -R clone2 summary --large
466 466 parent: 1:1acbe71ce432 tip
467 467 #1
468 468 branch: default
469 469 commit: (clean)
470 470 update: (current)
471 471 largefiles: 1 entities for 1 files to upload
472 472 $ hg -R clone2 outgoing --large
473 473 comparing with $TESTTMP/issue3651/src (glob)
474 474 searching for changes
475 475 changeset: 1:1acbe71ce432
476 476 tag: tip
477 477 user: test
478 478 date: Thu Jan 01 00:00:00 1970 +0000
479 479 summary: #1
480 480
481 481 largefiles to upload (1 entities):
482 482 b
483 483
484 484 $ hg -R clone2 outgoing --large --graph --template "{rev}"
485 comparing with $TESTTMP/issue3651/src
485 comparing with $TESTTMP/issue3651/src (glob)
486 486 searching for changes
487 487 @ 1
488 488
489 489 largefiles to upload (1 entities):
490 490 b
491 491
492 492
493 493 $ cp clone2/b clone2/b1
494 494 $ cp clone2/b clone2/b2
495 495 $ hg -R clone2 add --large clone2/b1 clone2/b2
496 496 $ hg -R clone2 commit -m '#2: add largefiles referring same entity'
497 497 Invoking status precommit hook
498 498 A b1
499 499 A b2
500 500 $ hg -R clone2 summary --large
501 501 parent: 2:6095d0695d70 tip
502 502 #2: add largefiles referring same entity
503 503 branch: default
504 504 commit: (clean)
505 505 update: (current)
506 506 largefiles: 1 entities for 3 files to upload
507 507 $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n"
508 508 comparing with $TESTTMP/issue3651/src (glob)
509 509 searching for changes
510 510 1:1acbe71ce432
511 511 2:6095d0695d70
512 512 largefiles to upload (1 entities):
513 513 b
514 514 b1
515 515 b2
516 516
517 517 $ hg -R clone2 cat -r 1 clone2/.hglf/b
518 518 89e6c98d92887913cadf06b2adb97f26cde4849b
519 519 $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" --debug
520 520 comparing with $TESTTMP/issue3651/src (glob)
521 521 query 1; heads
522 522 searching for changes
523 523 all remote heads known locally
524 524 1:1acbe71ce432
525 525 2:6095d0695d70
526 526 largefiles to upload (1 entities):
527 527 b
528 528 89e6c98d92887913cadf06b2adb97f26cde4849b
529 529 b1
530 530 89e6c98d92887913cadf06b2adb97f26cde4849b
531 531 b2
532 532 89e6c98d92887913cadf06b2adb97f26cde4849b
533 533
534 534
535 535 $ echo bbb > clone2/b
536 536 $ hg -R clone2 commit -m '#3: add new largefile entity as existing file'
537 537 Invoking status precommit hook
538 538 M b
539 539 $ echo bbbb > clone2/b
540 540 $ hg -R clone2 commit -m '#4: add new largefile entity as existing file'
541 541 Invoking status precommit hook
542 542 M b
543 543 $ cp clone2/b1 clone2/b
544 544 $ hg -R clone2 commit -m '#5: refer existing largefile entity again'
545 545 Invoking status precommit hook
546 546 M b
547 547 $ hg -R clone2 summary --large
548 548 parent: 5:036794ea641c tip
549 549 #5: refer existing largefile entity again
550 550 branch: default
551 551 commit: (clean)
552 552 update: (current)
553 553 largefiles: 3 entities for 3 files to upload
554 554 $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n"
555 555 comparing with $TESTTMP/issue3651/src (glob)
556 556 searching for changes
557 557 1:1acbe71ce432
558 558 2:6095d0695d70
559 559 3:7983dce246cc
560 560 4:233f12ada4ae
561 561 5:036794ea641c
562 562 largefiles to upload (3 entities):
563 563 b
564 564 b1
565 565 b2
566 566
567 567 $ hg -R clone2 cat -r 3 clone2/.hglf/b
568 568 c801c9cfe94400963fcb683246217d5db77f9a9a
569 569 $ hg -R clone2 cat -r 4 clone2/.hglf/b
570 570 13f9ed0898e315bf59dc2973fec52037b6f441a2
571 571 $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" --debug
572 572 comparing with $TESTTMP/issue3651/src (glob)
573 573 query 1; heads
574 574 searching for changes
575 575 all remote heads known locally
576 576 1:1acbe71ce432
577 577 2:6095d0695d70
578 578 3:7983dce246cc
579 579 4:233f12ada4ae
580 580 5:036794ea641c
581 581 largefiles to upload (3 entities):
582 582 b
583 583 13f9ed0898e315bf59dc2973fec52037b6f441a2
584 584 89e6c98d92887913cadf06b2adb97f26cde4849b
585 585 c801c9cfe94400963fcb683246217d5db77f9a9a
586 586 b1
587 587 89e6c98d92887913cadf06b2adb97f26cde4849b
588 588 b2
589 589 89e6c98d92887913cadf06b2adb97f26cde4849b
590 590
591 591
592 592 Pushing revision #1 causes uploading entity 89e6c98d9288, which is
593 593 shared also by largefiles b1, b2 in revision #2 and b in revision #5.
594 594
595 595 Then, entity 89e6c98d9288 is not treated as "outgoing entity" at "hg
596 596 summary" and "hg outgoing", even though files in outgoing revision #2
597 597 and #5 refer it.
598 598
599 599 $ hg -R clone2 push -r 1 -q
600 600 $ hg -R clone2 summary --large
601 601 parent: 5:036794ea641c tip
602 602 #5: refer existing largefile entity again
603 603 branch: default
604 604 commit: (clean)
605 605 update: (current)
606 606 largefiles: 2 entities for 1 files to upload
607 607 $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n"
608 608 comparing with $TESTTMP/issue3651/src (glob)
609 609 searching for changes
610 610 2:6095d0695d70
611 611 3:7983dce246cc
612 612 4:233f12ada4ae
613 613 5:036794ea641c
614 614 largefiles to upload (2 entities):
615 615 b
616 616
617 617 $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" --debug
618 618 comparing with $TESTTMP/issue3651/src (glob)
619 619 query 1; heads
620 620 searching for changes
621 621 all remote heads known locally
622 622 2:6095d0695d70
623 623 3:7983dce246cc
624 624 4:233f12ada4ae
625 625 5:036794ea641c
626 626 largefiles to upload (2 entities):
627 627 b
628 628 13f9ed0898e315bf59dc2973fec52037b6f441a2
629 629 c801c9cfe94400963fcb683246217d5db77f9a9a
630 630
631 631
632 632 $ cd ..
633 633
634 634 merge action 'd' for 'local renamed directory to d2/g' which has no filename
635 635 ==================================================================================
636 636
637 637 $ hg init merge-action
638 638 $ cd merge-action
639 639 $ touch l
640 640 $ hg add --large l
641 641 $ mkdir d1
642 642 $ touch d1/f
643 643 $ hg ci -Aqm0
644 644 Invoking status precommit hook
645 645 A d1/f
646 646 A l
647 647 $ echo > d1/f
648 648 $ touch d1/g
649 649 $ hg ci -Aqm1
650 650 Invoking status precommit hook
651 651 M d1/f
652 652 A d1/g
653 653 $ hg up -qr0
654 654 $ hg mv d1 d2
655 655 moving d1/f to d2/f (glob)
656 656 $ hg ci -qm2
657 657 Invoking status precommit hook
658 658 A d2/f
659 659 R d1/f
660 660 $ hg merge
661 661 merging d2/f and d1/f to d2/f
662 662 getting changed largefiles
663 663 0 largefiles updated, 0 removed
664 664 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
665 665 (branch merge, don't forget to commit)
666 666 $ cd ..
667 667
668 668
669 669 Merge conflicts:
670 670 =====================
671 671
672 672 $ hg init merge
673 673 $ cd merge
674 674 $ echo 0 > f-different
675 675 $ echo 0 > f-same
676 676 $ echo 0 > f-unchanged-1
677 677 $ echo 0 > f-unchanged-2
678 678 $ hg add --large *
679 679 $ hg ci -m0
680 680 Invoking status precommit hook
681 681 A f-different
682 682 A f-same
683 683 A f-unchanged-1
684 684 A f-unchanged-2
685 685 $ echo tmp1 > f-unchanged-1
686 686 $ echo tmp1 > f-unchanged-2
687 687 $ echo tmp1 > f-same
688 688 $ hg ci -m1
689 689 Invoking status precommit hook
690 690 M f-same
691 691 M f-unchanged-1
692 692 M f-unchanged-2
693 693 $ echo 2 > f-different
694 694 $ echo 0 > f-unchanged-1
695 695 $ echo 1 > f-unchanged-2
696 696 $ echo 1 > f-same
697 697 $ hg ci -m2
698 698 Invoking status precommit hook
699 699 M f-different
700 700 M f-same
701 701 M f-unchanged-1
702 702 M f-unchanged-2
703 703 $ hg up -qr0
704 704 $ echo tmp2 > f-unchanged-1
705 705 $ echo tmp2 > f-unchanged-2
706 706 $ echo tmp2 > f-same
707 707 $ hg ci -m3
708 708 Invoking status precommit hook
709 709 M f-same
710 710 M f-unchanged-1
711 711 M f-unchanged-2
712 712 created new head
713 713 $ echo 1 > f-different
714 714 $ echo 1 > f-unchanged-1
715 715 $ echo 0 > f-unchanged-2
716 716 $ echo 1 > f-same
717 717 $ hg ci -m4
718 718 Invoking status precommit hook
719 719 M f-different
720 720 M f-same
721 721 M f-unchanged-1
722 722 M f-unchanged-2
723 723 $ hg merge
724 724 largefile f-different has a merge conflict
725 725 ancestor was 09d2af8dd22201dd8d48e5dcfcaed281ff9422c7
726 726 keep (l)ocal e5fa44f2b31c1fb553b6021e7360d07d5d91ff5e or
727 727 take (o)ther 7448d8798a4380162d4b56f9b452e2f6f9e24e7a? l
728 728 getting changed largefiles
729 729 1 largefiles updated, 0 removed
730 730 0 files updated, 4 files merged, 0 files removed, 0 files unresolved
731 731 (branch merge, don't forget to commit)
732 732 $ cat f-different
733 733 1
734 734 $ cat f-same
735 735 1
736 736 $ cat f-unchanged-1
737 737 1
738 738 $ cat f-unchanged-2
739 739 1
740 740 $ cd ..
741 741
742 742 Test largefile insulation (do not enabled a side effect
743 743 ========================================================
744 744
745 745 Check whether "largefiles" feature is supported only in repositories
746 746 enabling largefiles extension.
747 747
748 748 $ mkdir individualenabling
749 749 $ cd individualenabling
750 750
751 751 $ hg init enabledlocally
752 752 $ echo large > enabledlocally/large
753 753 $ hg -R enabledlocally add --large enabledlocally/large
754 754 $ hg -R enabledlocally commit -m '#0'
755 755 Invoking status precommit hook
756 756 A large
757 757
758 758 $ hg init notenabledlocally
759 759 $ echo large > notenabledlocally/large
760 760 $ hg -R notenabledlocally add --large notenabledlocally/large
761 761 $ hg -R notenabledlocally commit -m '#0'
762 762 Invoking status precommit hook
763 763 A large
764 764
765 765 $ cat >> $HGRCPATH <<EOF
766 766 > [extensions]
767 767 > # disable globally
768 768 > largefiles=!
769 769 > EOF
770 770 $ cat >> enabledlocally/.hg/hgrc <<EOF
771 771 > [extensions]
772 772 > # enable locally
773 773 > largefiles=
774 774 > EOF
775 775 $ hg -R enabledlocally root
776 776 $TESTTMP/individualenabling/enabledlocally (glob)
777 777 $ hg -R notenabledlocally root
778 778 abort: repository requires features unknown to this Mercurial: largefiles!
779 779 (see http://mercurial.selenic.com/wiki/MissingRequirement for more information)
780 780 [255]
781 781
782 782 $ hg init push-dst
783 783 $ hg -R enabledlocally push push-dst
784 784 pushing to push-dst
785 785 abort: required features are not supported in the destination: largefiles
786 786 [255]
787 787
788 788 $ hg init pull-src
789 789 $ hg -R pull-src pull enabledlocally
790 790 pulling from enabledlocally
791 791 abort: required features are not supported in the destination: largefiles
792 792 [255]
793 793
794 794 $ hg clone enabledlocally clone-dst
795 795 abort: repository requires features unknown to this Mercurial: largefiles!
796 796 (see http://mercurial.selenic.com/wiki/MissingRequirement for more information)
797 797 [255]
798 798 $ test -d clone-dst
799 799 [1]
800 800 $ hg clone --pull enabledlocally clone-pull-dst
801 801 abort: required features are not supported in the destination: largefiles
802 802 [255]
803 803 $ test -d clone-pull-dst
804 804 [1]
805 805
806 806 #if serve
807 807
808 808 Test largefiles specific peer setup, when largefiles is enabled
809 809 locally (issue4109)
810 810
811 811 $ hg showconfig extensions | grep largefiles
812 812 extensions.largefiles=!
813 813 $ mkdir -p $TESTTMP/individualenabling/usercache
814 814
815 815 $ hg serve -R enabledlocally -d -p $HGPORT --pid-file hg.pid
816 816 $ cat hg.pid >> $DAEMON_PIDS
817 817
818 818 $ hg init pull-dst
819 819 $ cat > pull-dst/.hg/hgrc <<EOF
820 820 > [extensions]
821 821 > # enable locally
822 822 > largefiles=
823 823 > [largefiles]
824 824 > # ignore system cache to force largefiles specific wire proto access
825 825 > usercache=$TESTTMP/individualenabling/usercache
826 826 > EOF
827 827 $ hg -R pull-dst -q pull -u http://localhost:$HGPORT
828 828
829 829 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
830 830 #endif
831 831
832 832 $ cd ..
833 833
834 834
835 835 Test "pull --rebase" when rebase is enabled before largefiles (issue3861)
836 836 =========================================================================
837 837
838 838 $ hg showconfig extensions | grep largefiles
839 839 extensions.largefiles=!
840 840
841 841 $ mkdir issue3861
842 842 $ cd issue3861
843 843 $ hg init src
844 844 $ hg clone -q src dst
845 845 $ echo a > src/a
846 846 $ hg -R src commit -Aqm "#0"
847 847 Invoking status precommit hook
848 848 A a
849 849
850 850 $ cat >> dst/.hg/hgrc <<EOF
851 851 > [extensions]
852 852 > largefiles=
853 853 > EOF
854 854 $ hg -R dst pull --rebase
855 855 pulling from $TESTTMP/issue3861/src (glob)
856 856 requesting all changes
857 857 adding changesets
858 858 adding manifests
859 859 adding file changes
860 860 added 1 changesets with 1 changes to 1 files
861 861 nothing to rebase - working directory parent is already an ancestor of destination bf5e395ced2c
862 862 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
863 863
864 864 $ cd ..
@@ -1,1821 +1,1821 b''
1 1 This file used to contains all largefile tests.
2 2 Do not add any new tests in this file as it his already far too long to run.
3 3
4 4 It contains all the testing of the basic concepts of large file in a single block.
5 5
6 6 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
7 7 $ mkdir "${USERCACHE}"
8 8 $ cat >> $HGRCPATH <<EOF
9 9 > [extensions]
10 10 > largefiles=
11 11 > purge=
12 12 > rebase=
13 13 > transplant=
14 14 > [phases]
15 15 > publish=False
16 16 > [largefiles]
17 17 > minsize=2
18 18 > patterns=glob:**.dat
19 19 > usercache=${USERCACHE}
20 20 > [hooks]
21 21 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
22 22 > EOF
23 23
24 24 Create the repo with a couple of revisions of both large and normal
25 25 files.
26 26 Test status and dirstate of largefiles and that summary output is correct.
27 27
28 28 $ hg init a
29 29 $ cd a
30 30 $ mkdir sub
31 31 $ echo normal1 > normal1
32 32 $ echo normal2 > sub/normal2
33 33 $ echo large1 > large1
34 34 $ echo large2 > sub/large2
35 35 $ hg add normal1 sub/normal2
36 36 $ hg add --large large1 sub/large2
37 37 $ hg commit -m "add files"
38 38 Invoking status precommit hook
39 39 A large1
40 40 A normal1
41 41 A sub/large2
42 42 A sub/normal2
43 43 $ touch large1 sub/large2
44 44 $ sleep 1
45 45 $ hg st
46 46 $ hg debugstate --nodates
47 47 n 644 41 .hglf/large1
48 48 n 644 41 .hglf/sub/large2
49 49 n 644 8 normal1
50 50 n 644 8 sub/normal2
51 51 $ hg debugstate --large --nodates
52 52 n 644 7 large1
53 53 n 644 7 sub/large2
54 54 $ echo normal11 > normal1
55 55 $ echo normal22 > sub/normal2
56 56 $ echo large11 > large1
57 57 $ echo large22 > sub/large2
58 58 $ hg commit -m "edit files"
59 59 Invoking status precommit hook
60 60 M large1
61 61 M normal1
62 62 M sub/large2
63 63 M sub/normal2
64 64 $ hg sum --large
65 65 parent: 1:ce8896473775 tip
66 66 edit files
67 67 branch: default
68 68 commit: (clean)
69 69 update: (current)
70 70 largefiles: (no remote repo)
71 71
72 72 Commit preserved largefile contents.
73 73
74 74 $ cat normal1
75 75 normal11
76 76 $ cat large1
77 77 large11
78 78 $ cat sub/normal2
79 79 normal22
80 80 $ cat sub/large2
81 81 large22
82 82
83 83 Test status, subdir and unknown files
84 84
85 85 $ echo unknown > sub/unknown
86 86 $ hg st --all
87 87 ? sub/unknown
88 88 C large1
89 89 C normal1
90 90 C sub/large2
91 91 C sub/normal2
92 92 $ hg st --all sub
93 93 ? sub/unknown
94 94 C sub/large2
95 95 C sub/normal2
96 96 $ rm sub/unknown
97 97
98 98 Test messages and exit codes for remove warning cases
99 99
100 100 $ hg remove -A large1
101 101 not removing large1: file still exists
102 102 [1]
103 103 $ echo 'modified' > large1
104 104 $ hg remove large1
105 105 not removing large1: file is modified (use -f to force removal)
106 106 [1]
107 107 $ echo 'new' > normalnew
108 108 $ hg add normalnew
109 109 $ echo 'new' > largenew
110 110 $ hg add --large normalnew
111 111 normalnew already tracked!
112 112 $ hg remove normalnew largenew
113 113 not removing largenew: file is untracked
114 114 not removing normalnew: file has been marked for add (use forget to undo)
115 115 [1]
116 116 $ rm normalnew largenew
117 117 $ hg up -Cq
118 118
119 119 Remove both largefiles and normal files.
120 120
121 121 $ hg remove normal1 large1
122 122 $ hg status large1
123 123 R large1
124 124 $ hg commit -m "remove files"
125 125 Invoking status precommit hook
126 126 R large1
127 127 R normal1
128 128 $ ls
129 129 sub
130 130 $ echo "testlargefile" > large1-test
131 131 $ hg add --large large1-test
132 132 $ hg st
133 133 A large1-test
134 134 $ hg rm large1-test
135 135 not removing large1-test: file has been marked for add (use forget to undo)
136 136 [1]
137 137 $ hg st
138 138 A large1-test
139 139 $ hg forget large1-test
140 140 $ hg st
141 141 ? large1-test
142 142 $ hg remove large1-test
143 143 not removing large1-test: file is untracked
144 144 [1]
145 145 $ hg forget large1-test
146 146 not removing large1-test: file is already untracked
147 147 [1]
148 148 $ rm large1-test
149 149
150 150 Copy both largefiles and normal files (testing that status output is correct).
151 151
152 152 $ hg cp sub/normal2 normal1
153 153 $ hg cp sub/large2 large1
154 154 $ hg commit -m "copy files"
155 155 Invoking status precommit hook
156 156 A large1
157 157 A normal1
158 158 $ cat normal1
159 159 normal22
160 160 $ cat large1
161 161 large22
162 162
163 163 Test moving largefiles and verify that normal files are also unaffected.
164 164
165 165 $ hg mv normal1 normal3
166 166 $ hg mv large1 large3
167 167 $ hg mv sub/normal2 sub/normal4
168 168 $ hg mv sub/large2 sub/large4
169 169 $ hg commit -m "move files"
170 170 Invoking status precommit hook
171 171 A large3
172 172 A normal3
173 173 A sub/large4
174 174 A sub/normal4
175 175 R large1
176 176 R normal1
177 177 R sub/large2
178 178 R sub/normal2
179 179 $ cat normal3
180 180 normal22
181 181 $ cat large3
182 182 large22
183 183 $ cat sub/normal4
184 184 normal22
185 185 $ cat sub/large4
186 186 large22
187 187
188 188
189 189 #if serve
190 190 Test display of largefiles in hgweb
191 191
192 192 $ hg serve -d -p $HGPORT --pid-file ../hg.pid
193 193 $ cat ../hg.pid >> $DAEMON_PIDS
194 194 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/?style=raw'
195 195 200 Script output follows
196 196
197 197
198 198 drwxr-xr-x sub
199 199 -rw-r--r-- 41 large3
200 200 -rw-r--r-- 9 normal3
201 201
202 202
203 203 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/sub/?style=raw'
204 204 200 Script output follows
205 205
206 206
207 207 -rw-r--r-- 41 large4
208 208 -rw-r--r-- 9 normal4
209 209
210 210
211 211 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
212 212 #endif
213 213
214 214 Test archiving the various revisions. These hit corner cases known with
215 215 archiving.
216 216
217 217 $ hg archive -r 0 ../archive0
218 218 $ hg archive -r 1 ../archive1
219 219 $ hg archive -r 2 ../archive2
220 220 $ hg archive -r 3 ../archive3
221 221 $ hg archive -r 4 ../archive4
222 222 $ cd ../archive0
223 223 $ cat normal1
224 224 normal1
225 225 $ cat large1
226 226 large1
227 227 $ cat sub/normal2
228 228 normal2
229 229 $ cat sub/large2
230 230 large2
231 231 $ cd ../archive1
232 232 $ cat normal1
233 233 normal11
234 234 $ cat large1
235 235 large11
236 236 $ cat sub/normal2
237 237 normal22
238 238 $ cat sub/large2
239 239 large22
240 240 $ cd ../archive2
241 241 $ ls
242 242 sub
243 243 $ cat sub/normal2
244 244 normal22
245 245 $ cat sub/large2
246 246 large22
247 247 $ cd ../archive3
248 248 $ cat normal1
249 249 normal22
250 250 $ cat large1
251 251 large22
252 252 $ cat sub/normal2
253 253 normal22
254 254 $ cat sub/large2
255 255 large22
256 256 $ cd ../archive4
257 257 $ cat normal3
258 258 normal22
259 259 $ cat large3
260 260 large22
261 261 $ cat sub/normal4
262 262 normal22
263 263 $ cat sub/large4
264 264 large22
265 265
266 266 Commit corner case: specify files to commit.
267 267
268 268 $ cd ../a
269 269 $ echo normal3 > normal3
270 270 $ echo large3 > large3
271 271 $ echo normal4 > sub/normal4
272 272 $ echo large4 > sub/large4
273 273 $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again"
274 274 Invoking status precommit hook
275 275 M large3
276 276 M normal3
277 277 M sub/large4
278 278 M sub/normal4
279 279 $ cat normal3
280 280 normal3
281 281 $ cat large3
282 282 large3
283 283 $ cat sub/normal4
284 284 normal4
285 285 $ cat sub/large4
286 286 large4
287 287
288 288 One more commit corner case: commit from a subdirectory.
289 289
290 290 $ cd ../a
291 291 $ echo normal33 > normal3
292 292 $ echo large33 > large3
293 293 $ echo normal44 > sub/normal4
294 294 $ echo large44 > sub/large4
295 295 $ cd sub
296 296 $ hg commit -m "edit files yet again"
297 297 Invoking status precommit hook
298 298 M large3
299 299 M normal3
300 300 M sub/large4
301 301 M sub/normal4
302 302 $ cat ../normal3
303 303 normal33
304 304 $ cat ../large3
305 305 large33
306 306 $ cat normal4
307 307 normal44
308 308 $ cat large4
309 309 large44
310 310
311 311 Committing standins is not allowed.
312 312
313 313 $ cd ..
314 314 $ echo large3 > large3
315 315 $ hg commit .hglf/large3 -m "try to commit standin"
316 316 abort: file ".hglf/large3" is a largefile standin
317 317 (commit the largefile itself instead)
318 318 [255]
319 319
320 320 Corner cases for adding largefiles.
321 321
322 322 $ echo large5 > large5
323 323 $ hg add --large large5
324 324 $ hg add --large large5
325 325 large5 already a largefile
326 326 $ mkdir sub2
327 327 $ echo large6 > sub2/large6
328 328 $ echo large7 > sub2/large7
329 329 $ hg add --large sub2
330 330 adding sub2/large6 as a largefile (glob)
331 331 adding sub2/large7 as a largefile (glob)
332 332 $ hg st
333 333 M large3
334 334 A large5
335 335 A sub2/large6
336 336 A sub2/large7
337 337
338 338 Committing directories containing only largefiles.
339 339
340 340 $ mkdir -p z/y/x/m
341 341 $ touch z/y/x/m/large1
342 342 $ touch z/y/x/large2
343 343 $ hg add --large z/y/x/m/large1 z/y/x/large2
344 344 $ hg commit -m "Subdir with directory only containing largefiles" z
345 345 Invoking status precommit hook
346 346 M large3
347 347 A large5
348 348 A sub2/large6
349 349 A sub2/large7
350 350 A z/y/x/large2
351 351 A z/y/x/m/large1
352 352
353 353 (and a bit of log testing)
354 354
355 355 $ hg log -T '{rev}\n' z/y/x/m/large1
356 356 7
357 357 $ hg log -T '{rev}\n' z/y/x/m # with only a largefile
358 358 7
359 359
360 360 $ hg rollback --quiet
361 361 $ touch z/y/x/m/normal
362 362 $ hg add z/y/x/m/normal
363 363 $ hg commit -m "Subdir with mixed contents" z
364 364 Invoking status precommit hook
365 365 M large3
366 366 A large5
367 367 A sub2/large6
368 368 A sub2/large7
369 369 A z/y/x/large2
370 370 A z/y/x/m/large1
371 371 A z/y/x/m/normal
372 372 $ hg st
373 373 M large3
374 374 A large5
375 375 A sub2/large6
376 376 A sub2/large7
377 377 $ hg rollback --quiet
378 378 $ hg revert z/y/x/large2 z/y/x/m/large1
379 379 $ rm z/y/x/large2 z/y/x/m/large1
380 380 $ hg commit -m "Subdir with normal contents" z
381 381 Invoking status precommit hook
382 382 M large3
383 383 A large5
384 384 A sub2/large6
385 385 A sub2/large7
386 386 A z/y/x/m/normal
387 387 $ hg st
388 388 M large3
389 389 A large5
390 390 A sub2/large6
391 391 A sub2/large7
392 392 $ hg rollback --quiet
393 393 $ hg revert --quiet z
394 394 $ hg commit -m "Empty subdir" z
395 395 abort: z: no match under directory!
396 396 [255]
397 397 $ rm -rf z
398 398 $ hg ci -m "standin" .hglf
399 399 abort: file ".hglf" is a largefile standin
400 400 (commit the largefile itself instead)
401 401 [255]
402 402
403 403 Test "hg status" with combination of 'file pattern' and 'directory
404 404 pattern' for largefiles:
405 405
406 406 $ hg status sub2/large6 sub2
407 407 A sub2/large6
408 408 A sub2/large7
409 409
410 410 Config settings (pattern **.dat, minsize 2 MB) are respected.
411 411
412 412 $ echo testdata > test.dat
413 413 $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null
414 414 $ hg add
415 415 adding reallylarge as a largefile
416 416 adding test.dat as a largefile
417 417
418 418 Test that minsize and --lfsize handle float values;
419 419 also tests that --lfsize overrides largefiles.minsize.
420 420 (0.250 MB = 256 kB = 262144 B)
421 421
422 422 $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null
423 423 $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null
424 424 $ hg --config largefiles.minsize=.25 add
425 425 adding ratherlarge as a largefile
426 426 adding medium
427 427 $ hg forget medium
428 428 $ hg --config largefiles.minsize=.25 add --lfsize=.125
429 429 adding medium as a largefile
430 430 $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null
431 431 $ hg --config largefiles.minsize=.25 add --lfsize=.125
432 432 adding notlarge
433 433 $ hg forget notlarge
434 434
435 435 Test forget on largefiles.
436 436
437 437 $ hg forget large3 large5 test.dat reallylarge ratherlarge medium
438 438 $ hg commit -m "add/edit more largefiles"
439 439 Invoking status precommit hook
440 440 A sub2/large6
441 441 A sub2/large7
442 442 R large3
443 443 ? large5
444 444 ? medium
445 445 ? notlarge
446 446 ? ratherlarge
447 447 ? reallylarge
448 448 ? test.dat
449 449 $ hg st
450 450 ? large3
451 451 ? large5
452 452 ? medium
453 453 ? notlarge
454 454 ? ratherlarge
455 455 ? reallylarge
456 456 ? test.dat
457 457
458 458 Purge with largefiles: verify that largefiles are still in the working
459 459 dir after a purge.
460 460
461 461 $ hg purge --all
462 462 $ cat sub/large4
463 463 large44
464 464 $ cat sub2/large6
465 465 large6
466 466 $ cat sub2/large7
467 467 large7
468 468
469 469 Test addremove: verify that files that should be added as largefiles are added as
470 470 such and that already-existing largefiles are not added as normal files by
471 471 accident.
472 472
473 473 $ rm normal3
474 474 $ rm sub/large4
475 475 $ echo "testing addremove with patterns" > testaddremove.dat
476 476 $ echo "normaladdremove" > normaladdremove
477 477 $ hg addremove
478 478 removing sub/large4
479 479 adding testaddremove.dat as a largefile
480 480 removing normal3
481 481 adding normaladdremove
482 482
483 483 Test addremove with -R
484 484
485 485 $ hg up -C
486 486 getting changed largefiles
487 487 1 largefiles updated, 0 removed
488 488 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
489 489 $ rm normal3
490 490 $ rm sub/large4
491 491 $ echo "testing addremove with patterns" > testaddremove.dat
492 492 $ echo "normaladdremove" > normaladdremove
493 493 $ cd ..
494 494 $ hg -R a addremove
495 495 removing sub/large4
496 496 adding a/testaddremove.dat as a largefile (glob)
497 497 removing normal3
498 498 adding normaladdremove
499 499 $ cd a
500 500
501 501 Test 3364
502 502 $ hg clone . ../addrm
503 503 updating to branch default
504 504 getting changed largefiles
505 505 3 largefiles updated, 0 removed
506 506 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
507 507 $ cd ../addrm
508 508 $ cat >> .hg/hgrc <<EOF
509 509 > [hooks]
510 510 > post-commit.stat=sh -c "echo \\"Invoking status postcommit hook\\"; hg status -A"
511 511 > EOF
512 512 $ touch foo
513 513 $ hg add --large foo
514 514 $ hg ci -m "add foo"
515 515 Invoking status precommit hook
516 516 A foo
517 517 Invoking status postcommit hook
518 518 C foo
519 519 C normal3
520 520 C sub/large4
521 521 C sub/normal4
522 522 C sub2/large6
523 523 C sub2/large7
524 524 $ rm foo
525 525 $ hg st
526 526 ! foo
527 527 hmm.. no precommit invoked, but there is a postcommit??
528 528 $ hg ci -m "will not checkin"
529 529 nothing changed
530 530 Invoking status postcommit hook
531 531 ! foo
532 532 C normal3
533 533 C sub/large4
534 534 C sub/normal4
535 535 C sub2/large6
536 536 C sub2/large7
537 537 [1]
538 538 $ hg addremove
539 539 removing foo
540 540 $ hg st
541 541 R foo
542 542 $ hg ci -m "used to say nothing changed"
543 543 Invoking status precommit hook
544 544 R foo
545 545 Invoking status postcommit hook
546 546 C normal3
547 547 C sub/large4
548 548 C sub/normal4
549 549 C sub2/large6
550 550 C sub2/large7
551 551 $ hg st
552 552
553 553 Test 3507 (both normal files and largefiles were a problem)
554 554
555 555 $ touch normal
556 556 $ touch large
557 557 $ hg add normal
558 558 $ hg add --large large
559 559 $ hg ci -m "added"
560 560 Invoking status precommit hook
561 561 A large
562 562 A normal
563 563 Invoking status postcommit hook
564 564 C large
565 565 C normal
566 566 C normal3
567 567 C sub/large4
568 568 C sub/normal4
569 569 C sub2/large6
570 570 C sub2/large7
571 571 $ hg remove normal
572 572 $ hg addremove --traceback
573 573 $ hg ci -m "addremoved normal"
574 574 Invoking status precommit hook
575 575 R normal
576 576 Invoking status postcommit hook
577 577 C large
578 578 C normal3
579 579 C sub/large4
580 580 C sub/normal4
581 581 C sub2/large6
582 582 C sub2/large7
583 583 $ hg up -C '.^'
584 584 getting changed largefiles
585 585 0 largefiles updated, 0 removed
586 586 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
587 587 $ hg remove large
588 588 $ hg addremove --traceback
589 589 $ hg ci -m "removed large"
590 590 Invoking status precommit hook
591 591 R large
592 592 created new head
593 593 Invoking status postcommit hook
594 594 C normal
595 595 C normal3
596 596 C sub/large4
597 597 C sub/normal4
598 598 C sub2/large6
599 599 C sub2/large7
600 600
601 601 Test commit -A (issue3542)
602 602 $ echo large8 > large8
603 603 $ hg add --large large8
604 604 $ hg ci -Am 'this used to add large8 as normal and commit both'
605 605 Invoking status precommit hook
606 606 A large8
607 607 Invoking status postcommit hook
608 608 C large8
609 609 C normal
610 610 C normal3
611 611 C sub/large4
612 612 C sub/normal4
613 613 C sub2/large6
614 614 C sub2/large7
615 615 $ rm large8
616 616 $ hg ci -Am 'this used to not notice the rm'
617 617 removing large8
618 618 Invoking status precommit hook
619 619 R large8
620 620 Invoking status postcommit hook
621 621 C normal
622 622 C normal3
623 623 C sub/large4
624 624 C sub/normal4
625 625 C sub2/large6
626 626 C sub2/large7
627 627
628 628 Test that a standin can't be added as a large file
629 629
630 630 $ touch large
631 631 $ hg add --large large
632 632 $ hg ci -m "add"
633 633 Invoking status precommit hook
634 634 A large
635 635 Invoking status postcommit hook
636 636 C large
637 637 C normal
638 638 C normal3
639 639 C sub/large4
640 640 C sub/normal4
641 641 C sub2/large6
642 642 C sub2/large7
643 643 $ hg remove large
644 644 $ touch large
645 645 $ hg addremove --config largefiles.patterns=**large --traceback
646 646 adding large as a largefile
647 647
648 648 Test that outgoing --large works (with revsets too)
649 649 $ hg outgoing --rev '.^' --large
650 650 comparing with $TESTTMP/a (glob)
651 651 searching for changes
652 652 changeset: 8:c02fd3b77ec4
653 653 user: test
654 654 date: Thu Jan 01 00:00:00 1970 +0000
655 655 summary: add foo
656 656
657 657 changeset: 9:289dd08c9bbb
658 658 user: test
659 659 date: Thu Jan 01 00:00:00 1970 +0000
660 660 summary: used to say nothing changed
661 661
662 662 changeset: 10:34f23ac6ac12
663 663 user: test
664 664 date: Thu Jan 01 00:00:00 1970 +0000
665 665 summary: added
666 666
667 667 changeset: 12:710c1b2f523c
668 668 parent: 10:34f23ac6ac12
669 669 user: test
670 670 date: Thu Jan 01 00:00:00 1970 +0000
671 671 summary: removed large
672 672
673 673 changeset: 13:0a3e75774479
674 674 user: test
675 675 date: Thu Jan 01 00:00:00 1970 +0000
676 676 summary: this used to add large8 as normal and commit both
677 677
678 678 changeset: 14:84f3d378175c
679 679 user: test
680 680 date: Thu Jan 01 00:00:00 1970 +0000
681 681 summary: this used to not notice the rm
682 682
683 683 largefiles to upload (1 entities):
684 684 large8
685 685
686 686 $ cd ../a
687 687
688 688 Clone a largefiles repo.
689 689
690 690 $ hg clone . ../b
691 691 updating to branch default
692 692 getting changed largefiles
693 693 3 largefiles updated, 0 removed
694 694 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
695 695 $ cd ../b
696 696 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
697 697 7:daea875e9014 add/edit more largefiles
698 698 6:4355d653f84f edit files yet again
699 699 5:9d5af5072dbd edit files again
700 700 4:74c02385b94c move files
701 701 3:9e8fbc4bce62 copy files
702 702 2:51a0ae4d5864 remove files
703 703 1:ce8896473775 edit files
704 704 0:30d30fe6a5be add files
705 705 $ cat normal3
706 706 normal33
707 707
708 708 Test graph log
709 709
710 710 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n'
711 711 @ 7:daea875e9014 add/edit more largefiles
712 712 |
713 713 o 6:4355d653f84f edit files yet again
714 714 |
715 715 o 5:9d5af5072dbd edit files again
716 716 |
717 717 o 4:74c02385b94c move files
718 718 |
719 719 o 3:9e8fbc4bce62 copy files
720 720 |
721 721 o 2:51a0ae4d5864 remove files
722 722 |
723 723 o 1:ce8896473775 edit files
724 724 |
725 725 o 0:30d30fe6a5be add files
726 726
727 727
728 728 Test log with --patch
729 729
730 730 $ hg log --patch -r 6::7
731 731 changeset: 6:4355d653f84f
732 732 user: test
733 733 date: Thu Jan 01 00:00:00 1970 +0000
734 734 summary: edit files yet again
735 735
736 736 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/large3
737 737 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
738 738 +++ b/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
739 739 @@ -1,1 +1,1 @@
740 740 -baaf12afde9d8d67f25dab6dced0d2bf77dba47c
741 741 +7838695e10da2bb75ac1156565f40a2595fa2fa0
742 742 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
743 743 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
744 744 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
745 745 @@ -1,1 +1,1 @@
746 746 -aeb2210d19f02886dde00dac279729a48471e2f9
747 747 +971fb41e78fea4f8e0ba5244784239371cb00591
748 748 diff -r 9d5af5072dbd -r 4355d653f84f normal3
749 749 --- a/normal3 Thu Jan 01 00:00:00 1970 +0000
750 750 +++ b/normal3 Thu Jan 01 00:00:00 1970 +0000
751 751 @@ -1,1 +1,1 @@
752 752 -normal3
753 753 +normal33
754 754 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
755 755 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
756 756 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
757 757 @@ -1,1 +1,1 @@
758 758 -normal4
759 759 +normal44
760 760
761 761 changeset: 7:daea875e9014
762 762 tag: tip
763 763 user: test
764 764 date: Thu Jan 01 00:00:00 1970 +0000
765 765 summary: add/edit more largefiles
766 766
767 767 diff -r 4355d653f84f -r daea875e9014 .hglf/large3
768 768 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
769 769 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
770 770 @@ -1,1 +0,0 @@
771 771 -7838695e10da2bb75ac1156565f40a2595fa2fa0
772 772 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large6
773 773 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
774 774 +++ b/.hglf/sub2/large6 Thu Jan 01 00:00:00 1970 +0000
775 775 @@ -0,0 +1,1 @@
776 776 +0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30
777 777 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large7
778 778 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
779 779 +++ b/.hglf/sub2/large7 Thu Jan 01 00:00:00 1970 +0000
780 780 @@ -0,0 +1,1 @@
781 781 +bb3151689acb10f0c3125c560d5e63df914bc1af
782 782
783 783
784 784 $ hg log --patch -r 6::7 sub/
785 785 changeset: 6:4355d653f84f
786 786 user: test
787 787 date: Thu Jan 01 00:00:00 1970 +0000
788 788 summary: edit files yet again
789 789
790 790 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
791 791 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
792 792 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
793 793 @@ -1,1 +1,1 @@
794 794 -aeb2210d19f02886dde00dac279729a48471e2f9
795 795 +971fb41e78fea4f8e0ba5244784239371cb00591
796 796 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
797 797 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
798 798 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
799 799 @@ -1,1 +1,1 @@
800 800 -normal4
801 801 +normal44
802 802
803 803
804 804 log with both --follow and --patch
805 805
806 806 $ hg log --follow --patch --limit 2
807 807 changeset: 7:daea875e9014
808 808 tag: tip
809 809 user: test
810 810 date: Thu Jan 01 00:00:00 1970 +0000
811 811 summary: add/edit more largefiles
812 812
813 813 diff -r 4355d653f84f -r daea875e9014 .hglf/large3
814 814 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
815 815 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
816 816 @@ -1,1 +0,0 @@
817 817 -7838695e10da2bb75ac1156565f40a2595fa2fa0
818 818 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large6
819 819 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
820 820 +++ b/.hglf/sub2/large6 Thu Jan 01 00:00:00 1970 +0000
821 821 @@ -0,0 +1,1 @@
822 822 +0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30
823 823 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large7
824 824 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
825 825 +++ b/.hglf/sub2/large7 Thu Jan 01 00:00:00 1970 +0000
826 826 @@ -0,0 +1,1 @@
827 827 +bb3151689acb10f0c3125c560d5e63df914bc1af
828 828
829 829 changeset: 6:4355d653f84f
830 830 user: test
831 831 date: Thu Jan 01 00:00:00 1970 +0000
832 832 summary: edit files yet again
833 833
834 834 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/large3
835 835 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
836 836 +++ b/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
837 837 @@ -1,1 +1,1 @@
838 838 -baaf12afde9d8d67f25dab6dced0d2bf77dba47c
839 839 +7838695e10da2bb75ac1156565f40a2595fa2fa0
840 840 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
841 841 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
842 842 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
843 843 @@ -1,1 +1,1 @@
844 844 -aeb2210d19f02886dde00dac279729a48471e2f9
845 845 +971fb41e78fea4f8e0ba5244784239371cb00591
846 846 diff -r 9d5af5072dbd -r 4355d653f84f normal3
847 847 --- a/normal3 Thu Jan 01 00:00:00 1970 +0000
848 848 +++ b/normal3 Thu Jan 01 00:00:00 1970 +0000
849 849 @@ -1,1 +1,1 @@
850 850 -normal3
851 851 +normal33
852 852 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
853 853 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
854 854 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
855 855 @@ -1,1 +1,1 @@
856 856 -normal4
857 857 +normal44
858 858
859 859 $ hg log --follow --patch sub/large4
860 860 changeset: 6:4355d653f84f
861 861 user: test
862 862 date: Thu Jan 01 00:00:00 1970 +0000
863 863 summary: edit files yet again
864 864
865 865 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
866 866 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
867 867 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
868 868 @@ -1,1 +1,1 @@
869 869 -aeb2210d19f02886dde00dac279729a48471e2f9
870 870 +971fb41e78fea4f8e0ba5244784239371cb00591
871 871
872 872 changeset: 5:9d5af5072dbd
873 873 user: test
874 874 date: Thu Jan 01 00:00:00 1970 +0000
875 875 summary: edit files again
876 876
877 877 diff -r 74c02385b94c -r 9d5af5072dbd .hglf/sub/large4
878 878 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
879 879 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
880 880 @@ -1,1 +1,1 @@
881 881 -eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
882 882 +aeb2210d19f02886dde00dac279729a48471e2f9
883 883
884 884 changeset: 4:74c02385b94c
885 885 user: test
886 886 date: Thu Jan 01 00:00:00 1970 +0000
887 887 summary: move files
888 888
889 889 diff -r 9e8fbc4bce62 -r 74c02385b94c .hglf/sub/large4
890 890 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
891 891 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
892 892 @@ -0,0 +1,1 @@
893 893 +eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
894 894
895 895 changeset: 1:ce8896473775
896 896 user: test
897 897 date: Thu Jan 01 00:00:00 1970 +0000
898 898 summary: edit files
899 899
900 900 diff -r 30d30fe6a5be -r ce8896473775 .hglf/sub/large2
901 901 --- a/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
902 902 +++ b/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
903 903 @@ -1,1 +1,1 @@
904 904 -1deebade43c8c498a3c8daddac0244dc55d1331d
905 905 +eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
906 906
907 907 changeset: 0:30d30fe6a5be
908 908 user: test
909 909 date: Thu Jan 01 00:00:00 1970 +0000
910 910 summary: add files
911 911
912 912 diff -r 000000000000 -r 30d30fe6a5be .hglf/sub/large2
913 913 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
914 914 +++ b/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
915 915 @@ -0,0 +1,1 @@
916 916 +1deebade43c8c498a3c8daddac0244dc55d1331d
917 917
918 918 $ cat sub/normal4
919 919 normal44
920 920 $ cat sub/large4
921 921 large44
922 922 $ cat sub2/large6
923 923 large6
924 924 $ cat sub2/large7
925 925 large7
926 926 $ hg log -qf sub2/large7
927 927 7:daea875e9014
928 928 $ hg log -Gqf sub2/large7
929 929 @ 7:daea875e9014
930 930 |
931 931 $ cd ..
932 932
933 933 Test log from outside repo
934 934
935 935 $ hg log b/sub -T '{rev}:{node|short} {desc|firstline}\n'
936 936 6:4355d653f84f edit files yet again
937 937 5:9d5af5072dbd edit files again
938 938 4:74c02385b94c move files
939 939 1:ce8896473775 edit files
940 940 0:30d30fe6a5be add files
941 941
942 942 Test clone at revision
943 943
944 944 $ hg clone a -r 3 c
945 945 adding changesets
946 946 adding manifests
947 947 adding file changes
948 948 added 4 changesets with 10 changes to 4 files
949 949 updating to branch default
950 950 getting changed largefiles
951 951 2 largefiles updated, 0 removed
952 952 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
953 953 $ cd c
954 954 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
955 955 3:9e8fbc4bce62 copy files
956 956 2:51a0ae4d5864 remove files
957 957 1:ce8896473775 edit files
958 958 0:30d30fe6a5be add files
959 959 $ cat normal1
960 960 normal22
961 961 $ cat large1
962 962 large22
963 963 $ cat sub/normal2
964 964 normal22
965 965 $ cat sub/large2
966 966 large22
967 967
968 968 Old revisions of a clone have correct largefiles content (this also
969 969 tests update).
970 970
971 971 $ hg update -r 1
972 972 getting changed largefiles
973 973 1 largefiles updated, 0 removed
974 974 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
975 975 $ cat large1
976 976 large11
977 977 $ cat sub/large2
978 978 large22
979 979 $ cd ..
980 980
981 981 Test cloning with --all-largefiles flag
982 982
983 983 $ rm "${USERCACHE}"/*
984 984 $ hg clone --all-largefiles a a-backup
985 985 updating to branch default
986 986 getting changed largefiles
987 987 3 largefiles updated, 0 removed
988 988 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
989 989 8 additional largefiles cached
990 990
991 991 $ rm "${USERCACHE}"/*
992 992 $ hg clone --all-largefiles -u 0 a a-clone0
993 993 updating to branch default
994 994 getting changed largefiles
995 995 2 largefiles updated, 0 removed
996 996 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
997 997 9 additional largefiles cached
998 998 $ hg -R a-clone0 sum
999 999 parent: 0:30d30fe6a5be
1000 1000 add files
1001 1001 branch: default
1002 1002 commit: (clean)
1003 1003 update: 7 new changesets (update)
1004 1004
1005 1005 $ rm "${USERCACHE}"/*
1006 1006 $ hg clone --all-largefiles -u 1 a a-clone1
1007 1007 updating to branch default
1008 1008 getting changed largefiles
1009 1009 2 largefiles updated, 0 removed
1010 1010 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1011 1011 8 additional largefiles cached
1012 1012 $ hg -R a-clone1 verify --large --lfa --lfc
1013 1013 checking changesets
1014 1014 checking manifests
1015 1015 crosschecking files in changesets and manifests
1016 1016 checking files
1017 1017 10 files, 8 changesets, 24 total revisions
1018 1018 searching 8 changesets for largefiles
1019 1019 verified contents of 13 revisions of 6 largefiles
1020 1020 $ hg -R a-clone1 sum
1021 1021 parent: 1:ce8896473775
1022 1022 edit files
1023 1023 branch: default
1024 1024 commit: (clean)
1025 1025 update: 6 new changesets (update)
1026 1026
1027 1027 $ rm "${USERCACHE}"/*
1028 1028 $ hg clone --all-largefiles -U a a-clone-u
1029 1029 11 additional largefiles cached
1030 1030 $ hg -R a-clone-u sum
1031 1031 parent: -1:000000000000 (no revision checked out)
1032 1032 branch: default
1033 1033 commit: (clean)
1034 1034 update: 8 new changesets (update)
1035 1035
1036 1036 Show computed destination directory:
1037 1037
1038 1038 $ mkdir xyz
1039 1039 $ cd xyz
1040 1040 $ hg clone ../a
1041 1041 destination directory: a
1042 1042 updating to branch default
1043 1043 getting changed largefiles
1044 1044 3 largefiles updated, 0 removed
1045 1045 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1046 1046 $ cd ..
1047 1047
1048 1048 Clone URL without path:
1049 1049
1050 1050 $ hg clone file://
1051 1051 abort: repository / not found!
1052 1052 [255]
1053 1053
1054 1054 Ensure base clone command argument validation
1055 1055
1056 1056 $ hg clone -U -u 0 a a-clone-failure
1057 1057 abort: cannot specify both --noupdate and --updaterev
1058 1058 [255]
1059 1059
1060 1060 $ hg clone --all-largefiles a ssh://localhost/a
1061 1061 abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a
1062 1062 [255]
1063 1063
1064 1064 Test pulling with --all-largefiles flag. Also test that the largefiles are
1065 1065 downloaded from 'default' instead of 'default-push' when no source is specified
1066 1066 (issue3584)
1067 1067
1068 1068 $ rm -Rf a-backup
1069 1069 $ hg clone -r 1 a a-backup
1070 1070 adding changesets
1071 1071 adding manifests
1072 1072 adding file changes
1073 1073 added 2 changesets with 8 changes to 4 files
1074 1074 updating to branch default
1075 1075 getting changed largefiles
1076 1076 2 largefiles updated, 0 removed
1077 1077 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1078 1078 $ rm "${USERCACHE}"/*
1079 1079 $ cd a-backup
1080 1080 $ hg pull --all-largefiles --config paths.default-push=bogus/path
1081 1081 pulling from $TESTTMP/a (glob)
1082 1082 searching for changes
1083 1083 adding changesets
1084 1084 adding manifests
1085 1085 adding file changes
1086 1086 added 6 changesets with 16 changes to 8 files
1087 1087 (run 'hg update' to get a working copy)
1088 1088 6 largefiles cached
1089 1089
1090 1090 redo pull with --lfrev and check it pulls largefiles for the right revs
1091 1091
1092 1092 $ hg rollback
1093 1093 repository tip rolled back to revision 1 (undo pull)
1094 1094 $ hg pull -v --lfrev 'heads(pulled())+min(pulled())'
1095 1095 pulling from $TESTTMP/a (glob)
1096 1096 searching for changes
1097 1097 all local heads known remotely
1098 1098 6 changesets found
1099 1099 adding changesets
1100 1100 adding manifests
1101 1101 adding file changes
1102 1102 added 6 changesets with 16 changes to 8 files
1103 1103 calling hook changegroup.lfiles: hgext.largefiles.reposetup.checkrequireslfiles
1104 1104 (run 'hg update' to get a working copy)
1105 1105 pulling largefiles for revision 7
1106 1106 found 971fb41e78fea4f8e0ba5244784239371cb00591 in store
1107 1107 found 0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30 in store
1108 1108 found bb3151689acb10f0c3125c560d5e63df914bc1af in store
1109 1109 pulling largefiles for revision 2
1110 1110 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1111 1111 0 largefiles cached
1112 1112
1113 1113 lfpull
1114 1114
1115 1115 $ hg lfpull -r : --config largefiles.usercache=usercache-lfpull
1116 1116 2 largefiles cached
1117 1117 $ hg lfpull -v -r 4+2 --config largefiles.usercache=usercache-lfpull
1118 1118 pulling largefiles for revision 4
1119 1119 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1120 1120 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1121 1121 pulling largefiles for revision 2
1122 1122 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1123 1123 0 largefiles cached
1124 1124
1125 1125 $ ls usercache-lfpull/* | sort
1126 1126 usercache-lfpull/1deebade43c8c498a3c8daddac0244dc55d1331d
1127 1127 usercache-lfpull/4669e532d5b2c093a78eca010077e708a071bb64
1128 1128
1129 1129 $ cd ..
1130 1130
1131 1131 Rebasing between two repositories does not revert largefiles to old
1132 1132 revisions (this was a very bad bug that took a lot of work to fix).
1133 1133
1134 1134 $ hg clone a d
1135 1135 updating to branch default
1136 1136 getting changed largefiles
1137 1137 3 largefiles updated, 0 removed
1138 1138 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1139 1139 $ cd b
1140 1140 $ echo large4-modified > sub/large4
1141 1141 $ echo normal3-modified > normal3
1142 1142 $ hg commit -m "modify normal file and largefile in repo b"
1143 1143 Invoking status precommit hook
1144 1144 M normal3
1145 1145 M sub/large4
1146 1146 $ cd ../d
1147 1147 $ echo large6-modified > sub2/large6
1148 1148 $ echo normal4-modified > sub/normal4
1149 1149 $ hg commit -m "modify normal file largefile in repo d"
1150 1150 Invoking status precommit hook
1151 1151 M sub/normal4
1152 1152 M sub2/large6
1153 1153 $ cd ..
1154 1154 $ hg clone d e
1155 1155 updating to branch default
1156 1156 getting changed largefiles
1157 1157 3 largefiles updated, 0 removed
1158 1158 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1159 1159 $ cd d
1160 1160
1161 1161 More rebase testing, but also test that the largefiles are downloaded from
1162 1162 'default-push' when no source is specified (issue3584). (The largefile from the
1163 1163 pulled revision is however not downloaded but found in the local cache.)
1164 1164 Largefiles are fetched for the new pulled revision, not for existing revisions,
1165 1165 rebased or not.
1166 1166
1167 1167 $ [ ! -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
1168 1168 $ hg pull --rebase --all-largefiles --config paths.default-push=bogus/path --config paths.default=../b
1169 1169 pulling from $TESTTMP/b (glob)
1170 1170 searching for changes
1171 1171 adding changesets
1172 1172 adding manifests
1173 1173 adding file changes
1174 1174 added 1 changesets with 2 changes to 2 files (+1 heads)
1175 1175 0 largefiles cached
1176 1176 Invoking status precommit hook
1177 1177 M sub/normal4
1178 1178 M sub2/large6
1179 1179 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
1180 1180 $ [ -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
1181 1181 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1182 1182 9:598410d3eb9a modify normal file largefile in repo d
1183 1183 8:a381d2c8c80e modify normal file and largefile in repo b
1184 1184 7:daea875e9014 add/edit more largefiles
1185 1185 6:4355d653f84f edit files yet again
1186 1186 5:9d5af5072dbd edit files again
1187 1187 4:74c02385b94c move files
1188 1188 3:9e8fbc4bce62 copy files
1189 1189 2:51a0ae4d5864 remove files
1190 1190 1:ce8896473775 edit files
1191 1191 0:30d30fe6a5be add files
1192 1192 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n'
1193 1193 @ 9:598410d3eb9a modify normal file largefile in repo d
1194 1194 |
1195 1195 o 8:a381d2c8c80e modify normal file and largefile in repo b
1196 1196 |
1197 1197 o 7:daea875e9014 add/edit more largefiles
1198 1198 |
1199 1199 o 6:4355d653f84f edit files yet again
1200 1200 |
1201 1201 o 5:9d5af5072dbd edit files again
1202 1202 |
1203 1203 o 4:74c02385b94c move files
1204 1204 |
1205 1205 o 3:9e8fbc4bce62 copy files
1206 1206 |
1207 1207 o 2:51a0ae4d5864 remove files
1208 1208 |
1209 1209 o 1:ce8896473775 edit files
1210 1210 |
1211 1211 o 0:30d30fe6a5be add files
1212 1212
1213 1213 $ cat normal3
1214 1214 normal3-modified
1215 1215 $ cat sub/normal4
1216 1216 normal4-modified
1217 1217 $ cat sub/large4
1218 1218 large4-modified
1219 1219 $ cat sub2/large6
1220 1220 large6-modified
1221 1221 $ cat sub2/large7
1222 1222 large7
1223 1223 $ cd ../e
1224 1224 $ hg pull ../b
1225 1225 pulling from ../b
1226 1226 searching for changes
1227 1227 adding changesets
1228 1228 adding manifests
1229 1229 adding file changes
1230 1230 added 1 changesets with 2 changes to 2 files (+1 heads)
1231 1231 (run 'hg heads' to see heads, 'hg merge' to merge)
1232 1232 $ hg rebase
1233 1233 Invoking status precommit hook
1234 1234 M sub/normal4
1235 1235 M sub2/large6
1236 1236 saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
1237 1237 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1238 1238 9:598410d3eb9a modify normal file largefile in repo d
1239 1239 8:a381d2c8c80e modify normal file and largefile in repo b
1240 1240 7:daea875e9014 add/edit more largefiles
1241 1241 6:4355d653f84f edit files yet again
1242 1242 5:9d5af5072dbd edit files again
1243 1243 4:74c02385b94c move files
1244 1244 3:9e8fbc4bce62 copy files
1245 1245 2:51a0ae4d5864 remove files
1246 1246 1:ce8896473775 edit files
1247 1247 0:30d30fe6a5be add files
1248 1248 $ cat normal3
1249 1249 normal3-modified
1250 1250 $ cat sub/normal4
1251 1251 normal4-modified
1252 1252 $ cat sub/large4
1253 1253 large4-modified
1254 1254 $ cat sub2/large6
1255 1255 large6-modified
1256 1256 $ cat sub2/large7
1257 1257 large7
1258 1258
1259 1259 Log on largefiles
1260 1260
1261 1261 - same output
1262 1262 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1263 1263 8:a381d2c8c80e modify normal file and largefile in repo b
1264 1264 6:4355d653f84f edit files yet again
1265 1265 5:9d5af5072dbd edit files again
1266 1266 4:74c02385b94c move files
1267 1267 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1268 1268 o 8:a381d2c8c80e modify normal file and largefile in repo b
1269 1269 |
1270 1270 o 6:4355d653f84f edit files yet again
1271 1271 |
1272 1272 o 5:9d5af5072dbd edit files again
1273 1273 |
1274 1274 o 4:74c02385b94c move files
1275 1275 |
1276 1276 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub/large4
1277 1277 8:a381d2c8c80e modify normal file and largefile in repo b
1278 1278 6:4355d653f84f edit files yet again
1279 1279 5:9d5af5072dbd edit files again
1280 1280 4:74c02385b94c move files
1281 1281 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1282 1282 o 8:a381d2c8c80e modify normal file and largefile in repo b
1283 1283 |
1284 1284 o 6:4355d653f84f edit files yet again
1285 1285 |
1286 1286 o 5:9d5af5072dbd edit files again
1287 1287 |
1288 1288 o 4:74c02385b94c move files
1289 1289 |
1290 1290
1291 1291 - .hglf only matches largefiles, without .hglf it matches 9 bco sub/normal
1292 1292 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1293 1293 8:a381d2c8c80e modify normal file and largefile in repo b
1294 1294 6:4355d653f84f edit files yet again
1295 1295 5:9d5af5072dbd edit files again
1296 1296 4:74c02385b94c move files
1297 1297 1:ce8896473775 edit files
1298 1298 0:30d30fe6a5be add files
1299 1299 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1300 1300 o 8:a381d2c8c80e modify normal file and largefile in repo b
1301 1301 |
1302 1302 o 6:4355d653f84f edit files yet again
1303 1303 |
1304 1304 o 5:9d5af5072dbd edit files again
1305 1305 |
1306 1306 o 4:74c02385b94c move files
1307 1307 |
1308 1308 o 1:ce8896473775 edit files
1309 1309 |
1310 1310 o 0:30d30fe6a5be add files
1311 1311
1312 1312 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub
1313 1313 9:598410d3eb9a modify normal file largefile in repo d
1314 1314 8:a381d2c8c80e modify normal file and largefile in repo b
1315 1315 6:4355d653f84f edit files yet again
1316 1316 5:9d5af5072dbd edit files again
1317 1317 4:74c02385b94c move files
1318 1318 1:ce8896473775 edit files
1319 1319 0:30d30fe6a5be add files
1320 1320 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' sub
1321 1321 @ 9:598410d3eb9a modify normal file largefile in repo d
1322 1322 |
1323 1323 o 8:a381d2c8c80e modify normal file and largefile in repo b
1324 1324 |
1325 1325 o 6:4355d653f84f edit files yet again
1326 1326 |
1327 1327 o 5:9d5af5072dbd edit files again
1328 1328 |
1329 1329 o 4:74c02385b94c move files
1330 1330 |
1331 1331 o 1:ce8896473775 edit files
1332 1332 |
1333 1333 o 0:30d30fe6a5be add files
1334 1334
1335 1335 - globbing gives same result
1336 1336 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1337 1337 9:598410d3eb9a modify normal file largefile in repo d
1338 1338 8:a381d2c8c80e modify normal file and largefile in repo b
1339 1339 6:4355d653f84f edit files yet again
1340 1340 5:9d5af5072dbd edit files again
1341 1341 4:74c02385b94c move files
1342 1342 1:ce8896473775 edit files
1343 1343 0:30d30fe6a5be add files
1344 1344 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1345 1345 @ 9:598410d3eb9a modify normal file largefile in repo d
1346 1346 |
1347 1347 o 8:a381d2c8c80e modify normal file and largefile in repo b
1348 1348 |
1349 1349 o 6:4355d653f84f edit files yet again
1350 1350 |
1351 1351 o 5:9d5af5072dbd edit files again
1352 1352 |
1353 1353 o 4:74c02385b94c move files
1354 1354 |
1355 1355 o 1:ce8896473775 edit files
1356 1356 |
1357 1357 o 0:30d30fe6a5be add files
1358 1358
1359 1359 Rollback on largefiles.
1360 1360
1361 1361 $ echo large4-modified-again > sub/large4
1362 1362 $ hg commit -m "Modify large4 again"
1363 1363 Invoking status precommit hook
1364 1364 M sub/large4
1365 1365 $ hg rollback
1366 1366 repository tip rolled back to revision 9 (undo commit)
1367 1367 working directory now based on revision 9
1368 1368 $ hg st
1369 1369 M sub/large4
1370 1370 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1371 1371 9:598410d3eb9a modify normal file largefile in repo d
1372 1372 8:a381d2c8c80e modify normal file and largefile in repo b
1373 1373 7:daea875e9014 add/edit more largefiles
1374 1374 6:4355d653f84f edit files yet again
1375 1375 5:9d5af5072dbd edit files again
1376 1376 4:74c02385b94c move files
1377 1377 3:9e8fbc4bce62 copy files
1378 1378 2:51a0ae4d5864 remove files
1379 1379 1:ce8896473775 edit files
1380 1380 0:30d30fe6a5be add files
1381 1381 $ cat sub/large4
1382 1382 large4-modified-again
1383 1383
1384 1384 "update --check" refuses to update with uncommitted changes.
1385 1385 $ hg update --check 8
1386 1386 abort: uncommitted changes
1387 1387 [255]
1388 1388
1389 1389 "update --clean" leaves correct largefiles in working copy, even when there is
1390 1390 .orig files from revert in .hglf.
1391 1391
1392 1392 $ echo mistake > sub2/large7
1393 1393 $ hg revert sub2/large7
1394 1394 $ cat sub2/large7
1395 1395 large7
1396 1396 $ cat sub2/large7.orig
1397 1397 mistake
1398 1398 $ test ! -f .hglf/sub2/large7.orig
1399 1399
1400 1400 $ hg -q update --clean -r null
1401 1401 $ hg update --clean
1402 1402 getting changed largefiles
1403 1403 3 largefiles updated, 0 removed
1404 1404 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1405 1405 $ cat normal3
1406 1406 normal3-modified
1407 1407 $ cat sub/normal4
1408 1408 normal4-modified
1409 1409 $ cat sub/large4
1410 1410 large4-modified
1411 1411 $ cat sub2/large6
1412 1412 large6-modified
1413 1413 $ cat sub2/large7
1414 1414 large7
1415 1415 $ cat sub2/large7.orig
1416 1416 mistake
1417 1417 $ test ! -f .hglf/sub2/large7.orig
1418 1418
1419 1419 verify that largefile .orig file no longer is overwritten on every update -C:
1420 1420 $ hg update --clean
1421 1421 getting changed largefiles
1422 1422 0 largefiles updated, 0 removed
1423 1423 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1424 1424 $ cat sub2/large7.orig
1425 1425 mistake
1426 1426 $ rm sub2/large7.orig
1427 1427
1428 1428 Now "update check" is happy.
1429 1429 $ hg update --check 8
1430 1430 getting changed largefiles
1431 1431 1 largefiles updated, 0 removed
1432 1432 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1433 1433 $ hg update --check
1434 1434 getting changed largefiles
1435 1435 1 largefiles updated, 0 removed
1436 1436 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1437 1437
1438 1438 Test removing empty largefiles directories on update
1439 1439 $ test -d sub2 && echo "sub2 exists"
1440 1440 sub2 exists
1441 1441 $ hg update -q null
1442 1442 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1443 1443 [1]
1444 1444 $ hg update -q
1445 1445
1446 1446 Test hg remove removes empty largefiles directories
1447 1447 $ test -d sub2 && echo "sub2 exists"
1448 1448 sub2 exists
1449 1449 $ hg remove sub2/*
1450 1450 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1451 1451 [1]
1452 1452 $ hg revert sub2/large6 sub2/large7
1453 1453
1454 1454 "revert" works on largefiles (and normal files too).
1455 1455 $ echo hack3 >> normal3
1456 1456 $ echo hack4 >> sub/normal4
1457 1457 $ echo hack4 >> sub/large4
1458 1458 $ rm sub2/large6
1459 1459 $ hg revert sub2/large6
1460 1460 $ hg rm sub2/large6
1461 1461 $ echo new >> sub2/large8
1462 1462 $ hg add --large sub2/large8
1463 1463 # XXX we don't really want to report that we're reverting the standin;
1464 1464 # that's just an implementation detail. But I don't see an obvious fix. ;-(
1465 1465 $ hg revert sub
1466 1466 reverting .hglf/sub/large4 (glob)
1467 1467 reverting sub/normal4 (glob)
1468 1468 $ hg status
1469 1469 M normal3
1470 1470 A sub2/large8
1471 1471 R sub2/large6
1472 1472 ? sub/large4.orig
1473 1473 ? sub/normal4.orig
1474 1474 $ cat sub/normal4
1475 1475 normal4-modified
1476 1476 $ cat sub/large4
1477 1477 large4-modified
1478 1478 $ hg revert -a --no-backup
1479 1479 undeleting .hglf/sub2/large6 (glob)
1480 1480 forgetting .hglf/sub2/large8 (glob)
1481 1481 reverting normal3
1482 1482 $ hg status
1483 1483 ? sub/large4.orig
1484 1484 ? sub/normal4.orig
1485 1485 ? sub2/large8
1486 1486 $ cat normal3
1487 1487 normal3-modified
1488 1488 $ cat sub2/large6
1489 1489 large6-modified
1490 1490 $ rm sub/*.orig sub2/large8
1491 1491
1492 1492 revert some files to an older revision
1493 1493 $ hg revert --no-backup -r 8 sub2
1494 1494 reverting .hglf/sub2/large6 (glob)
1495 1495 $ cat sub2/large6
1496 1496 large6
1497 1497 $ hg revert --no-backup -C -r '.^' sub2
1498 1498 $ hg revert --no-backup sub2
1499 1499 reverting .hglf/sub2/large6 (glob)
1500 1500 $ hg status
1501 1501
1502 1502 "verify --large" actually verifies largefiles
1503 1503
1504 1504 - Where Do We Come From? What Are We? Where Are We Going?
1505 1505 $ pwd
1506 1506 $TESTTMP/e
1507 1507 $ hg paths
1508 1508 default = $TESTTMP/d (glob)
1509 1509
1510 1510 $ hg verify --large
1511 1511 checking changesets
1512 1512 checking manifests
1513 1513 crosschecking files in changesets and manifests
1514 1514 checking files
1515 1515 10 files, 10 changesets, 28 total revisions
1516 1516 searching 1 changesets for largefiles
1517 1517 verified existence of 3 revisions of 3 largefiles
1518 1518
1519 1519 - introduce missing blob in local store repo and make sure that this is caught:
1520 1520 $ mv $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 .
1521 1521 $ hg verify --large
1522 1522 checking changesets
1523 1523 checking manifests
1524 1524 crosschecking files in changesets and manifests
1525 1525 checking files
1526 1526 10 files, 10 changesets, 28 total revisions
1527 1527 searching 1 changesets for largefiles
1528 1528 changeset 9:598410d3eb9a: sub/large4 references missing $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob)
1529 1529 verified existence of 3 revisions of 3 largefiles
1530 1530 [1]
1531 1531
1532 1532 - introduce corruption and make sure that it is caught when checking content:
1533 1533 $ echo '5 cents' > $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1534 1534 $ hg verify -q --large --lfc
1535 1535 changeset 9:598410d3eb9a: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob)
1536 1536 [1]
1537 1537
1538 1538 - cleanup
1539 1539 $ mv e166e74c7303192238d60af5a9c4ce9bef0b7928 $TESTTMP/d/.hg/largefiles/
1540 1540
1541 1541 - verifying all revisions will fail because we didn't clone all largefiles to d:
1542 1542 $ echo 'T-shirt' > $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1543 1543 $ hg verify -q --lfa --lfc
1544 1544 changeset 0:30d30fe6a5be: large1 references missing $TESTTMP/d/.hg/largefiles/4669e532d5b2c093a78eca010077e708a071bb64 (glob)
1545 1545 changeset 0:30d30fe6a5be: sub/large2 references missing $TESTTMP/d/.hg/largefiles/1deebade43c8c498a3c8daddac0244dc55d1331d (glob)
1546 1546 changeset 1:ce8896473775: large1 references missing $TESTTMP/d/.hg/largefiles/5f78770c0e77ba4287ad6ef3071c9bf9c379742f (glob)
1547 1547 changeset 1:ce8896473775: sub/large2 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1548 1548 changeset 3:9e8fbc4bce62: large1 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1549 1549 changeset 4:74c02385b94c: large3 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1550 1550 changeset 4:74c02385b94c: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1551 1551 changeset 5:9d5af5072dbd: large3 references missing $TESTTMP/d/.hg/largefiles/baaf12afde9d8d67f25dab6dced0d2bf77dba47c (glob)
1552 1552 changeset 5:9d5af5072dbd: sub/large4 references missing $TESTTMP/d/.hg/largefiles/aeb2210d19f02886dde00dac279729a48471e2f9 (glob)
1553 1553 changeset 6:4355d653f84f: large3 references missing $TESTTMP/d/.hg/largefiles/7838695e10da2bb75ac1156565f40a2595fa2fa0 (glob)
1554 1554 [1]
1555 1555
1556 1556 - cleanup
1557 1557 $ rm $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1558 1558 $ rm -f .hglf/sub/*.orig
1559 1559
1560 1560 Update to revision with missing largefile - and make sure it really is missing
1561 1561
1562 1562 $ rm ${USERCACHE}/7838695e10da2bb75ac1156565f40a2595fa2fa0
1563 1563 $ hg up -r 6
1564 1564 getting changed largefiles
1565 1565 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1566 1566 1 largefiles updated, 2 removed
1567 1567 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
1568 1568 $ rm normal3
1569 1569 $ echo >> sub/normal4
1570 1570 $ hg ci -m 'commit with missing files'
1571 1571 Invoking status precommit hook
1572 1572 M sub/normal4
1573 1573 ! large3
1574 1574 ! normal3
1575 1575 created new head
1576 1576 $ hg st
1577 1577 ! large3
1578 1578 ! normal3
1579 1579 $ hg up -r.
1580 1580 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1581 1581 $ hg st
1582 1582 ! large3
1583 1583 ! normal3
1584 1584 $ hg up -Cr.
1585 1585 getting changed largefiles
1586 1586 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1587 1587 0 largefiles updated, 0 removed
1588 1588 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1589 1589 $ hg st
1590 1590 ! large3
1591 1591 $ hg rollback
1592 1592 repository tip rolled back to revision 9 (undo commit)
1593 1593 working directory now based on revision 6
1594 1594
1595 1595 Merge with revision with missing largefile - and make sure it tries to fetch it.
1596 1596
1597 1597 $ hg up -Cqr null
1598 1598 $ echo f > f
1599 1599 $ hg ci -Am branch
1600 1600 adding f
1601 1601 Invoking status precommit hook
1602 1602 A f
1603 1603 created new head
1604 1604 $ hg merge -r 6
1605 1605 getting changed largefiles
1606 1606 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1607 1607 1 largefiles updated, 0 removed
1608 1608 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1609 1609 (branch merge, don't forget to commit)
1610 1610
1611 1611 $ hg rollback -q
1612 1612 $ hg up -Cq
1613 1613
1614 1614 Pulling 0 revisions with --all-largefiles should not fetch for all revisions
1615 1615
1616 1616 $ hg pull --all-largefiles
1617 1617 pulling from $TESTTMP/d (glob)
1618 1618 searching for changes
1619 1619 no changes found
1620 1620
1621 1621 Merging does not revert to old versions of largefiles and also check
1622 1622 that merging after having pulled from a non-default remote works
1623 1623 correctly.
1624 1624
1625 1625 $ cd ..
1626 1626 $ hg clone -r 7 e temp
1627 1627 adding changesets
1628 1628 adding manifests
1629 1629 adding file changes
1630 1630 added 8 changesets with 24 changes to 10 files
1631 1631 updating to branch default
1632 1632 getting changed largefiles
1633 1633 3 largefiles updated, 0 removed
1634 1634 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1635 1635 $ hg clone temp f
1636 1636 updating to branch default
1637 1637 getting changed largefiles
1638 1638 3 largefiles updated, 0 removed
1639 1639 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1640 1640 # Delete the largefiles in the largefiles system cache so that we have an
1641 1641 # opportunity to test that caching after a pull works.
1642 1642 $ rm "${USERCACHE}"/*
1643 1643 $ cd f
1644 1644 $ echo "large4-merge-test" > sub/large4
1645 1645 $ hg commit -m "Modify large4 to test merge"
1646 1646 Invoking status precommit hook
1647 1647 M sub/large4
1648 1648 # Test --cache-largefiles flag
1649 1649 $ hg pull --lfrev 'heads(pulled())' ../e
1650 1650 pulling from ../e
1651 1651 searching for changes
1652 1652 adding changesets
1653 1653 adding manifests
1654 1654 adding file changes
1655 1655 added 2 changesets with 4 changes to 4 files (+1 heads)
1656 1656 (run 'hg heads' to see heads, 'hg merge' to merge)
1657 1657 2 largefiles cached
1658 1658 $ hg merge
1659 1659 largefile sub/large4 has a merge conflict
1660 1660 ancestor was 971fb41e78fea4f8e0ba5244784239371cb00591
1661 1661 keep (l)ocal d846f26643bfa8ec210be40cc93cc6b7ff1128ea or
1662 1662 take (o)ther e166e74c7303192238d60af5a9c4ce9bef0b7928? l
1663 1663 getting changed largefiles
1664 1664 1 largefiles updated, 0 removed
1665 1665 3 files updated, 1 files merged, 0 files removed, 0 files unresolved
1666 1666 (branch merge, don't forget to commit)
1667 1667 $ hg commit -m "Merge repos e and f"
1668 1668 Invoking status precommit hook
1669 1669 M normal3
1670 1670 M sub/normal4
1671 1671 M sub2/large6
1672 1672 $ cat normal3
1673 1673 normal3-modified
1674 1674 $ cat sub/normal4
1675 1675 normal4-modified
1676 1676 $ cat sub/large4
1677 1677 large4-merge-test
1678 1678 $ cat sub2/large6
1679 1679 large6-modified
1680 1680 $ cat sub2/large7
1681 1681 large7
1682 1682
1683 1683 Test status after merging with a branch that introduces a new largefile:
1684 1684
1685 1685 $ echo large > large
1686 1686 $ hg add --large large
1687 1687 $ hg commit -m 'add largefile'
1688 1688 Invoking status precommit hook
1689 1689 A large
1690 1690 $ hg update -q ".^"
1691 1691 $ echo change >> normal3
1692 1692 $ hg commit -m 'some change'
1693 1693 Invoking status precommit hook
1694 1694 M normal3
1695 1695 created new head
1696 1696 $ hg merge
1697 1697 getting changed largefiles
1698 1698 1 largefiles updated, 0 removed
1699 1699 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1700 1700 (branch merge, don't forget to commit)
1701 1701 $ hg status
1702 1702 M large
1703 1703
1704 1704 - make sure update of merge with removed largefiles fails as expected
1705 1705 $ hg rm sub2/large6
1706 1706 $ hg up -r.
1707 1707 abort: outstanding uncommitted merge
1708 1708 [255]
1709 1709
1710 1710 - revert should be able to revert files introduced in a pending merge
1711 1711 $ hg revert --all -r .
1712 1712 removing .hglf/large (glob)
1713 1713 undeleting .hglf/sub2/large6 (glob)
1714 1714
1715 1715 Test that a normal file and a largefile with the same name and path cannot
1716 1716 coexist.
1717 1717
1718 1718 $ rm sub2/large7
1719 1719 $ echo "largeasnormal" > sub2/large7
1720 1720 $ hg add sub2/large7
1721 1721 sub2/large7 already a largefile
1722 1722
1723 1723 Test that transplanting a largefile change works correctly.
1724 1724
1725 1725 $ cd ..
1726 1726 $ hg clone -r 8 d g
1727 1727 adding changesets
1728 1728 adding manifests
1729 1729 adding file changes
1730 1730 added 9 changesets with 26 changes to 10 files
1731 1731 updating to branch default
1732 1732 getting changed largefiles
1733 1733 3 largefiles updated, 0 removed
1734 1734 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1735 1735 $ cd g
1736 1736 $ hg transplant -s ../d 598410d3eb9a
1737 1737 searching for changes
1738 1738 searching for changes
1739 1739 adding changesets
1740 1740 adding manifests
1741 1741 adding file changes
1742 1742 added 1 changesets with 2 changes to 2 files
1743 1743 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1744 1744 9:598410d3eb9a modify normal file largefile in repo d
1745 1745 8:a381d2c8c80e modify normal file and largefile in repo b
1746 1746 7:daea875e9014 add/edit more largefiles
1747 1747 6:4355d653f84f edit files yet again
1748 1748 5:9d5af5072dbd edit files again
1749 1749 4:74c02385b94c move files
1750 1750 3:9e8fbc4bce62 copy files
1751 1751 2:51a0ae4d5864 remove files
1752 1752 1:ce8896473775 edit files
1753 1753 0:30d30fe6a5be add files
1754 1754 $ cat normal3
1755 1755 normal3-modified
1756 1756 $ cat sub/normal4
1757 1757 normal4-modified
1758 1758 $ cat sub/large4
1759 1759 large4-modified
1760 1760 $ cat sub2/large6
1761 1761 large6-modified
1762 1762 $ cat sub2/large7
1763 1763 large7
1764 1764
1765 1765 Cat a largefile
1766 1766 $ hg cat normal3
1767 1767 normal3-modified
1768 1768 $ hg cat sub/large4
1769 1769 large4-modified
1770 1770 $ rm "${USERCACHE}"/*
1771 1771 $ hg cat -r a381d2c8c80e -o cat.out sub/large4
1772 1772 $ cat cat.out
1773 1773 large4-modified
1774 1774 $ rm cat.out
1775 1775 $ hg cat -r a381d2c8c80e normal3
1776 1776 normal3-modified
1777 1777 $ hg cat -r '.^' normal3
1778 1778 normal3-modified
1779 1779 $ hg cat -r '.^' sub/large4 doesntexist
1780 1780 large4-modified
1781 1781 doesntexist: no such file in rev a381d2c8c80e
1782 1782 $ hg --cwd sub cat -r '.^' large4
1783 1783 large4-modified
1784 1784 $ hg --cwd sub cat -r '.^' ../normal3
1785 1785 normal3-modified
1786 1786 Cat a standin
1787 1787 $ hg cat .hglf/sub/large4
1788 1788 e166e74c7303192238d60af5a9c4ce9bef0b7928
1789 1789 $ hg cat .hglf/normal3
1790 .hglf/normal3: no such file in rev 598410d3eb9a
1790 .hglf/normal3: no such file in rev 598410d3eb9a (glob)
1791 1791 [1]
1792 1792
1793 1793 Test that renaming a largefile results in correct output for status
1794 1794
1795 1795 $ hg rename sub/large4 large4-renamed
1796 1796 $ hg commit -m "test rename output"
1797 1797 Invoking status precommit hook
1798 1798 A large4-renamed
1799 1799 R sub/large4
1800 1800 $ cat large4-renamed
1801 1801 large4-modified
1802 1802 $ cd sub2
1803 1803 $ hg rename large6 large6-renamed
1804 1804 $ hg st
1805 1805 A sub2/large6-renamed
1806 1806 R sub2/large6
1807 1807 $ cd ..
1808 1808
1809 1809 Test --normal flag
1810 1810
1811 1811 $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null
1812 1812 $ hg add --normal --large new-largefile
1813 1813 abort: --normal cannot be used with --large
1814 1814 [255]
1815 1815 $ hg add --normal new-largefile
1816 1816 new-largefile: up to 69 MB of RAM may be required to manage this file
1817 1817 (use 'hg revert new-largefile' to cancel the pending addition)
1818 1818 $ cd ..
1819 1819
1820 1820
1821 1821
@@ -1,141 +1,141 b''
1 1 $ hg init repo
2 2 $ cd repo
3 3 $ echo 0 > a
4 4 $ echo 0 > b
5 5 $ echo 0 > t.h
6 6 $ mkdir t
7 7 $ echo 0 > t/x
8 8 $ echo 0 > t/b
9 9 $ echo 0 > t/e.h
10 10 $ mkdir dir.h
11 11 $ echo 0 > dir.h/foo
12 12
13 13 $ hg ci -A -m m
14 14 adding a
15 15 adding b
16 16 adding dir.h/foo
17 17 adding t.h
18 18 adding t/b
19 19 adding t/e.h
20 20 adding t/x
21 21
22 22 $ touch nottracked
23 23
24 24 $ hg locate a
25 25 a
26 26
27 27 $ hg locate NONEXISTENT
28 28 [1]
29 29
30 30 $ hg locate
31 31 a
32 32 b
33 33 dir.h/foo
34 34 t.h
35 35 t/b
36 36 t/e.h
37 37 t/x
38 38
39 39 $ hg rm a
40 40 $ hg ci -m m
41 41
42 42 $ hg locate a
43 43 [1]
44 44 $ hg locate NONEXISTENT
45 45 [1]
46 46 $ hg locate relpath:NONEXISTENT
47 47 [1]
48 48 $ hg locate
49 49 b
50 50 dir.h/foo
51 51 t.h
52 52 t/b
53 53 t/e.h
54 54 t/x
55 55 $ hg locate -r 0 a
56 56 a
57 57 $ hg locate -r 0 NONEXISTENT
58 58 [1]
59 59 $ hg locate -r 0 relpath:NONEXISTENT
60 60 [1]
61 61 $ hg locate -r 0
62 62 a
63 63 b
64 64 dir.h/foo
65 65 t.h
66 66 t/b
67 67 t/e.h
68 68 t/x
69 69
70 70 -I/-X with relative path should work:
71 71
72 72 $ cd t
73 73 $ hg locate
74 74 b
75 75 dir.h/foo
76 76 t.h
77 77 t/b
78 78 t/e.h
79 79 t/x
80 80 $ hg locate -I ../t
81 81 t/b
82 82 t/e.h
83 83 t/x
84 84
85 85 Issue294: hg remove --after dir fails when dir.* also exists
86 86
87 87 $ cd ..
88 88 $ rm -r t
89 89
90 90 $ hg rm t/b
91 91
92 92 $ hg locate 't/**'
93 93 t/b (glob)
94 94 t/e.h (glob)
95 95 t/x (glob)
96 96
97 97 $ hg files
98 98 b
99 dir.h/foo
99 dir.h/foo (glob)
100 100 t.h
101 t/e.h
102 t/x
101 t/e.h (glob)
102 t/x (glob)
103 103 $ hg files b
104 104 b
105 105
106 106 $ mkdir otherdir
107 107 $ cd otherdir
108 108
109 109 $ hg locate b
110 110 ../b (glob)
111 111 ../t/b (glob)
112 112 $ hg locate '*.h'
113 113 ../t.h (glob)
114 114 ../t/e.h (glob)
115 115 $ hg locate path:t/x
116 116 ../t/x (glob)
117 117 $ hg locate 're:.*\.h$'
118 118 ../t.h (glob)
119 119 ../t/e.h (glob)
120 120 $ hg locate -r 0 b
121 121 ../b (glob)
122 122 ../t/b (glob)
123 123 $ hg locate -r 0 '*.h'
124 124 ../t.h (glob)
125 125 ../t/e.h (glob)
126 126 $ hg locate -r 0 path:t/x
127 127 ../t/x (glob)
128 128 $ hg locate -r 0 're:.*\.h$'
129 129 ../t.h (glob)
130 130 ../t/e.h (glob)
131 131
132 132 $ hg files
133 ../b
134 ../dir.h/foo
135 ../t.h
136 ../t/e.h
137 ../t/x
133 ../b (glob)
134 ../dir.h/foo (glob)
135 ../t.h (glob)
136 ../t/e.h (glob)
137 ../t/x (glob)
138 138 $ hg files .
139 139 [1]
140 140
141 141 $ cd ../..
@@ -1,77 +1,77 b''
1 1 Source bundle was generated with the following script:
2 2
3 3 # hg init
4 4 # echo a > a
5 5 # ln -s a l
6 6 # hg ci -Ama -d'0 0'
7 7 # mkdir b
8 8 # echo a > b/a
9 9 # chmod +x b/a
10 10 # hg ci -Amb -d'1 0'
11 11
12 12 $ hg init
13 13 $ hg -q pull "$TESTDIR/bundles/test-manifest.hg"
14 14
15 15 The next call is expected to return nothing:
16 16
17 17 $ hg manifest
18 18
19 19 $ hg co
20 20 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
21 21
22 22 $ hg manifest
23 23 a
24 24 b/a
25 25 l
26 26
27 27 $ hg files -vr .
28 28 2 a
29 2 x b/a
29 2 x b/a (glob)
30 30 1 l l
31 31 $ hg files -r . -X b
32 32 a
33 33 l
34 34
35 35 $ hg manifest -v
36 36 644 a
37 37 755 * b/a
38 38 644 @ l
39 39
40 40 $ hg manifest --debug
41 41 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 644 a
42 42 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 755 * b/a
43 43 047b75c6d7a3ef6a2243bd0e99f94f6ea6683597 644 @ l
44 44
45 45 $ hg manifest -r 0
46 46 a
47 47 l
48 48
49 49 $ hg manifest -r 1
50 50 a
51 51 b/a
52 52 l
53 53
54 54 $ hg manifest -r tip
55 55 a
56 56 b/a
57 57 l
58 58
59 59 $ hg manifest tip
60 60 a
61 61 b/a
62 62 l
63 63
64 64 $ hg manifest --all
65 65 a
66 66 b/a
67 67 l
68 68
69 69 The next two calls are expected to abort:
70 70
71 71 $ hg manifest -r 2
72 72 abort: unknown revision '2'!
73 73 [255]
74 74
75 75 $ hg manifest -r tip tip
76 76 abort: please specify just one revision
77 77 [255]
@@ -1,611 +1,611 b''
1 1 $ cat <<EOF >> $HGRCPATH
2 2 > [ui]
3 3 > commitsubrepos = Yes
4 4 > [extensions]
5 5 > mq =
6 6 > record =
7 7 > [diff]
8 8 > nodates = 1
9 9 > EOF
10 10
11 11 $ stdin=`pwd`/stdin.tmp
12 12
13 13 fn to create new repository w/dirty subrepo, and cd into it
14 14 $ mkrepo() {
15 15 > hg init $1
16 16 > cd $1
17 17 > hg qinit
18 18 > }
19 19
20 20 fn to create dirty subrepo
21 21 $ mksubrepo() {
22 22 > hg init $1
23 23 > cd $1
24 24 > echo a > a
25 25 > hg add
26 26 > cd ..
27 27 > }
28 28
29 29 $ testadd() {
30 30 > cat - > "$stdin"
31 31 > mksubrepo sub
32 32 > echo sub = sub >> .hgsub
33 33 > hg add .hgsub
34 34 > echo % abort when adding .hgsub w/dirty subrepo
35 35 > hg status -S
36 36 > echo '%' $*
37 37 > cat "$stdin" | hg $*
38 38 > echo [$?]
39 39 > hg -R sub ci -m0sub
40 40 > echo % update substate when adding .hgsub w/clean updated subrepo
41 41 > hg status -S
42 42 > echo '%' $*
43 43 > cat "$stdin" | hg $*
44 44 > hg debugsub
45 45 > }
46 46
47 47 $ testmod() {
48 48 > cat - > "$stdin"
49 49 > mksubrepo sub2
50 50 > echo sub2 = sub2 >> .hgsub
51 51 > echo % abort when modifying .hgsub w/dirty subrepo
52 52 > hg status -S
53 53 > echo '%' $*
54 54 > cat "$stdin" | hg $*
55 55 > echo [$?]
56 56 > hg -R sub2 ci -m0sub2
57 57 > echo % update substate when modifying .hgsub w/clean updated subrepo
58 58 > hg status -S
59 59 > echo '%' $*
60 60 > cat "$stdin" | hg $*
61 61 > hg debugsub
62 62 > }
63 63
64 64 $ testrm1() {
65 65 > cat - > "$stdin"
66 66 > mksubrepo sub3
67 67 > echo sub3 = sub3 >> .hgsub
68 68 > hg ci -Aqmsub3
69 69 > $EXTRA
70 70 > echo b >> sub3/a
71 71 > hg rm .hgsub
72 72 > echo % update substate when removing .hgsub w/dirty subrepo
73 73 > hg status -S
74 74 > echo '%' $*
75 75 > cat "$stdin" | hg $*
76 76 > echo % debugsub should be empty
77 77 > hg debugsub
78 78 > }
79 79
80 80 $ testrm2() {
81 81 > cat - > "$stdin"
82 82 > mksubrepo sub4
83 83 > echo sub4 = sub4 >> .hgsub
84 84 > hg ci -Aqmsub4
85 85 > $EXTRA
86 86 > hg rm .hgsub
87 87 > echo % update substate when removing .hgsub w/clean updated subrepo
88 88 > hg status -S
89 89 > echo '%' $*
90 90 > cat "$stdin" | hg $*
91 91 > echo % debugsub should be empty
92 92 > hg debugsub
93 93 > }
94 94
95 95
96 96 handle subrepos safely on qnew
97 97
98 98 $ mkrepo repo-2499-qnew
99 99 $ testadd qnew -X path:no-effect -m0 0.diff
100 100 adding a
101 101 % abort when adding .hgsub w/dirty subrepo
102 102 A .hgsub
103 103 A sub/a
104 104 % qnew -X path:no-effect -m0 0.diff
105 105 abort: uncommitted changes in subrepository sub
106 106 [255]
107 107 % update substate when adding .hgsub w/clean updated subrepo
108 108 A .hgsub
109 109 % qnew -X path:no-effect -m0 0.diff
110 110 path sub
111 111 source sub
112 112 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
113 113
114 114 $ testmod qnew --cwd .. -R repo-2499-qnew -X path:no-effect -m1 1.diff
115 115 adding a
116 116 % abort when modifying .hgsub w/dirty subrepo
117 117 M .hgsub
118 118 A sub2/a
119 119 % qnew --cwd .. -R repo-2499-qnew -X path:no-effect -m1 1.diff
120 120 abort: uncommitted changes in subrepository sub2
121 121 [255]
122 122 % update substate when modifying .hgsub w/clean updated subrepo
123 123 M .hgsub
124 124 % qnew --cwd .. -R repo-2499-qnew -X path:no-effect -m1 1.diff
125 125 path sub
126 126 source sub
127 127 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
128 128 path sub2
129 129 source sub2
130 130 revision 1f94c7611cc6b74f5a17b16121a1170d44776845
131 131
132 132 $ hg qpop -qa
133 133 patch queue now empty
134 134 $ testrm1 qnew -m2 2.diff
135 135 adding a
136 136 % update substate when removing .hgsub w/dirty subrepo
137 137 M sub3/a
138 138 R .hgsub
139 139 % qnew -m2 2.diff
140 140 % debugsub should be empty
141 141
142 142 $ hg qpop -qa
143 143 patch queue now empty
144 144 $ testrm2 qnew -m3 3.diff
145 145 adding a
146 146 % update substate when removing .hgsub w/clean updated subrepo
147 147 R .hgsub
148 148 % qnew -m3 3.diff
149 149 % debugsub should be empty
150 150
151 151 $ cd ..
152 152
153 153
154 154 handle subrepos safely on qrefresh
155 155
156 156 $ mkrepo repo-2499-qrefresh
157 157 $ hg qnew -m0 0.diff
158 158 $ testadd qrefresh
159 159 adding a
160 160 % abort when adding .hgsub w/dirty subrepo
161 161 A .hgsub
162 162 A sub/a
163 163 % qrefresh
164 164 abort: uncommitted changes in subrepository sub
165 165 [255]
166 166 % update substate when adding .hgsub w/clean updated subrepo
167 167 A .hgsub
168 168 % qrefresh
169 169 path sub
170 170 source sub
171 171 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
172 172
173 173 $ hg qnew -m1 1.diff
174 174 $ testmod qrefresh
175 175 adding a
176 176 % abort when modifying .hgsub w/dirty subrepo
177 177 M .hgsub
178 178 A sub2/a
179 179 % qrefresh
180 180 abort: uncommitted changes in subrepository sub2
181 181 [255]
182 182 % update substate when modifying .hgsub w/clean updated subrepo
183 183 M .hgsub
184 184 % qrefresh
185 185 path sub
186 186 source sub
187 187 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
188 188 path sub2
189 189 source sub2
190 190 revision 1f94c7611cc6b74f5a17b16121a1170d44776845
191 191
192 192 $ hg qpop -qa
193 193 patch queue now empty
194 194 $ EXTRA='hg qnew -m2 2.diff'
195 195 $ testrm1 qrefresh
196 196 adding a
197 197 % update substate when removing .hgsub w/dirty subrepo
198 198 M sub3/a
199 199 R .hgsub
200 200 % qrefresh
201 201 % debugsub should be empty
202 202
203 203 $ hg qpop -qa
204 204 patch queue now empty
205 205 $ EXTRA='hg qnew -m3 3.diff'
206 206 $ testrm2 qrefresh
207 207 adding a
208 208 % update substate when removing .hgsub w/clean updated subrepo
209 209 R .hgsub
210 210 % qrefresh
211 211 % debugsub should be empty
212 212 $ EXTRA=
213 213
214 214 $ cd ..
215 215
216 216
217 217 handle subrepos safely on qpush/qpop
218 218 (and we cannot qpop / qpush with a modified subrepo)
219 219
220 220 $ mkrepo repo-2499-qpush
221 221 $ mksubrepo sub
222 222 adding a
223 223 $ hg -R sub ci -m0sub
224 224 $ echo sub = sub > .hgsub
225 225 $ hg add .hgsub
226 226 $ hg commit -m0
227 227 $ hg debugsub
228 228 path sub
229 229 source sub
230 230 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
231 231 $ echo foo > ./sub/a
232 232 $ hg -R sub commit -m foo
233 233 $ hg commit -m1
234 234 $ hg qimport -r "0:tip"
235 235 $ hg -R sub id --id
236 236 aa037b301eba
237 237
238 238 qpop
239 239 $ hg -R sub update 0000
240 240 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
241 241 $ hg qpop
242 242 abort: local changed subrepos found, refresh first
243 243 [255]
244 244 $ hg revert sub
245 245 reverting subrepo sub
246 adding sub/a
246 adding sub/a (glob)
247 247 $ hg qpop
248 248 popping 1.diff
249 249 now at: 0.diff
250 250 $ hg status -AS
251 251 C .hgsub
252 252 C .hgsubstate
253 253 C sub/a
254 254 $ hg -R sub id --id
255 255 b2fdb12cd82b
256 256
257 257 qpush
258 258 $ hg -R sub update 0000
259 259 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
260 260 $ hg qpush
261 261 abort: local changed subrepos found, refresh first
262 262 [255]
263 263 $ hg revert sub
264 264 reverting subrepo sub
265 adding sub/a
265 adding sub/a (glob)
266 266 $ hg qpush
267 267 applying 1.diff
268 268 subrepository sub diverged (local revision: b2fdb12cd82b, remote revision: aa037b301eba)
269 269 (M)erge, keep (l)ocal or keep (r)emote? m
270 270 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
271 271 now at: 1.diff
272 272 $ hg status -AS
273 273 C .hgsub
274 274 C .hgsubstate
275 275 C sub/a
276 276 $ hg -R sub id --id
277 277 aa037b301eba
278 278
279 279 $ cd ..
280 280
281 281
282 282 handle subrepos safely on qrecord
283 283
284 284 $ mkrepo repo-2499-qrecord
285 285 $ testadd qrecord --config ui.interactive=1 -m0 0.diff <<EOF
286 286 > y
287 287 > y
288 288 > EOF
289 289 adding a
290 290 % abort when adding .hgsub w/dirty subrepo
291 291 A .hgsub
292 292 A sub/a
293 293 % qrecord --config ui.interactive=1 -m0 0.diff
294 294 diff --git a/.hgsub b/.hgsub
295 295 new file mode 100644
296 296 examine changes to '.hgsub'? [Ynesfdaq?] y
297 297
298 298 abort: uncommitted changes in subrepository sub
299 299 [255]
300 300 % update substate when adding .hgsub w/clean updated subrepo
301 301 A .hgsub
302 302 % qrecord --config ui.interactive=1 -m0 0.diff
303 303 diff --git a/.hgsub b/.hgsub
304 304 new file mode 100644
305 305 examine changes to '.hgsub'? [Ynesfdaq?] y
306 306
307 307 path sub
308 308 source sub
309 309 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
310 310
311 311 $ testmod qrecord --config ui.interactive=1 -m1 1.diff <<EOF
312 312 > y
313 313 > y
314 314 > EOF
315 315 adding a
316 316 % abort when modifying .hgsub w/dirty subrepo
317 317 M .hgsub
318 318 A sub2/a
319 319 % qrecord --config ui.interactive=1 -m1 1.diff
320 320 diff --git a/.hgsub b/.hgsub
321 321 1 hunks, 1 lines changed
322 322 examine changes to '.hgsub'? [Ynesfdaq?] y
323 323
324 324 @@ -1,1 +1,2 @@
325 325 sub = sub
326 326 +sub2 = sub2
327 327 record this change to '.hgsub'? [Ynesfdaq?] y
328 328
329 329 abort: uncommitted changes in subrepository sub2
330 330 [255]
331 331 % update substate when modifying .hgsub w/clean updated subrepo
332 332 M .hgsub
333 333 % qrecord --config ui.interactive=1 -m1 1.diff
334 334 diff --git a/.hgsub b/.hgsub
335 335 1 hunks, 1 lines changed
336 336 examine changes to '.hgsub'? [Ynesfdaq?] y
337 337
338 338 @@ -1,1 +1,2 @@
339 339 sub = sub
340 340 +sub2 = sub2
341 341 record this change to '.hgsub'? [Ynesfdaq?] y
342 342
343 343 path sub
344 344 source sub
345 345 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
346 346 path sub2
347 347 source sub2
348 348 revision 1f94c7611cc6b74f5a17b16121a1170d44776845
349 349
350 350 $ hg qpop -qa
351 351 patch queue now empty
352 352 $ testrm1 qrecord --config ui.interactive=1 -m2 2.diff <<EOF
353 353 > y
354 354 > y
355 355 > EOF
356 356 adding a
357 357 % update substate when removing .hgsub w/dirty subrepo
358 358 M sub3/a
359 359 R .hgsub
360 360 % qrecord --config ui.interactive=1 -m2 2.diff
361 361 diff --git a/.hgsub b/.hgsub
362 362 deleted file mode 100644
363 363 examine changes to '.hgsub'? [Ynesfdaq?] y
364 364
365 365 % debugsub should be empty
366 366
367 367 $ hg qpop -qa
368 368 patch queue now empty
369 369 $ testrm2 qrecord --config ui.interactive=1 -m3 3.diff <<EOF
370 370 > y
371 371 > y
372 372 > EOF
373 373 adding a
374 374 % update substate when removing .hgsub w/clean updated subrepo
375 375 R .hgsub
376 376 % qrecord --config ui.interactive=1 -m3 3.diff
377 377 diff --git a/.hgsub b/.hgsub
378 378 deleted file mode 100644
379 379 examine changes to '.hgsub'? [Ynesfdaq?] y
380 380
381 381 % debugsub should be empty
382 382
383 383 $ cd ..
384 384
385 385
386 386 correctly handle subrepos with patch queues
387 387 $ mkrepo repo-subrepo-with-queue
388 388 $ mksubrepo sub
389 389 adding a
390 390 $ hg -R sub qnew sub0.diff
391 391 $ echo sub = sub >> .hgsub
392 392 $ hg add .hgsub
393 393 $ hg qnew 0.diff
394 394
395 395 $ cd ..
396 396
397 397 check whether MQ operations can import updated .hgsubstate correctly
398 398 both into 'revision' and 'patch file under .hg/patches':
399 399
400 400 $ hg init importing-hgsubstate
401 401 $ cd importing-hgsubstate
402 402
403 403 $ echo a > a
404 404 $ hg commit -u test -d '0 0' -Am '#0 in parent'
405 405 adding a
406 406 $ hg init sub
407 407 $ echo sa > sub/sa
408 408 $ hg -R sub commit -u test -d '0 0' -Am '#0 in sub'
409 409 adding sa
410 410 $ echo 'sub = sub' > .hgsub
411 411 $ touch .hgsubstate
412 412 $ hg add .hgsub .hgsubstate
413 413
414 414 $ hg qnew -u test -d '0 0' import-at-qnew
415 415 $ hg -R sub parents --template '{node} sub\n'
416 416 b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
417 417 $ cat .hgsubstate
418 418 b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
419 419 $ hg diff -c tip
420 420 diff -r f499373e340c -r f69e96d86e75 .hgsub
421 421 --- /dev/null
422 422 +++ b/.hgsub
423 423 @@ -0,0 +1,1 @@
424 424 +sub = sub
425 425 diff -r f499373e340c -r f69e96d86e75 .hgsubstate
426 426 --- /dev/null
427 427 +++ b/.hgsubstate
428 428 @@ -0,0 +1,1 @@
429 429 +b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
430 430 $ cat .hg/patches/import-at-qnew
431 431 # HG changeset patch
432 432 # User test
433 433 # Date 0 0
434 434 # Parent f499373e340cdca5d01dee904aeb42dd2a325e71
435 435
436 436 diff -r f499373e340c -r f69e96d86e75 .hgsub
437 437 --- /dev/null
438 438 +++ b/.hgsub
439 439 @@ -0,0 +1,1 @@
440 440 +sub = sub
441 441 diff -r f499373e340c -r f69e96d86e75 .hgsubstate
442 442 --- /dev/null
443 443 +++ b/.hgsubstate
444 444 @@ -0,0 +1,1 @@
445 445 +b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
446 446 $ hg parents --template '{node}\n'
447 447 f69e96d86e75a6d4fd88285dc9697acb23951041
448 448 $ hg parents --template '{files}\n'
449 449 .hgsub .hgsubstate
450 450
451 451 check also whether qnew not including ".hgsubstate" explicitly causes
452 452 as same result (in node hash) as one including it.
453 453
454 454 $ hg qpop -a -q
455 455 patch queue now empty
456 456 $ hg qdelete import-at-qnew
457 457 $ echo 'sub = sub' > .hgsub
458 458 $ hg add .hgsub
459 459 $ rm -f .hgsubstate
460 460 $ hg qnew -u test -d '0 0' import-at-qnew
461 461 $ hg parents --template '{node}\n'
462 462 f69e96d86e75a6d4fd88285dc9697acb23951041
463 463 $ hg parents --template '{files}\n'
464 464 .hgsub .hgsubstate
465 465
466 466 check whether qrefresh imports updated .hgsubstate correctly
467 467
468 468 $ hg qpop
469 469 popping import-at-qnew
470 470 patch queue now empty
471 471 $ hg qpush
472 472 applying import-at-qnew
473 473 now at: import-at-qnew
474 474 $ hg parents --template '{files}\n'
475 475 .hgsub .hgsubstate
476 476
477 477 $ hg qnew import-at-qrefresh
478 478 $ echo sb > sub/sb
479 479 $ hg -R sub commit -u test -d '0 0' -Am '#1 in sub'
480 480 adding sb
481 481 $ hg qrefresh -u test -d '0 0'
482 482 $ hg -R sub parents --template '{node} sub\n'
483 483 88ac1bef5ed43b689d1d200b59886b675dec474b sub
484 484 $ cat .hgsubstate
485 485 88ac1bef5ed43b689d1d200b59886b675dec474b sub
486 486 $ hg diff -c tip
487 487 diff -r 05b056bb9c8c -r d987bec230f4 .hgsubstate
488 488 --- a/.hgsubstate
489 489 +++ b/.hgsubstate
490 490 @@ -1,1 +1,1 @@
491 491 -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
492 492 +88ac1bef5ed43b689d1d200b59886b675dec474b sub
493 493 $ cat .hg/patches/import-at-qrefresh
494 494 # HG changeset patch
495 495 # User test
496 496 # Date 0 0
497 497 # Parent 05b056bb9c8c05ff15258b84fd42ab3527271033
498 498
499 499 diff -r 05b056bb9c8c .hgsubstate
500 500 --- a/.hgsubstate
501 501 +++ b/.hgsubstate
502 502 @@ -1,1 +1,1 @@
503 503 -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
504 504 +88ac1bef5ed43b689d1d200b59886b675dec474b sub
505 505 $ hg parents --template '{files}\n'
506 506 .hgsubstate
507 507
508 508 $ hg qrefresh -u test -d '0 0'
509 509 $ cat .hgsubstate
510 510 88ac1bef5ed43b689d1d200b59886b675dec474b sub
511 511 $ hg diff -c tip
512 512 diff -r 05b056bb9c8c -r d987bec230f4 .hgsubstate
513 513 --- a/.hgsubstate
514 514 +++ b/.hgsubstate
515 515 @@ -1,1 +1,1 @@
516 516 -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
517 517 +88ac1bef5ed43b689d1d200b59886b675dec474b sub
518 518 $ cat .hg/patches/import-at-qrefresh
519 519 # HG changeset patch
520 520 # User test
521 521 # Date 0 0
522 522 # Parent 05b056bb9c8c05ff15258b84fd42ab3527271033
523 523
524 524 diff -r 05b056bb9c8c .hgsubstate
525 525 --- a/.hgsubstate
526 526 +++ b/.hgsubstate
527 527 @@ -1,1 +1,1 @@
528 528 -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
529 529 +88ac1bef5ed43b689d1d200b59886b675dec474b sub
530 530 $ hg parents --template '{files}\n'
531 531 .hgsubstate
532 532
533 533 $ hg update -C tip
534 534 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
535 535 $ hg qpop -a
536 536 popping import-at-qrefresh
537 537 popping import-at-qnew
538 538 patch queue now empty
539 539
540 540 $ hg -R sub update -C 0
541 541 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
542 542 $ echo 'sub = sub' > .hgsub
543 543 $ hg commit -Am '#1 in parent'
544 544 adding .hgsub
545 545 $ hg -R sub update -C 1
546 546 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
547 547 $ hg commit -Am '#2 in parent (but will be rolled back soon)'
548 548 $ hg rollback
549 549 repository tip rolled back to revision 1 (undo commit)
550 550 working directory now based on revision 1
551 551 $ hg status
552 552 M .hgsubstate
553 553 $ hg qnew -u test -d '0 0' checkstate-at-qnew
554 554 $ hg -R sub parents --template '{node} sub\n'
555 555 88ac1bef5ed43b689d1d200b59886b675dec474b sub
556 556 $ cat .hgsubstate
557 557 88ac1bef5ed43b689d1d200b59886b675dec474b sub
558 558 $ hg diff -c tip
559 559 diff -r 4d91eb2fa1d1 -r 1259c112d884 .hgsubstate
560 560 --- a/.hgsubstate
561 561 +++ b/.hgsubstate
562 562 @@ -1,1 +1,1 @@
563 563 -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
564 564 +88ac1bef5ed43b689d1d200b59886b675dec474b sub
565 565 $ cat .hg/patches/checkstate-at-qnew
566 566 # HG changeset patch
567 567 # User test
568 568 # Date 0 0
569 569 # Parent 4d91eb2fa1d1b22ec513347b9cd06f6b49d470fa
570 570
571 571 diff -r 4d91eb2fa1d1 -r 1259c112d884 .hgsubstate
572 572 --- a/.hgsubstate
573 573 +++ b/.hgsubstate
574 574 @@ -1,1 +1,1 @@
575 575 -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
576 576 +88ac1bef5ed43b689d1d200b59886b675dec474b sub
577 577 $ hg parents --template '{files}\n'
578 578 .hgsubstate
579 579
580 580 check whether qrefresh not including ".hgsubstate" explicitly causes
581 581 as same result (in node hash) as one including it.
582 582
583 583 $ hg update -C -q 0
584 584 $ hg qpop -a -q
585 585 patch queue now empty
586 586 $ hg qnew -u test -d '0 0' add-hgsub-at-qrefresh
587 587 $ echo 'sub = sub' > .hgsub
588 588 $ echo > .hgsubstate
589 589 $ hg add .hgsub .hgsubstate
590 590 $ hg qrefresh -u test -d '0 0'
591 591 $ hg parents --template '{node}\n'
592 592 7c48c35501aae6770ed9c2517014628615821a8e
593 593 $ hg parents --template '{files}\n'
594 594 .hgsub .hgsubstate
595 595
596 596 $ hg qpop -a -q
597 597 patch queue now empty
598 598 $ hg qdelete add-hgsub-at-qrefresh
599 599 $ hg qnew -u test -d '0 0' add-hgsub-at-qrefresh
600 600 $ echo 'sub = sub' > .hgsub
601 601 $ hg add .hgsub
602 602 $ rm -f .hgsubstate
603 603 $ hg qrefresh -u test -d '0 0'
604 604 $ hg parents --template '{node}\n'
605 605 7c48c35501aae6770ed9c2517014628615821a8e
606 606 $ hg parents --template '{files}\n'
607 607 .hgsub .hgsubstate
608 608
609 609 $ cd ..
610 610
611 611 $ cd ..
@@ -1,438 +1,438 b''
1 1 This file tests the behavior of run-tests.py itself.
2 2
3 3 Smoke test
4 4 ============
5 5
6 6 $ $TESTDIR/run-tests.py
7 7
8 8 # Ran 0 tests, 0 skipped, 0 warned, 0 failed.
9 9
10 10 a succesful test
11 11 =======================
12 12
13 13 $ cat > test-success.t << EOF
14 14 > $ echo babar
15 15 > babar
16 16 > $ echo xyzzy
17 17 > xyzzy
18 18 > EOF
19 19
20 20 $ $TESTDIR/run-tests.py --with-hg=`which hg`
21 21 .
22 22 # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
23 23
24 24 failing test
25 25 ==================
26 26
27 27 $ cat > test-failure.t << EOF
28 28 > $ echo babar
29 29 > rataxes
30 30 > This is a noop statement so that
31 31 > this test is still more bytes than success.
32 32 > EOF
33 33
34 34 $ $TESTDIR/run-tests.py --with-hg=`which hg`
35 35
36 --- $TESTTMP/test-failure.t (glob)
37 +++ $TESTTMP/test-failure.t.err (glob)
36 --- $TESTTMP/test-failure.t
37 +++ $TESTTMP/test-failure.t.err
38 38 @@ -1,4 +1,4 @@
39 39 $ echo babar
40 40 - rataxes
41 41 + babar
42 42 This is a noop statement so that
43 43 this test is still more bytes than success.
44 44
45 45 ERROR: test-failure.t output changed
46 46 !.
47 47 Failed test-failure.t: output changed
48 48 # Ran 2 tests, 0 skipped, 0 warned, 1 failed.
49 49 python hash seed: * (glob)
50 50 [1]
51 51 test --xunit support
52 52 $ $TESTDIR/run-tests.py --with-hg=`which hg` --xunit=xunit.xml
53 53
54 54 --- $TESTTMP/test-failure.t
55 55 +++ $TESTTMP/test-failure.t.err
56 56 @@ -1,4 +1,4 @@
57 57 $ echo babar
58 58 - rataxes
59 59 + babar
60 60 This is a noop statement so that
61 61 this test is still more bytes than success.
62 62
63 63 ERROR: test-failure.t output changed
64 64 !.
65 65 Failed test-failure.t: output changed
66 66 # Ran 2 tests, 0 skipped, 0 warned, 1 failed.
67 67 python hash seed: * (glob)
68 68 [1]
69 69 $ cat xunit.xml
70 70 <?xml version="1.0" encoding="utf-8"?>
71 71 <testsuite errors="0" failures="1" name="run-tests" skipped="0" tests="2">
72 72 <testcase name="test-success.t" time="*"/> (glob)
73 73 <testcase name="test-failure.t" time="*"> (glob)
74 74 <![CDATA[--- $TESTTMP/test-failure.t
75 75 +++ $TESTTMP/test-failure.t.err
76 76 @@ -1,4 +1,4 @@
77 77 $ echo babar
78 78 - rataxes
79 79 + babar
80 80 This is a noop statement so that
81 81 this test is still more bytes than success.
82 82 ]]> </testcase>
83 83 </testsuite>
84 84
85 85 test for --retest
86 86 ====================
87 87
88 88 $ $TESTDIR/run-tests.py --with-hg=`which hg` --retest
89 89
90 --- $TESTTMP/test-failure.t (glob)
91 +++ $TESTTMP/test-failure.t.err (glob)
90 --- $TESTTMP/test-failure.t
91 +++ $TESTTMP/test-failure.t.err
92 92 @@ -1,4 +1,4 @@
93 93 $ echo babar
94 94 - rataxes
95 95 + babar
96 96 This is a noop statement so that
97 97 this test is still more bytes than success.
98 98
99 99 ERROR: test-failure.t output changed
100 100 !
101 101 Failed test-failure.t: output changed
102 102 # Ran 2 tests, 1 skipped, 0 warned, 1 failed.
103 103 python hash seed: * (glob)
104 104 [1]
105 105
106 106 Selecting Tests To Run
107 107 ======================
108 108
109 109 successful
110 110
111 111 $ $TESTDIR/run-tests.py --with-hg=`which hg` test-success.t
112 112 .
113 113 # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
114 114
115 115 success w/ keyword
116 116 $ $TESTDIR/run-tests.py --with-hg=`which hg` -k xyzzy
117 117 .
118 118 # Ran 2 tests, 1 skipped, 0 warned, 0 failed.
119 119
120 120 failed
121 121
122 122 $ $TESTDIR/run-tests.py --with-hg=`which hg` test-failure.t
123 123
124 --- $TESTTMP/test-failure.t (glob)
125 +++ $TESTTMP/test-failure.t.err (glob)
124 --- $TESTTMP/test-failure.t
125 +++ $TESTTMP/test-failure.t.err
126 126 @@ -1,4 +1,4 @@
127 127 $ echo babar
128 128 - rataxes
129 129 + babar
130 130 This is a noop statement so that
131 131 this test is still more bytes than success.
132 132
133 133 ERROR: test-failure.t output changed
134 134 !
135 135 Failed test-failure.t: output changed
136 136 # Ran 1 tests, 0 skipped, 0 warned, 1 failed.
137 137 python hash seed: * (glob)
138 138 [1]
139 139
140 140 failure w/ keyword
141 141 $ $TESTDIR/run-tests.py --with-hg=`which hg` -k rataxes
142 142
143 143 --- $TESTTMP/test-failure.t
144 144 +++ $TESTTMP/test-failure.t.err
145 145 @@ -1,4 +1,4 @@
146 146 $ echo babar
147 147 - rataxes
148 148 + babar
149 149 This is a noop statement so that
150 150 this test is still more bytes than success.
151 151
152 152 ERROR: test-failure.t output changed
153 153 !
154 154 Failed test-failure.t: output changed
155 155 # Ran 2 tests, 1 skipped, 0 warned, 1 failed.
156 156 python hash seed: * (glob)
157 157 [1]
158 158
159 159 Verify that when a process fails to start we show a useful message
160 160 ==================================================================
161 161 NOTE: there is currently a bug where this shows "2 failed" even though
162 162 it's actually the same test being reported for failure twice.
163 163
164 164 $ cat > test-serve-fail.t <<EOF
165 165 > $ echo 'abort: child process failed to start blah'
166 166 > EOF
167 167 $ $TESTDIR/run-tests.py --with-hg=`which hg` test-serve-fail.t
168 168
169 169 ERROR: test-serve-fail.t output changed
170 170 !
171 171 ERROR: test-serve-fail.t output changed
172 172 !
173 173 Failed test-serve-fail.t: server failed to start (HGPORT=*) (glob)
174 174 Failed test-serve-fail.t: output changed
175 175 # Ran 1 tests, 0 skipped, 0 warned, 2 failed.
176 176 python hash seed: * (glob)
177 177 [1]
178 178 $ rm test-serve-fail.t
179 179
180 180 Running In Debug Mode
181 181 ======================
182 182
183 183 $ $TESTDIR/run-tests.py --with-hg=`which hg` --debug 2>&1 | grep -v pwd
184 184 + echo SALT* 0 0 (glob)
185 185 SALT* 0 0 (glob)
186 186 + echo babar
187 187 babar
188 188 + echo SALT* 4 0 (glob)
189 189 SALT* 4 0 (glob)
190 190 .+ echo SALT* 0 0 (glob)
191 191 SALT* 0 0 (glob)
192 192 + echo babar
193 193 babar
194 194 + echo SALT* 2 0 (glob)
195 195 SALT* 2 0 (glob)
196 196 + echo xyzzy
197 197 xyzzy
198 198 + echo SALT* 4 0 (glob)
199 199 SALT* 4 0 (glob)
200 200 .
201 201 # Ran 2 tests, 0 skipped, 0 warned, 0 failed.
202 202
203 203 Parallel runs
204 204 ==============
205 205
206 206 (duplicate the failing test to get predictable output)
207 207 $ cp test-failure.t test-failure-copy.t
208 208
209 209 $ $TESTDIR/run-tests.py --with-hg=`which hg` --jobs 2 test-failure*.t -n
210 210 !!
211 211 Failed test-failure*.t: output changed (glob)
212 212 Failed test-failure*.t: output changed (glob)
213 213 # Ran 2 tests, 0 skipped, 0 warned, 2 failed.
214 214 python hash seed: * (glob)
215 215 [1]
216 216
217 217 failures in parallel with --first should only print one failure
218 218 >>> f = open('test-nothing.t', 'w')
219 219 >>> f.write('foo\n' * 1024)
220 220 >>> f.write(' $ sleep 1')
221 221 $ $TESTDIR/run-tests.py --with-hg=`which hg` --jobs 2 --first
222 222
223 223 --- $TESTTMP/test-failure*.t (glob)
224 224 +++ $TESTTMP/test-failure*.t.err (glob)
225 225 @@ -1,4 +1,4 @@
226 226 $ echo babar
227 227 - rataxes
228 228 + babar
229 229 This is a noop statement so that
230 230 this test is still more bytes than success.
231 231
232 232 Failed test-failure*.t: output changed (glob)
233 233 # Ran 2 tests, 0 skipped, 0 warned, 1 failed.
234 234 python hash seed: * (glob)
235 235 [1]
236 236
237 237
238 238 (delete the duplicated test file)
239 239 $ rm test-failure-copy.t test-nothing.t
240 240
241 241
242 242 Interactive run
243 243 ===============
244 244
245 245 (backup the failing test)
246 246 $ cp test-failure.t backup
247 247
248 248 Refuse the fix
249 249
250 250 $ echo 'n' | $TESTDIR/run-tests.py --with-hg=`which hg` -i
251 251
252 252 --- $TESTTMP/test-failure.t
253 253 +++ $TESTTMP/test-failure.t.err
254 254 @@ -1,4 +1,4 @@
255 255 $ echo babar
256 256 - rataxes
257 257 + babar
258 258 This is a noop statement so that
259 259 this test is still more bytes than success.
260 260 Accept this change? [n]
261 261 ERROR: test-failure.t output changed
262 262 !.
263 263 Failed test-failure.t: output changed
264 264 # Ran 2 tests, 0 skipped, 0 warned, 1 failed.
265 265 python hash seed: * (glob)
266 266 [1]
267 267
268 268 $ cat test-failure.t
269 269 $ echo babar
270 270 rataxes
271 271 This is a noop statement so that
272 272 this test is still more bytes than success.
273 273
274 274 Interactive with custom view
275 275
276 276 $ echo 'n' | $TESTDIR/run-tests.py --with-hg=`which hg` -i --view echo
277 $TESTTMP/test-failure.t $TESTTMP/test-failure.t.err
277 $TESTTMP/test-failure.t $TESTTMP/test-failure.t.err (glob)
278 278 Accept this change? [n]* (glob)
279 279 ERROR: test-failure.t output changed
280 280 !.
281 281 Failed test-failure.t: output changed
282 282 # Ran 2 tests, 0 skipped, 0 warned, 1 failed.
283 283 python hash seed: * (glob)
284 284 [1]
285 285
286 286 View the fix
287 287
288 288 $ echo 'y' | $TESTDIR/run-tests.py --with-hg=`which hg` --view echo
289 $TESTTMP/test-failure.t $TESTTMP/test-failure.t.err
289 $TESTTMP/test-failure.t $TESTTMP/test-failure.t.err (glob)
290 290
291 291 ERROR: test-failure.t output changed
292 292 !.
293 293 Failed test-failure.t: output changed
294 294 # Ran 2 tests, 0 skipped, 0 warned, 1 failed.
295 295 python hash seed: * (glob)
296 296 [1]
297 297
298 298 Accept the fix
299 299
300 300 $ echo 'y' | $TESTDIR/run-tests.py --with-hg=`which hg` -i
301 301
302 302 --- $TESTTMP/test-failure.t
303 303 +++ $TESTTMP/test-failure.t.err
304 304 @@ -1,4 +1,4 @@
305 305 $ echo babar
306 306 - rataxes
307 307 + babar
308 308 This is a noop statement so that
309 309 this test is still more bytes than success.
310 310 Accept this change? [n] ..
311 311 # Ran 2 tests, 0 skipped, 0 warned, 0 failed.
312 312
313 313 $ cat test-failure.t
314 314 $ echo babar
315 315 babar
316 316 This is a noop statement so that
317 317 this test is still more bytes than success.
318 318
319 319 (reinstall)
320 320 $ mv backup test-failure.t
321 321
322 322 No Diff
323 323 ===============
324 324
325 325 $ $TESTDIR/run-tests.py --with-hg=`which hg` --nodiff
326 326 !.
327 327 Failed test-failure.t: output changed
328 328 # Ran 2 tests, 0 skipped, 0 warned, 1 failed.
329 329 python hash seed: * (glob)
330 330 [1]
331 331
332 332 test for --time
333 333 ==================
334 334
335 335 $ $TESTDIR/run-tests.py --with-hg=`which hg` test-success.t --time
336 336 .
337 337 # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
338 338 # Producing time report
339 339 cuser csys real Test
340 340 \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} test-success.t (re)
341 341
342 342 test for --time with --job enabled
343 343 ====================================
344 344
345 345 $ $TESTDIR/run-tests.py --with-hg=`which hg` test-success.t --time --jobs 2
346 346 .
347 347 # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
348 348 # Producing time report
349 349 cuser csys real Test
350 350 \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} test-success.t (re)
351 351
352 352 Skips
353 353 ================
354 354 $ cat > test-skip.t <<EOF
355 355 > $ echo xyzzy
356 356 > #require false
357 357 > EOF
358 358 $ $TESTDIR/run-tests.py --with-hg=`which hg` --nodiff
359 359 !.s
360 360 Skipped test-skip.t: skipped
361 361 Failed test-failure.t: output changed
362 362 # Ran 2 tests, 1 skipped, 0 warned, 1 failed.
363 363 python hash seed: * (glob)
364 364 [1]
365 365
366 366 $ $TESTDIR/run-tests.py --with-hg=`which hg` --keyword xyzzy
367 367 .s
368 368 Skipped test-skip.t: skipped
369 369 # Ran 2 tests, 2 skipped, 0 warned, 0 failed.
370 370
371 371 Skips with xml
372 372 $ $TESTDIR/run-tests.py --with-hg=`which hg` --keyword xyzzy \
373 373 > --xunit=xunit.xml
374 374 .s
375 375 Skipped test-skip.t: skipped
376 376 # Ran 2 tests, 2 skipped, 0 warned, 0 failed.
377 377 $ cat xunit.xml
378 378 <?xml version="1.0" encoding="utf-8"?>
379 379 <testsuite errors="0" failures="0" name="run-tests" skipped="2" tests="2">
380 380 <testcase name="test-success.t" time="*"/> (glob)
381 381 </testsuite>
382 382
383 383 Missing skips or blacklisted skips don't count as executed:
384 384 $ echo test-failure.t > blacklist
385 385 $ $TESTDIR/run-tests.py --with-hg=`which hg` --blacklist=blacklist \
386 386 > test-failure.t test-bogus.t
387 387 ss
388 388 Skipped test-bogus.t: Doesn't exist
389 389 Skipped test-failure.t: blacklisted
390 390 # Ran 0 tests, 2 skipped, 0 warned, 0 failed.
391 391
392 392 #if json
393 393
394 394 test for --json
395 395 ==================
396 396
397 397 $ $TESTDIR/run-tests.py --with-hg=`which hg` --json
398 398
399 399 --- $TESTTMP/test-failure.t
400 400 +++ $TESTTMP/test-failure.t.err
401 401 @@ -1,4 +1,4 @@
402 402 $ echo babar
403 403 - rataxes
404 404 + babar
405 405 This is a noop statement so that
406 406 this test is still more bytes than success.
407 407
408 408 ERROR: test-failure.t output changed
409 409 !.s
410 410 Skipped test-skip.t: skipped
411 411 Failed test-failure.t: output changed
412 412 # Ran 2 tests, 1 skipped, 0 warned, 1 failed.
413 413 python hash seed: * (glob)
414 414 [1]
415 415
416 416 $ cat report.json
417 417 testreport ={
418 418 "test-failure.t": [\{] (re)
419 419 "csys": "\s*[\d\.]{4,5}", ? (re)
420 420 "cuser": "\s*[\d\.]{4,5}", ? (re)
421 421 "result": "failure", ? (re)
422 422 "time": "\s*[\d\.]{4,5}" (re)
423 423 }, ? (re)
424 424 "test-skip.t": {
425 425 "csys": "\s*[\d\.]{4,5}", ? (re)
426 426 "cuser": "\s*[\d\.]{4,5}", ? (re)
427 427 "result": "skip", ? (re)
428 428 "time": "\s*[\d\.]{4,5}" (re)
429 429 }, ? (re)
430 430 "test-success.t": [\{] (re)
431 431 "csys": "\s*[\d\.]{4,5}", ? (re)
432 432 "cuser": "\s*[\d\.]{4,5}", ? (re)
433 433 "result": "success", ? (re)
434 434 "time": "\s*[\d\.]{4,5}" (re)
435 435 }
436 436 } (no-eol)
437 437
438 438 #endif
@@ -1,1471 +1,1471 b''
1 1 Let commit recurse into subrepos by default to match pre-2.0 behavior:
2 2
3 3 $ echo "[ui]" >> $HGRCPATH
4 4 $ echo "commitsubrepos = Yes" >> $HGRCPATH
5 5
6 6 $ hg init t
7 7 $ cd t
8 8
9 9 first revision, no sub
10 10
11 11 $ echo a > a
12 12 $ hg ci -Am0
13 13 adding a
14 14
15 15 add first sub
16 16
17 17 $ echo s = s > .hgsub
18 18 $ hg add .hgsub
19 19 $ hg init s
20 20 $ echo a > s/a
21 21
22 22 Issue2232: committing a subrepo without .hgsub
23 23
24 24 $ hg ci -mbad s
25 25 abort: can't commit subrepos without .hgsub
26 26 [255]
27 27
28 28 $ hg -R s ci -Ams0
29 29 adding a
30 30 $ hg sum
31 31 parent: 0:f7b1eb17ad24 tip
32 32 0
33 33 branch: default
34 34 commit: 1 added, 1 subrepos
35 35 update: (current)
36 36 $ hg ci -m1
37 37
38 38 test handling .hgsubstate "added" explicitly.
39 39
40 40 $ hg parents --template '{node}\n{files}\n'
41 41 7cf8cfea66e410e8e3336508dfeec07b3192de51
42 42 .hgsub .hgsubstate
43 43 $ hg rollback -q
44 44 $ hg add .hgsubstate
45 45 $ hg ci -m1
46 46 $ hg parents --template '{node}\n{files}\n'
47 47 7cf8cfea66e410e8e3336508dfeec07b3192de51
48 48 .hgsub .hgsubstate
49 49
50 50 Revert subrepo and test subrepo fileset keyword:
51 51
52 52 $ echo b > s/a
53 53 $ hg revert "set:subrepo('glob:s*')"
54 54 reverting subrepo s
55 55 reverting s/a (glob)
56 56 $ rm s/a.orig
57 57
58 58 Revert subrepo with no backup. The "reverting s/a" line is gone since
59 59 we're really running 'hg update' in the subrepo:
60 60
61 61 $ echo b > s/a
62 62 $ hg revert --no-backup s
63 63 reverting subrepo s
64 64
65 65 Issue2022: update -C
66 66
67 67 $ echo b > s/a
68 68 $ hg sum
69 69 parent: 1:7cf8cfea66e4 tip
70 70 1
71 71 branch: default
72 72 commit: 1 subrepos
73 73 update: (current)
74 74 $ hg co -C 1
75 75 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
76 76 $ hg sum
77 77 parent: 1:7cf8cfea66e4 tip
78 78 1
79 79 branch: default
80 80 commit: (clean)
81 81 update: (current)
82 82
83 83 commands that require a clean repo should respect subrepos
84 84
85 85 $ echo b >> s/a
86 86 $ hg backout tip
87 87 abort: uncommitted changes in subrepo s
88 88 [255]
89 89 $ hg revert -C -R s s/a
90 90
91 91 add sub sub
92 92
93 93 $ echo ss = ss > s/.hgsub
94 94 $ hg init s/ss
95 95 $ echo a > s/ss/a
96 96 $ hg -R s add s/.hgsub
97 97 $ hg -R s/ss add s/ss/a
98 98 $ hg sum
99 99 parent: 1:7cf8cfea66e4 tip
100 100 1
101 101 branch: default
102 102 commit: 1 subrepos
103 103 update: (current)
104 104 $ hg ci -m2
105 105 committing subrepository s
106 106 committing subrepository s/ss (glob)
107 107 $ hg sum
108 108 parent: 2:df30734270ae tip
109 109 2
110 110 branch: default
111 111 commit: (clean)
112 112 update: (current)
113 113
114 114 test handling .hgsubstate "modified" explicitly.
115 115
116 116 $ hg parents --template '{node}\n{files}\n'
117 117 df30734270ae757feb35e643b7018e818e78a9aa
118 118 .hgsubstate
119 119 $ hg rollback -q
120 120 $ hg status -A .hgsubstate
121 121 M .hgsubstate
122 122 $ hg ci -m2
123 123 $ hg parents --template '{node}\n{files}\n'
124 124 df30734270ae757feb35e643b7018e818e78a9aa
125 125 .hgsubstate
126 126
127 127 bump sub rev (and check it is ignored by ui.commitsubrepos)
128 128
129 129 $ echo b > s/a
130 130 $ hg -R s ci -ms1
131 131 $ hg --config ui.commitsubrepos=no ci -m3
132 132
133 133 leave sub dirty (and check ui.commitsubrepos=no aborts the commit)
134 134
135 135 $ echo c > s/a
136 136 $ hg --config ui.commitsubrepos=no ci -m4
137 137 abort: uncommitted changes in subrepo s
138 138 (use --subrepos for recursive commit)
139 139 [255]
140 140 $ hg id
141 141 f6affe3fbfaa+ tip
142 142 $ hg -R s ci -mc
143 143 $ hg id
144 144 f6affe3fbfaa+ tip
145 145 $ echo d > s/a
146 146 $ hg ci -m4
147 147 committing subrepository s
148 148 $ hg tip -R s
149 149 changeset: 4:02dcf1d70411
150 150 tag: tip
151 151 user: test
152 152 date: Thu Jan 01 00:00:00 1970 +0000
153 153 summary: 4
154 154
155 155
156 156 check caching
157 157
158 158 $ hg co 0
159 159 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
160 160 $ hg debugsub
161 161
162 162 restore
163 163
164 164 $ hg co
165 165 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
166 166 $ hg debugsub
167 167 path s
168 168 source s
169 169 revision 02dcf1d704118aee3ee306ccfa1910850d5b05ef
170 170
171 171 new branch for merge tests
172 172
173 173 $ hg co 1
174 174 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
175 175 $ echo t = t >> .hgsub
176 176 $ hg init t
177 177 $ echo t > t/t
178 178 $ hg -R t add t
179 179 adding t/t (glob)
180 180
181 181 5
182 182
183 183 $ hg ci -m5 # add sub
184 184 committing subrepository t
185 185 created new head
186 186 $ echo t2 > t/t
187 187
188 188 6
189 189
190 190 $ hg st -R s
191 191 $ hg ci -m6 # change sub
192 192 committing subrepository t
193 193 $ hg debugsub
194 194 path s
195 195 source s
196 196 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
197 197 path t
198 198 source t
199 199 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
200 200 $ echo t3 > t/t
201 201
202 202 7
203 203
204 204 $ hg ci -m7 # change sub again for conflict test
205 205 committing subrepository t
206 206 $ hg rm .hgsub
207 207
208 208 8
209 209
210 210 $ hg ci -m8 # remove sub
211 211
212 212 test handling .hgsubstate "removed" explicitly.
213 213
214 214 $ hg parents --template '{node}\n{files}\n'
215 215 96615c1dad2dc8e3796d7332c77ce69156f7b78e
216 216 .hgsub .hgsubstate
217 217 $ hg rollback -q
218 218 $ hg remove .hgsubstate
219 219 $ hg ci -m8
220 220 $ hg parents --template '{node}\n{files}\n'
221 221 96615c1dad2dc8e3796d7332c77ce69156f7b78e
222 222 .hgsub .hgsubstate
223 223
224 224 merge tests
225 225
226 226 $ hg co -C 3
227 227 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
228 228 $ hg merge 5 # test adding
229 229 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
230 230 (branch merge, don't forget to commit)
231 231 $ hg debugsub
232 232 path s
233 233 source s
234 234 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
235 235 path t
236 236 source t
237 237 revision 60ca1237c19474e7a3978b0dc1ca4e6f36d51382
238 238 $ hg ci -m9
239 239 created new head
240 240 $ hg merge 6 --debug # test change
241 241 searching for copies back to rev 2
242 242 resolving manifests
243 243 branchmerge: True, force: False, partial: False
244 244 ancestor: 1f14a2e2d3ec, local: f0d2028bf86d+, remote: 1831e14459c4
245 245 .hgsubstate: versions differ -> m
246 246 updating: .hgsubstate 1/1 files (100.00%)
247 247 subrepo merge f0d2028bf86d+ 1831e14459c4 1f14a2e2d3ec
248 248 subrepo t: other changed, get t:6747d179aa9a688023c4b0cad32e4c92bb7f34ad:hg
249 249 getting subrepo t
250 250 resolving manifests
251 251 branchmerge: False, force: False, partial: False
252 252 ancestor: 60ca1237c194, local: 60ca1237c194+, remote: 6747d179aa9a
253 253 t: remote is newer -> g
254 254 getting t
255 255 updating: t 1/1 files (100.00%)
256 256 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
257 257 (branch merge, don't forget to commit)
258 258 $ hg debugsub
259 259 path s
260 260 source s
261 261 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
262 262 path t
263 263 source t
264 264 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
265 265 $ echo conflict > t/t
266 266 $ hg ci -m10
267 267 committing subrepository t
268 268 $ HGMERGE=internal:merge hg merge --debug 7 # test conflict
269 269 searching for copies back to rev 2
270 270 resolving manifests
271 271 branchmerge: True, force: False, partial: False
272 272 ancestor: 1831e14459c4, local: e45c8b14af55+, remote: f94576341bcf
273 273 .hgsubstate: versions differ -> m
274 274 updating: .hgsubstate 1/1 files (100.00%)
275 275 subrepo merge e45c8b14af55+ f94576341bcf 1831e14459c4
276 276 subrepo t: both sides changed
277 277 subrepository t diverged (local revision: 20a0db6fbf6c, remote revision: 7af322bc1198)
278 278 (M)erge, keep (l)ocal or keep (r)emote? m
279 279 merging subrepo t
280 280 searching for copies back to rev 2
281 281 resolving manifests
282 282 branchmerge: True, force: False, partial: False
283 283 ancestor: 6747d179aa9a, local: 20a0db6fbf6c+, remote: 7af322bc1198
284 284 preserving t for resolve of t
285 285 t: versions differ -> m
286 286 updating: t 1/1 files (100.00%)
287 287 picked tool 'internal:merge' for t (binary False symlink False)
288 288 merging t
289 289 my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
290 290 warning: conflicts during merge.
291 291 merging t incomplete! (edit conflicts, then use 'hg resolve --mark')
292 292 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
293 293 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
294 294 subrepo t: merge with t:7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4:hg
295 295 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
296 296 (branch merge, don't forget to commit)
297 297
298 298 should conflict
299 299
300 300 $ cat t/t
301 301 <<<<<<< local: 20a0db6fbf6c - test: 10
302 302 conflict
303 303 =======
304 304 t3
305 305 >>>>>>> other: 7af322bc1198 - test: 7
306 306
307 307 clone
308 308
309 309 $ cd ..
310 310 $ hg clone t tc
311 311 updating to branch default
312 312 cloning subrepo s from $TESTTMP/t/s
313 313 cloning subrepo s/ss from $TESTTMP/t/s/ss (glob)
314 314 cloning subrepo t from $TESTTMP/t/t
315 315 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
316 316 $ cd tc
317 317 $ hg debugsub
318 318 path s
319 319 source s
320 320 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
321 321 path t
322 322 source t
323 323 revision 20a0db6fbf6c3d2836e6519a642ae929bfc67c0e
324 324
325 325 push
326 326
327 327 $ echo bah > t/t
328 328 $ hg ci -m11
329 329 committing subrepository t
330 330 $ hg push
331 331 pushing to $TESTTMP/t (glob)
332 332 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
333 333 no changes made to subrepo s since last push to $TESTTMP/t/s
334 334 pushing subrepo t to $TESTTMP/t/t
335 335 searching for changes
336 336 adding changesets
337 337 adding manifests
338 338 adding file changes
339 339 added 1 changesets with 1 changes to 1 files
340 340 searching for changes
341 341 adding changesets
342 342 adding manifests
343 343 adding file changes
344 344 added 1 changesets with 1 changes to 1 files
345 345
346 346 push -f
347 347
348 348 $ echo bah > s/a
349 349 $ hg ci -m12
350 350 committing subrepository s
351 351 $ hg push
352 352 pushing to $TESTTMP/t (glob)
353 353 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
354 354 pushing subrepo s to $TESTTMP/t/s
355 355 searching for changes
356 356 abort: push creates new remote head 12a213df6fa9! (in subrepo s)
357 357 (merge or see "hg help push" for details about pushing new heads)
358 358 [255]
359 359 $ hg push -f
360 360 pushing to $TESTTMP/t (glob)
361 361 pushing subrepo s/ss to $TESTTMP/t/s/ss (glob)
362 362 searching for changes
363 363 no changes found
364 364 pushing subrepo s to $TESTTMP/t/s
365 365 searching for changes
366 366 adding changesets
367 367 adding manifests
368 368 adding file changes
369 369 added 1 changesets with 1 changes to 1 files (+1 heads)
370 370 pushing subrepo t to $TESTTMP/t/t
371 371 searching for changes
372 372 no changes found
373 373 searching for changes
374 374 adding changesets
375 375 adding manifests
376 376 adding file changes
377 377 added 1 changesets with 1 changes to 1 files
378 378
379 379 check that unmodified subrepos are not pushed
380 380
381 381 $ hg clone . ../tcc
382 382 updating to branch default
383 383 cloning subrepo s from $TESTTMP/tc/s
384 384 cloning subrepo s/ss from $TESTTMP/tc/s/ss (glob)
385 385 cloning subrepo t from $TESTTMP/tc/t
386 386 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
387 387
388 388 the subrepos on the new clone have nothing to push to its source
389 389
390 390 $ hg push -R ../tcc .
391 391 pushing to .
392 392 no changes made to subrepo s/ss since last push to s/ss (glob)
393 393 no changes made to subrepo s since last push to s
394 394 no changes made to subrepo t since last push to t
395 395 searching for changes
396 396 no changes found
397 397 [1]
398 398
399 399 the subrepos on the source do not have a clean store versus the clone target
400 400 because they were never explicitly pushed to the source
401 401
402 402 $ hg push ../tcc
403 403 pushing to ../tcc
404 404 pushing subrepo s/ss to ../tcc/s/ss (glob)
405 405 searching for changes
406 406 no changes found
407 407 pushing subrepo s to ../tcc/s
408 408 searching for changes
409 409 no changes found
410 410 pushing subrepo t to ../tcc/t
411 411 searching for changes
412 412 no changes found
413 413 searching for changes
414 414 no changes found
415 415 [1]
416 416
417 417 after push their stores become clean
418 418
419 419 $ hg push ../tcc
420 420 pushing to ../tcc
421 421 no changes made to subrepo s/ss since last push to ../tcc/s/ss (glob)
422 422 no changes made to subrepo s since last push to ../tcc/s
423 423 no changes made to subrepo t since last push to ../tcc/t
424 424 searching for changes
425 425 no changes found
426 426 [1]
427 427
428 428 updating a subrepo to a different revision or changing
429 429 its working directory does not make its store dirty
430 430
431 431 $ hg -R s update '.^'
432 432 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
433 433 $ hg push
434 434 pushing to $TESTTMP/t (glob)
435 435 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
436 436 no changes made to subrepo s since last push to $TESTTMP/t/s
437 437 no changes made to subrepo t since last push to $TESTTMP/t/t
438 438 searching for changes
439 439 no changes found
440 440 [1]
441 441 $ echo foo >> s/a
442 442 $ hg push
443 443 pushing to $TESTTMP/t (glob)
444 444 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
445 445 no changes made to subrepo s since last push to $TESTTMP/t/s
446 446 no changes made to subrepo t since last push to $TESTTMP/t/t
447 447 searching for changes
448 448 no changes found
449 449 [1]
450 450 $ hg -R s update -C tip
451 451 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
452 452
453 453 committing into a subrepo makes its store (but not its parent's store) dirty
454 454
455 455 $ echo foo >> s/ss/a
456 456 $ hg -R s/ss commit -m 'test dirty store detection'
457 457 $ hg push
458 458 pushing to $TESTTMP/t (glob)
459 459 pushing subrepo s/ss to $TESTTMP/t/s/ss (glob)
460 460 searching for changes
461 461 adding changesets
462 462 adding manifests
463 463 adding file changes
464 464 added 1 changesets with 1 changes to 1 files
465 465 no changes made to subrepo s since last push to $TESTTMP/t/s
466 466 no changes made to subrepo t since last push to $TESTTMP/t/t
467 467 searching for changes
468 468 no changes found
469 469 [1]
470 470
471 471 a subrepo store may be clean versus one repo but not versus another
472 472
473 473 $ hg push
474 474 pushing to $TESTTMP/t (glob)
475 475 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
476 476 no changes made to subrepo s since last push to $TESTTMP/t/s
477 477 no changes made to subrepo t since last push to $TESTTMP/t/t
478 478 searching for changes
479 479 no changes found
480 480 [1]
481 481 $ hg push ../tcc
482 482 pushing to ../tcc
483 483 pushing subrepo s/ss to ../tcc/s/ss (glob)
484 484 searching for changes
485 485 adding changesets
486 486 adding manifests
487 487 adding file changes
488 488 added 1 changesets with 1 changes to 1 files
489 489 no changes made to subrepo s since last push to ../tcc/s
490 490 no changes made to subrepo t since last push to ../tcc/t
491 491 searching for changes
492 492 no changes found
493 493 [1]
494 494
495 495 update
496 496
497 497 $ cd ../t
498 498 $ hg up -C # discard our earlier merge
499 499 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
500 500 $ echo blah > t/t
501 501 $ hg ci -m13
502 502 committing subrepository t
503 503
504 504 backout calls revert internally with minimal opts, which should not raise
505 505 KeyError
506 506
507 507 $ hg backout ".^"
508 508 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
509 509 changeset c373c8102e68 backed out, don't forget to commit.
510 510
511 511 $ hg up -C # discard changes
512 512 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
513 513
514 514 pull
515 515
516 516 $ cd ../tc
517 517 $ hg pull
518 518 pulling from $TESTTMP/t (glob)
519 519 searching for changes
520 520 adding changesets
521 521 adding manifests
522 522 adding file changes
523 523 added 1 changesets with 1 changes to 1 files
524 524 (run 'hg update' to get a working copy)
525 525
526 526 should pull t
527 527
528 528 $ hg up
529 529 pulling subrepo t from $TESTTMP/t/t
530 530 searching for changes
531 531 adding changesets
532 532 adding manifests
533 533 adding file changes
534 534 added 1 changesets with 1 changes to 1 files
535 535 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
536 536 $ cat t/t
537 537 blah
538 538
539 539 bogus subrepo path aborts
540 540
541 541 $ echo 'bogus=[boguspath' >> .hgsub
542 542 $ hg ci -m 'bogus subrepo path'
543 543 abort: missing ] in subrepo source
544 544 [255]
545 545
546 546 Issue1986: merge aborts when trying to merge a subrepo that
547 547 shouldn't need merging
548 548
549 549 # subrepo layout
550 550 #
551 551 # o 5 br
552 552 # /|
553 553 # o | 4 default
554 554 # | |
555 555 # | o 3 br
556 556 # |/|
557 557 # o | 2 default
558 558 # | |
559 559 # | o 1 br
560 560 # |/
561 561 # o 0 default
562 562
563 563 $ cd ..
564 564 $ rm -rf sub
565 565 $ hg init main
566 566 $ cd main
567 567 $ hg init s
568 568 $ cd s
569 569 $ echo a > a
570 570 $ hg ci -Am1
571 571 adding a
572 572 $ hg branch br
573 573 marked working directory as branch br
574 574 (branches are permanent and global, did you want a bookmark?)
575 575 $ echo a >> a
576 576 $ hg ci -m1
577 577 $ hg up default
578 578 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
579 579 $ echo b > b
580 580 $ hg ci -Am1
581 581 adding b
582 582 $ hg up br
583 583 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
584 584 $ hg merge tip
585 585 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
586 586 (branch merge, don't forget to commit)
587 587 $ hg ci -m1
588 588 $ hg up 2
589 589 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
590 590 $ echo c > c
591 591 $ hg ci -Am1
592 592 adding c
593 593 $ hg up 3
594 594 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
595 595 $ hg merge 4
596 596 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
597 597 (branch merge, don't forget to commit)
598 598 $ hg ci -m1
599 599
600 600 # main repo layout:
601 601 #
602 602 # * <-- try to merge default into br again
603 603 # .`|
604 604 # . o 5 br --> substate = 5
605 605 # . |
606 606 # o | 4 default --> substate = 4
607 607 # | |
608 608 # | o 3 br --> substate = 2
609 609 # |/|
610 610 # o | 2 default --> substate = 2
611 611 # | |
612 612 # | o 1 br --> substate = 3
613 613 # |/
614 614 # o 0 default --> substate = 2
615 615
616 616 $ cd ..
617 617 $ echo 's = s' > .hgsub
618 618 $ hg -R s up 2
619 619 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
620 620 $ hg ci -Am1
621 621 adding .hgsub
622 622 $ hg branch br
623 623 marked working directory as branch br
624 624 (branches are permanent and global, did you want a bookmark?)
625 625 $ echo b > b
626 626 $ hg -R s up 3
627 627 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
628 628 $ hg ci -Am1
629 629 adding b
630 630 $ hg up default
631 631 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
632 632 $ echo c > c
633 633 $ hg ci -Am1
634 634 adding c
635 635 $ hg up 1
636 636 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
637 637 $ hg merge 2
638 638 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
639 639 (branch merge, don't forget to commit)
640 640 $ hg ci -m1
641 641 $ hg up 2
642 642 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
643 643 $ hg -R s up 4
644 644 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
645 645 $ echo d > d
646 646 $ hg ci -Am1
647 647 adding d
648 648 $ hg up 3
649 649 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
650 650 $ hg -R s up 5
651 651 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
652 652 $ echo e > e
653 653 $ hg ci -Am1
654 654 adding e
655 655
656 656 $ hg up 5
657 657 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
658 658 $ hg merge 4 # try to merge default into br again
659 659 subrepository s diverged (local revision: f8f13b33206e, remote revision: a3f9062a4f88)
660 660 (M)erge, keep (l)ocal or keep (r)emote? m
661 661 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
662 662 (branch merge, don't forget to commit)
663 663 $ cd ..
664 664
665 665 test subrepo delete from .hgsubstate
666 666
667 667 $ hg init testdelete
668 668 $ mkdir testdelete/nested testdelete/nested2
669 669 $ hg init testdelete/nested
670 670 $ hg init testdelete/nested2
671 671 $ echo test > testdelete/nested/foo
672 672 $ echo test > testdelete/nested2/foo
673 673 $ hg -R testdelete/nested add
674 674 adding testdelete/nested/foo (glob)
675 675 $ hg -R testdelete/nested2 add
676 676 adding testdelete/nested2/foo (glob)
677 677 $ hg -R testdelete/nested ci -m test
678 678 $ hg -R testdelete/nested2 ci -m test
679 679 $ echo nested = nested > testdelete/.hgsub
680 680 $ echo nested2 = nested2 >> testdelete/.hgsub
681 681 $ hg -R testdelete add
682 682 adding testdelete/.hgsub (glob)
683 683 $ hg -R testdelete ci -m "nested 1 & 2 added"
684 684 $ echo nested = nested > testdelete/.hgsub
685 685 $ hg -R testdelete ci -m "nested 2 deleted"
686 686 $ cat testdelete/.hgsubstate
687 687 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
688 688 $ hg -R testdelete remove testdelete/.hgsub
689 689 $ hg -R testdelete ci -m ".hgsub deleted"
690 690 $ cat testdelete/.hgsubstate
691 691 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
692 692
693 693 test repository cloning
694 694
695 695 $ mkdir mercurial mercurial2
696 696 $ hg init nested_absolute
697 697 $ echo test > nested_absolute/foo
698 698 $ hg -R nested_absolute add
699 699 adding nested_absolute/foo (glob)
700 700 $ hg -R nested_absolute ci -mtest
701 701 $ cd mercurial
702 702 $ hg init nested_relative
703 703 $ echo test2 > nested_relative/foo2
704 704 $ hg -R nested_relative add
705 705 adding nested_relative/foo2 (glob)
706 706 $ hg -R nested_relative ci -mtest2
707 707 $ hg init main
708 708 $ echo "nested_relative = ../nested_relative" > main/.hgsub
709 709 $ echo "nested_absolute = `pwd`/nested_absolute" >> main/.hgsub
710 710 $ hg -R main add
711 711 adding main/.hgsub (glob)
712 712 $ hg -R main ci -m "add subrepos"
713 713 $ cd ..
714 714 $ hg clone mercurial/main mercurial2/main
715 715 updating to branch default
716 716 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
717 717 $ cat mercurial2/main/nested_absolute/.hg/hgrc \
718 718 > mercurial2/main/nested_relative/.hg/hgrc
719 719 [paths]
720 720 default = $TESTTMP/mercurial/nested_absolute
721 721 [paths]
722 722 default = $TESTTMP/mercurial/nested_relative
723 723 $ rm -rf mercurial mercurial2
724 724
725 725 Issue1977: multirepo push should fail if subrepo push fails
726 726
727 727 $ hg init repo
728 728 $ hg init repo/s
729 729 $ echo a > repo/s/a
730 730 $ hg -R repo/s ci -Am0
731 731 adding a
732 732 $ echo s = s > repo/.hgsub
733 733 $ hg -R repo ci -Am1
734 734 adding .hgsub
735 735 $ hg clone repo repo2
736 736 updating to branch default
737 737 cloning subrepo s from $TESTTMP/repo/s
738 738 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
739 739 $ hg -q -R repo2 pull -u
740 740 $ echo 1 > repo2/s/a
741 741 $ hg -R repo2/s ci -m2
742 742 $ hg -q -R repo2/s push
743 743 $ hg -R repo2/s up -C 0
744 744 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
745 745 $ echo 2 > repo2/s/b
746 746 $ hg -R repo2/s ci -m3 -A
747 747 adding b
748 748 created new head
749 749 $ hg -R repo2 ci -m3
750 750 $ hg -q -R repo2 push
751 751 abort: push creates new remote head cc505f09a8b2! (in subrepo s)
752 752 (merge or see "hg help push" for details about pushing new heads)
753 753 [255]
754 754 $ hg -R repo update
755 755 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
756 756
757 757 test if untracked file is not overwritten
758 758
759 759 $ echo issue3276_ok > repo/s/b
760 760 $ hg -R repo2 push -f -q
761 761 $ hg -R repo update
762 762 b: untracked file differs
763 763 abort: untracked files in working directory differ from files in requested revision (in subrepo s)
764 764 [255]
765 765
766 766 $ cat repo/s/b
767 767 issue3276_ok
768 768 $ rm repo/s/b
769 769 $ hg -R repo revert --all
770 770 reverting repo/.hgsubstate (glob)
771 771 reverting subrepo s
772 772 $ hg -R repo update
773 773 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
774 774 $ cat repo/s/b
775 775 2
776 776 $ rm -rf repo2 repo
777 777
778 778
779 779 Issue1852 subrepos with relative paths always push/pull relative to default
780 780
781 781 Prepare a repo with subrepo
782 782
783 783 $ hg init issue1852a
784 784 $ cd issue1852a
785 785 $ hg init sub/repo
786 786 $ echo test > sub/repo/foo
787 787 $ hg -R sub/repo add sub/repo/foo
788 788 $ echo sub/repo = sub/repo > .hgsub
789 789 $ hg add .hgsub
790 790 $ hg ci -mtest
791 791 committing subrepository sub/repo (glob)
792 792 $ echo test >> sub/repo/foo
793 793 $ hg ci -mtest
794 794 committing subrepository sub/repo (glob)
795 795 $ hg cat sub/repo/foo
796 796 test
797 797 test
798 798 $ mkdir -p tmp/sub/repo
799 799 $ hg cat -r 0 --output tmp/%p_p sub/repo/foo
800 800 $ cat tmp/sub/repo/foo_p
801 801 test
802 802 $ mv sub/repo sub_
803 803 $ hg cat sub/repo/baz
804 804 skipping missing subrepository: sub/repo
805 805 [1]
806 806 $ rm -rf sub/repo
807 807 $ mv sub_ sub/repo
808 808 $ cd ..
809 809
810 810 Create repo without default path, pull top repo, and see what happens on update
811 811
812 812 $ hg init issue1852b
813 813 $ hg -R issue1852b pull issue1852a
814 814 pulling from issue1852a
815 815 requesting all changes
816 816 adding changesets
817 817 adding manifests
818 818 adding file changes
819 819 added 2 changesets with 3 changes to 2 files
820 820 (run 'hg update' to get a working copy)
821 821 $ hg -R issue1852b update
822 822 abort: default path for subrepository not found (in subrepo sub/repo) (glob)
823 823 [255]
824 824
825 825 Ensure a full traceback, not just the SubrepoAbort part
826 826
827 827 $ hg -R issue1852b update --traceback 2>&1 | grep 'raise util\.Abort'
828 828 raise util.Abort(_("default path for subrepository not found"))
829 829
830 830 Pull -u now doesn't help
831 831
832 832 $ hg -R issue1852b pull -u issue1852a
833 833 pulling from issue1852a
834 834 searching for changes
835 835 no changes found
836 836
837 837 Try the same, but with pull -u
838 838
839 839 $ hg init issue1852c
840 840 $ hg -R issue1852c pull -r0 -u issue1852a
841 841 pulling from issue1852a
842 842 adding changesets
843 843 adding manifests
844 844 adding file changes
845 845 added 1 changesets with 2 changes to 2 files
846 846 cloning subrepo sub/repo from issue1852a/sub/repo (glob)
847 847 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
848 848
849 849 Try to push from the other side
850 850
851 851 $ hg -R issue1852a push `pwd`/issue1852c
852 852 pushing to $TESTTMP/issue1852c (glob)
853 853 pushing subrepo sub/repo to $TESTTMP/issue1852c/sub/repo (glob)
854 854 searching for changes
855 855 no changes found
856 856 searching for changes
857 857 adding changesets
858 858 adding manifests
859 859 adding file changes
860 860 added 1 changesets with 1 changes to 1 files
861 861
862 862 Incoming and outgoing should not use the default path:
863 863
864 864 $ hg clone -q issue1852a issue1852d
865 865 $ hg -R issue1852d outgoing --subrepos issue1852c
866 866 comparing with issue1852c
867 867 searching for changes
868 868 no changes found
869 869 comparing with issue1852c/sub/repo
870 870 searching for changes
871 871 no changes found
872 872 [1]
873 873 $ hg -R issue1852d incoming --subrepos issue1852c
874 874 comparing with issue1852c
875 875 searching for changes
876 876 no changes found
877 877 comparing with issue1852c/sub/repo
878 878 searching for changes
879 879 no changes found
880 880 [1]
881 881
882 882 Check status of files when none of them belong to the first
883 883 subrepository:
884 884
885 885 $ hg init subrepo-status
886 886 $ cd subrepo-status
887 887 $ hg init subrepo-1
888 888 $ hg init subrepo-2
889 889 $ cd subrepo-2
890 890 $ touch file
891 891 $ hg add file
892 892 $ cd ..
893 893 $ echo subrepo-1 = subrepo-1 > .hgsub
894 894 $ echo subrepo-2 = subrepo-2 >> .hgsub
895 895 $ hg add .hgsub
896 896 $ hg ci -m 'Added subrepos'
897 897 committing subrepository subrepo-2
898 898 $ hg st subrepo-2/file
899 899
900 900 Check that share works with subrepo
901 901 $ hg --config extensions.share= share . ../shared
902 902 updating working directory
903 903 cloning subrepo subrepo-2 from $TESTTMP/subrepo-status/subrepo-2
904 904 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
905 905 $ test -f ../shared/subrepo-1/.hg/sharedpath
906 906 [1]
907 907 $ hg -R ../shared in
908 908 abort: repository default not found!
909 909 [255]
910 910 $ hg -R ../shared/subrepo-2 showconfig paths
911 911 paths.default=$TESTTMP/subrepo-status/subrepo-2
912 912 $ hg -R ../shared/subrepo-1 sum --remote
913 913 parent: -1:000000000000 tip (empty repository)
914 914 branch: default
915 915 commit: (clean)
916 916 update: (current)
917 917 remote: (synced)
918 918
919 919 Check hg update --clean
920 920 $ cd $TESTTMP/t
921 921 $ rm -r t/t.orig
922 922 $ hg status -S --all
923 923 C .hgsub
924 924 C .hgsubstate
925 925 C a
926 926 C s/.hgsub
927 927 C s/.hgsubstate
928 928 C s/a
929 929 C s/ss/a
930 930 C t/t
931 931 $ echo c1 > s/a
932 932 $ cd s
933 933 $ echo c1 > b
934 934 $ echo c1 > c
935 935 $ hg add b
936 936 $ cd ..
937 937 $ hg status -S
938 938 M s/a
939 939 A s/b
940 940 ? s/c
941 941 $ hg update -C
942 942 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
943 943 $ hg status -S
944 944 ? s/b
945 945 ? s/c
946 946
947 947 Sticky subrepositories, no changes
948 948 $ cd $TESTTMP/t
949 949 $ hg id
950 950 925c17564ef8 tip
951 951 $ hg -R s id
952 952 12a213df6fa9 tip
953 953 $ hg -R t id
954 954 52c0adc0515a tip
955 955 $ hg update 11
956 956 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
957 957 $ hg id
958 958 365661e5936a
959 959 $ hg -R s id
960 960 fc627a69481f
961 961 $ hg -R t id
962 962 e95bcfa18a35
963 963
964 964 Sticky subrepositories, file changes
965 965 $ touch s/f1
966 966 $ touch t/f1
967 967 $ hg add -S s/f1
968 968 $ hg add -S t/f1
969 969 $ hg id
970 970 365661e5936a+
971 971 $ hg -R s id
972 972 fc627a69481f+
973 973 $ hg -R t id
974 974 e95bcfa18a35+
975 975 $ hg update tip
976 976 subrepository s diverged (local revision: fc627a69481f, remote revision: 12a213df6fa9)
977 977 (M)erge, keep (l)ocal or keep (r)emote? m
978 978 subrepository sources for s differ
979 979 use (l)ocal source (fc627a69481f) or (r)emote source (12a213df6fa9)? l
980 980 subrepository t diverged (local revision: e95bcfa18a35, remote revision: 52c0adc0515a)
981 981 (M)erge, keep (l)ocal or keep (r)emote? m
982 982 subrepository sources for t differ
983 983 use (l)ocal source (e95bcfa18a35) or (r)emote source (52c0adc0515a)? l
984 984 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
985 985 $ hg id
986 986 925c17564ef8+ tip
987 987 $ hg -R s id
988 988 fc627a69481f+
989 989 $ hg -R t id
990 990 e95bcfa18a35+
991 991 $ hg update --clean tip
992 992 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
993 993
994 994 Sticky subrepository, revision updates
995 995 $ hg id
996 996 925c17564ef8 tip
997 997 $ hg -R s id
998 998 12a213df6fa9 tip
999 999 $ hg -R t id
1000 1000 52c0adc0515a tip
1001 1001 $ cd s
1002 1002 $ hg update -r -2
1003 1003 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1004 1004 $ cd ../t
1005 1005 $ hg update -r 2
1006 1006 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1007 1007 $ cd ..
1008 1008 $ hg update 10
1009 1009 subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f)
1010 1010 (M)erge, keep (l)ocal or keep (r)emote? m
1011 1011 subrepository t diverged (local revision: 52c0adc0515a, remote revision: 20a0db6fbf6c)
1012 1012 (M)erge, keep (l)ocal or keep (r)emote? m
1013 1013 subrepository sources for t differ (in checked out version)
1014 1014 use (l)ocal source (7af322bc1198) or (r)emote source (20a0db6fbf6c)? l
1015 1015 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1016 1016 $ hg id
1017 1017 e45c8b14af55+
1018 1018 $ hg -R s id
1019 1019 02dcf1d70411
1020 1020 $ hg -R t id
1021 1021 7af322bc1198
1022 1022
1023 1023 Sticky subrepository, file changes and revision updates
1024 1024 $ touch s/f1
1025 1025 $ touch t/f1
1026 1026 $ hg add -S s/f1
1027 1027 $ hg add -S t/f1
1028 1028 $ hg id
1029 1029 e45c8b14af55+
1030 1030 $ hg -R s id
1031 1031 02dcf1d70411+
1032 1032 $ hg -R t id
1033 1033 7af322bc1198+
1034 1034 $ hg update tip
1035 1035 subrepository s diverged (local revision: 12a213df6fa9, remote revision: 12a213df6fa9)
1036 1036 (M)erge, keep (l)ocal or keep (r)emote? m
1037 1037 subrepository sources for s differ
1038 1038 use (l)ocal source (02dcf1d70411) or (r)emote source (12a213df6fa9)? l
1039 1039 subrepository t diverged (local revision: 52c0adc0515a, remote revision: 52c0adc0515a)
1040 1040 (M)erge, keep (l)ocal or keep (r)emote? m
1041 1041 subrepository sources for t differ
1042 1042 use (l)ocal source (7af322bc1198) or (r)emote source (52c0adc0515a)? l
1043 1043 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1044 1044 $ hg id
1045 1045 925c17564ef8+ tip
1046 1046 $ hg -R s id
1047 1047 02dcf1d70411+
1048 1048 $ hg -R t id
1049 1049 7af322bc1198+
1050 1050
1051 1051 Sticky repository, update --clean
1052 1052 $ hg update --clean tip
1053 1053 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1054 1054 $ hg id
1055 1055 925c17564ef8 tip
1056 1056 $ hg -R s id
1057 1057 12a213df6fa9 tip
1058 1058 $ hg -R t id
1059 1059 52c0adc0515a tip
1060 1060
1061 1061 Test subrepo already at intended revision:
1062 1062 $ cd s
1063 1063 $ hg update fc627a69481f
1064 1064 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1065 1065 $ cd ..
1066 1066 $ hg update 11
1067 1067 subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f)
1068 1068 (M)erge, keep (l)ocal or keep (r)emote? m
1069 1069 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1070 1070 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1071 1071 $ hg id -n
1072 1072 11+
1073 1073 $ hg -R s id
1074 1074 fc627a69481f
1075 1075 $ hg -R t id
1076 1076 e95bcfa18a35
1077 1077
1078 1078 Test that removing .hgsubstate doesn't break anything:
1079 1079
1080 1080 $ hg rm -f .hgsubstate
1081 1081 $ hg ci -mrm
1082 1082 nothing changed
1083 1083 [1]
1084 1084 $ hg log -vr tip
1085 1085 changeset: 13:925c17564ef8
1086 1086 tag: tip
1087 1087 user: test
1088 1088 date: Thu Jan 01 00:00:00 1970 +0000
1089 1089 files: .hgsubstate
1090 1090 description:
1091 1091 13
1092 1092
1093 1093
1094 1094
1095 1095 Test that removing .hgsub removes .hgsubstate:
1096 1096
1097 1097 $ hg rm .hgsub
1098 1098 $ hg ci -mrm2
1099 1099 created new head
1100 1100 $ hg log -vr tip
1101 1101 changeset: 14:2400bccd50af
1102 1102 tag: tip
1103 1103 parent: 11:365661e5936a
1104 1104 user: test
1105 1105 date: Thu Jan 01 00:00:00 1970 +0000
1106 1106 files: .hgsub .hgsubstate
1107 1107 description:
1108 1108 rm2
1109 1109
1110 1110
1111 1111 Test issue3153: diff -S with deleted subrepos
1112 1112
1113 1113 $ hg diff --nodates -S -c .
1114 1114 diff -r 365661e5936a -r 2400bccd50af .hgsub
1115 1115 --- a/.hgsub
1116 1116 +++ /dev/null
1117 1117 @@ -1,2 +0,0 @@
1118 1118 -s = s
1119 1119 -t = t
1120 1120 diff -r 365661e5936a -r 2400bccd50af .hgsubstate
1121 1121 --- a/.hgsubstate
1122 1122 +++ /dev/null
1123 1123 @@ -1,2 +0,0 @@
1124 1124 -fc627a69481fcbe5f1135069e8a3881c023e4cf5 s
1125 1125 -e95bcfa18a358dc4936da981ebf4147b4cad1362 t
1126 1126
1127 1127 Test behavior of add for explicit path in subrepo:
1128 1128 $ cd ..
1129 1129 $ hg init explicit
1130 1130 $ cd explicit
1131 1131 $ echo s = s > .hgsub
1132 1132 $ hg add .hgsub
1133 1133 $ hg init s
1134 1134 $ hg ci -m0
1135 1135 Adding with an explicit path in a subrepo adds the file
1136 1136 $ echo c1 > f1
1137 1137 $ echo c2 > s/f2
1138 1138 $ hg st -S
1139 1139 ? f1
1140 1140 ? s/f2
1141 1141 $ hg add s/f2
1142 1142 $ hg st -S
1143 1143 A s/f2
1144 1144 ? f1
1145 1145 $ hg ci -R s -m0
1146 1146 $ hg ci -Am1
1147 1147 adding f1
1148 1148 Adding with an explicit path in a subrepo with -S has the same behavior
1149 1149 $ echo c3 > f3
1150 1150 $ echo c4 > s/f4
1151 1151 $ hg st -S
1152 1152 ? f3
1153 1153 ? s/f4
1154 1154 $ hg add -S s/f4
1155 1155 $ hg st -S
1156 1156 A s/f4
1157 1157 ? f3
1158 1158 $ hg ci -R s -m1
1159 1159 $ hg ci -Ama2
1160 1160 adding f3
1161 1161 Adding without a path or pattern silently ignores subrepos
1162 1162 $ echo c5 > f5
1163 1163 $ echo c6 > s/f6
1164 1164 $ echo c7 > s/f7
1165 1165 $ hg st -S
1166 1166 ? f5
1167 1167 ? s/f6
1168 1168 ? s/f7
1169 1169 $ hg add
1170 1170 adding f5
1171 1171 $ hg st -S
1172 1172 A f5
1173 1173 ? s/f6
1174 1174 ? s/f7
1175 1175 $ hg ci -R s -Am2
1176 1176 adding f6
1177 1177 adding f7
1178 1178 $ hg ci -m3
1179 1179 Adding without a path or pattern with -S also adds files in subrepos
1180 1180 $ echo c8 > f8
1181 1181 $ echo c9 > s/f9
1182 1182 $ echo c10 > s/f10
1183 1183 $ hg st -S
1184 1184 ? f8
1185 1185 ? s/f10
1186 1186 ? s/f9
1187 1187 $ hg add -S
1188 1188 adding f8
1189 1189 adding s/f10 (glob)
1190 1190 adding s/f9 (glob)
1191 1191 $ hg st -S
1192 1192 A f8
1193 1193 A s/f10
1194 1194 A s/f9
1195 1195 $ hg ci -R s -m3
1196 1196 $ hg ci -m4
1197 1197 Adding with a pattern silently ignores subrepos
1198 1198 $ echo c11 > fm11
1199 1199 $ echo c12 > fn12
1200 1200 $ echo c13 > s/fm13
1201 1201 $ echo c14 > s/fn14
1202 1202 $ hg st -S
1203 1203 ? fm11
1204 1204 ? fn12
1205 1205 ? s/fm13
1206 1206 ? s/fn14
1207 1207 $ hg add 'glob:**fm*'
1208 1208 adding fm11
1209 1209 $ hg st -S
1210 1210 A fm11
1211 1211 ? fn12
1212 1212 ? s/fm13
1213 1213 ? s/fn14
1214 1214 $ hg ci -R s -Am4
1215 1215 adding fm13
1216 1216 adding fn14
1217 1217 $ hg ci -Am5
1218 1218 adding fn12
1219 1219 Adding with a pattern with -S also adds matches in subrepos
1220 1220 $ echo c15 > fm15
1221 1221 $ echo c16 > fn16
1222 1222 $ echo c17 > s/fm17
1223 1223 $ echo c18 > s/fn18
1224 1224 $ hg st -S
1225 1225 ? fm15
1226 1226 ? fn16
1227 1227 ? s/fm17
1228 1228 ? s/fn18
1229 1229 $ hg add -S 'glob:**fm*'
1230 1230 adding fm15
1231 1231 adding s/fm17 (glob)
1232 1232 $ hg st -S
1233 1233 A fm15
1234 1234 A s/fm17
1235 1235 ? fn16
1236 1236 ? s/fn18
1237 1237 $ hg ci -R s -Am5
1238 1238 adding fn18
1239 1239 $ hg ci -Am6
1240 1240 adding fn16
1241 1241
1242 1242 Test behavior of forget for explicit path in subrepo:
1243 1243 Forgetting an explicit path in a subrepo untracks the file
1244 1244 $ echo c19 > s/f19
1245 1245 $ hg add s/f19
1246 1246 $ hg st -S
1247 1247 A s/f19
1248 1248 $ hg forget s/f19
1249 1249 $ hg st -S
1250 1250 ? s/f19
1251 1251 $ rm s/f19
1252 1252 $ cd ..
1253 1253
1254 1254 Courtesy phases synchronisation to publishing server does not block the push
1255 1255 (issue3781)
1256 1256
1257 1257 $ cp -r main issue3781
1258 1258 $ cp -r main issue3781-dest
1259 1259 $ cd issue3781-dest/s
1260 1260 $ hg phase tip # show we have draft changeset
1261 1261 5: draft
1262 1262 $ chmod a-w .hg/store/phaseroots # prevent phase push
1263 1263 $ cd ../../issue3781
1264 1264 $ cat >> .hg/hgrc << EOF
1265 1265 > [paths]
1266 1266 > default=../issue3781-dest/
1267 1267 > EOF
1268 1268 $ hg push
1269 1269 pushing to $TESTTMP/issue3781-dest (glob)
1270 1270 pushing subrepo s to $TESTTMP/issue3781-dest/s
1271 1271 searching for changes
1272 1272 no changes found
1273 1273 searching for changes
1274 1274 no changes found
1275 1275 [1]
1276 1276 $ cd ..
1277 1277
1278 1278 Test phase choice for newly created commit with "phases.subrepochecks"
1279 1279 configuration
1280 1280
1281 1281 $ cd t
1282 1282 $ hg update -q -r 12
1283 1283
1284 1284 $ cat >> s/ss/.hg/hgrc <<EOF
1285 1285 > [phases]
1286 1286 > new-commit = secret
1287 1287 > EOF
1288 1288 $ cat >> s/.hg/hgrc <<EOF
1289 1289 > [phases]
1290 1290 > new-commit = draft
1291 1291 > EOF
1292 1292 $ echo phasecheck1 >> s/ss/a
1293 1293 $ hg -R s commit -S --config phases.checksubrepos=abort -m phasecheck1
1294 1294 committing subrepository ss
1295 1295 transaction abort!
1296 1296 rollback completed
1297 1297 abort: can't commit in draft phase conflicting secret from subrepository ss
1298 1298 [255]
1299 1299 $ echo phasecheck2 >> s/ss/a
1300 1300 $ hg -R s commit -S --config phases.checksubrepos=ignore -m phasecheck2
1301 1301 committing subrepository ss
1302 1302 $ hg -R s/ss phase tip
1303 1303 3: secret
1304 1304 $ hg -R s phase tip
1305 1305 6: draft
1306 1306 $ echo phasecheck3 >> s/ss/a
1307 1307 $ hg -R s commit -S -m phasecheck3
1308 1308 committing subrepository ss
1309 1309 warning: changes are committed in secret phase from subrepository ss
1310 1310 $ hg -R s/ss phase tip
1311 1311 4: secret
1312 1312 $ hg -R s phase tip
1313 1313 7: secret
1314 1314
1315 1315 $ cat >> t/.hg/hgrc <<EOF
1316 1316 > [phases]
1317 1317 > new-commit = draft
1318 1318 > EOF
1319 1319 $ cat >> .hg/hgrc <<EOF
1320 1320 > [phases]
1321 1321 > new-commit = public
1322 1322 > EOF
1323 1323 $ echo phasecheck4 >> s/ss/a
1324 1324 $ echo phasecheck4 >> t/t
1325 1325 $ hg commit -S -m phasecheck4
1326 1326 committing subrepository s
1327 committing subrepository s/ss
1327 committing subrepository s/ss (glob)
1328 1328 warning: changes are committed in secret phase from subrepository ss
1329 1329 committing subrepository t
1330 1330 warning: changes are committed in secret phase from subrepository s
1331 1331 created new head
1332 1332 $ hg -R s/ss phase tip
1333 1333 5: secret
1334 1334 $ hg -R s phase tip
1335 1335 8: secret
1336 1336 $ hg -R t phase tip
1337 1337 6: draft
1338 1338 $ hg phase tip
1339 1339 15: secret
1340 1340
1341 1341 $ cd ..
1342 1342
1343 1343
1344 1344 Test that commit --secret works on both repo and subrepo (issue4182)
1345 1345
1346 1346 $ cd main
1347 1347 $ echo secret >> b
1348 1348 $ echo secret >> s/b
1349 1349 $ hg commit --secret --subrepo -m "secret"
1350 1350 committing subrepository s
1351 1351 $ hg phase -r .
1352 1352 6: secret
1353 1353 $ cd s
1354 1354 $ hg phase -r .
1355 1355 6: secret
1356 1356 $ cd ../../
1357 1357
1358 1358 Test "subrepos" template keyword
1359 1359
1360 1360 $ cd t
1361 1361 $ hg update -q 15
1362 1362 $ cat > .hgsub <<EOF
1363 1363 > s = s
1364 1364 > EOF
1365 1365 $ hg commit -m "16"
1366 1366 warning: changes are committed in secret phase from subrepository s
1367 1367
1368 1368 (addition of ".hgsub" itself)
1369 1369
1370 1370 $ hg diff --nodates -c 1 .hgsubstate
1371 1371 diff -r f7b1eb17ad24 -r 7cf8cfea66e4 .hgsubstate
1372 1372 --- /dev/null
1373 1373 +++ b/.hgsubstate
1374 1374 @@ -0,0 +1,1 @@
1375 1375 +e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1376 1376 $ hg log -r 1 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1377 1377 f7b1eb17ad24 000000000000
1378 1378 s
1379 1379
1380 1380 (modification of existing entry)
1381 1381
1382 1382 $ hg diff --nodates -c 2 .hgsubstate
1383 1383 diff -r 7cf8cfea66e4 -r df30734270ae .hgsubstate
1384 1384 --- a/.hgsubstate
1385 1385 +++ b/.hgsubstate
1386 1386 @@ -1,1 +1,1 @@
1387 1387 -e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1388 1388 +dc73e2e6d2675eb2e41e33c205f4bdab4ea5111d s
1389 1389 $ hg log -r 2 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1390 1390 7cf8cfea66e4 000000000000
1391 1391 s
1392 1392
1393 1393 (addition of entry)
1394 1394
1395 1395 $ hg diff --nodates -c 5 .hgsubstate
1396 1396 diff -r 7cf8cfea66e4 -r 1f14a2e2d3ec .hgsubstate
1397 1397 --- a/.hgsubstate
1398 1398 +++ b/.hgsubstate
1399 1399 @@ -1,1 +1,2 @@
1400 1400 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1401 1401 +60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t
1402 1402 $ hg log -r 5 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1403 1403 7cf8cfea66e4 000000000000
1404 1404 t
1405 1405
1406 1406 (removal of existing entry)
1407 1407
1408 1408 $ hg diff --nodates -c 16 .hgsubstate
1409 1409 diff -r 8bec38d2bd0b -r f2f70bc3d3c9 .hgsubstate
1410 1410 --- a/.hgsubstate
1411 1411 +++ b/.hgsubstate
1412 1412 @@ -1,2 +1,1 @@
1413 1413 0731af8ca9423976d3743119d0865097c07bdc1b s
1414 1414 -e202dc79b04c88a636ea8913d9182a1346d9b3dc t
1415 1415 $ hg log -r 16 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1416 1416 8bec38d2bd0b 000000000000
1417 1417 t
1418 1418
1419 1419 (merging)
1420 1420
1421 1421 $ hg diff --nodates -c 9 .hgsubstate
1422 1422 diff -r f6affe3fbfaa -r f0d2028bf86d .hgsubstate
1423 1423 --- a/.hgsubstate
1424 1424 +++ b/.hgsubstate
1425 1425 @@ -1,1 +1,2 @@
1426 1426 fc627a69481fcbe5f1135069e8a3881c023e4cf5 s
1427 1427 +60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t
1428 1428 $ hg log -r 9 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1429 1429 f6affe3fbfaa 1f14a2e2d3ec
1430 1430 t
1431 1431
1432 1432 (removal of ".hgsub" itself)
1433 1433
1434 1434 $ hg diff --nodates -c 8 .hgsubstate
1435 1435 diff -r f94576341bcf -r 96615c1dad2d .hgsubstate
1436 1436 --- a/.hgsubstate
1437 1437 +++ /dev/null
1438 1438 @@ -1,2 +0,0 @@
1439 1439 -e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1440 1440 -7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4 t
1441 1441 $ hg log -r 8 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1442 1442 f94576341bcf 000000000000
1443 1443
1444 1444 Test that '[paths]' is configured correctly at subrepo creation
1445 1445
1446 1446 $ cd $TESTTMP/tc
1447 1447 $ cat > .hgsub <<EOF
1448 1448 > # to clear bogus subrepo path 'bogus=[boguspath'
1449 1449 > s = s
1450 1450 > t = t
1451 1451 > EOF
1452 1452 $ hg update -q --clean null
1453 1453 $ rm -rf s t
1454 1454 $ cat >> .hg/hgrc <<EOF
1455 1455 > [paths]
1456 1456 > default-push = /foo/bar
1457 1457 > EOF
1458 1458 $ hg update -q
1459 1459 $ cat s/.hg/hgrc
1460 1460 [paths]
1461 1461 default = $TESTTMP/t/s
1462 1462 default-push = /foo/bar/s
1463 1463 $ cat s/ss/.hg/hgrc
1464 1464 [paths]
1465 1465 default = $TESTTMP/t/s/ss
1466 1466 default-push = /foo/bar/s/ss
1467 1467 $ cat t/.hg/hgrc
1468 1468 [paths]
1469 1469 default = $TESTTMP/t/t
1470 1470 default-push = /foo/bar/t
1471 1471 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now