##// END OF EJS Templates
tests: add test showing crash when shelving ghosted rename target...
Martin von Zweigbergk -
r44690:ae4d729e default
parent child Browse files
Show More
@@ -1,1491 +1,1515
1 1 #testcases stripbased phasebased
2 2
3 3 $ cat <<EOF >> $HGRCPATH
4 4 > [extensions]
5 5 > mq =
6 6 > [defaults]
7 7 > diff = --nodates --git
8 8 > qnew = --date '0 0'
9 9 > [shelve]
10 10 > maxbackups = 2
11 11 > EOF
12 12
13 13 #if phasebased
14 14
15 15 $ cat <<EOF >> $HGRCPATH
16 16 > [format]
17 17 > internal-phase = yes
18 18 > EOF
19 19
20 20 #endif
21 21
22 22 $ hg init repo
23 23 $ cd repo
24 24 $ mkdir a b
25 25 $ echo a > a/a
26 26 $ echo b > b/b
27 27 $ echo c > c
28 28 $ echo d > d
29 29 $ echo x > x
30 30 $ hg addremove -q
31 31
32 32 shelve has a help message
33 33 $ hg shelve -h
34 34 hg shelve [OPTION]... [FILE]...
35 35
36 36 save and set aside changes from the working directory
37 37
38 38 Shelving takes files that "hg status" reports as not clean, saves the
39 39 modifications to a bundle (a shelved change), and reverts the files so
40 40 that their state in the working directory becomes clean.
41 41
42 42 To restore these changes to the working directory, using "hg unshelve";
43 43 this will work even if you switch to a different commit.
44 44
45 45 When no files are specified, "hg shelve" saves all not-clean files. If
46 46 specific files or directories are named, only changes to those files are
47 47 shelved.
48 48
49 49 In bare shelve (when no files are specified, without interactive, include
50 50 and exclude option), shelving remembers information if the working
51 51 directory was on newly created branch, in other words working directory
52 52 was on different branch than its first parent. In this situation
53 53 unshelving restores branch information to the working directory.
54 54
55 55 Each shelved change has a name that makes it easier to find later. The
56 56 name of a shelved change defaults to being based on the active bookmark,
57 57 or if there is no active bookmark, the current named branch. To specify a
58 58 different name, use "--name".
59 59
60 60 To see a list of existing shelved changes, use the "--list" option. For
61 61 each shelved change, this will print its name, age, and description; use "
62 62 --patch" or "--stat" for more details.
63 63
64 64 To delete specific shelved changes, use "--delete". To delete all shelved
65 65 changes, use "--cleanup".
66 66
67 67 options ([+] can be repeated):
68 68
69 69 -A --addremove mark new/missing files as added/removed before
70 70 shelving
71 71 -u --unknown store unknown files in the shelve
72 72 --cleanup delete all shelved changes
73 73 --date DATE shelve with the specified commit date
74 74 -d --delete delete the named shelved change(s)
75 75 -e --edit invoke editor on commit messages
76 76 -k --keep shelve, but keep changes in the working directory
77 77 -l --list list current shelves
78 78 -m --message TEXT use text as shelve message
79 79 -n --name NAME use the given name for the shelved commit
80 80 -p --patch output patches for changes (provide the names of the
81 81 shelved changes as positional arguments)
82 82 -i --interactive interactive mode
83 83 --stat output diffstat-style summary of changes (provide
84 84 the names of the shelved changes as positional
85 85 arguments)
86 86 -I --include PATTERN [+] include names matching the given patterns
87 87 -X --exclude PATTERN [+] exclude names matching the given patterns
88 88 --mq operate on patch repository
89 89
90 90 (some details hidden, use --verbose to show complete help)
91 91
92 92 shelving in an empty repo should be possible
93 93 (this tests also that editor is not invoked, if '--edit' is not
94 94 specified)
95 95
96 96 $ HGEDITOR=cat hg shelve
97 97 shelved as default
98 98 0 files updated, 0 files merged, 5 files removed, 0 files unresolved
99 99
100 100 $ hg unshelve
101 101 unshelving change 'default'
102 102
103 103 $ hg commit -q -m 'initial commit'
104 104
105 105 $ hg shelve
106 106 nothing changed
107 107 [1]
108 108
109 109 make sure shelve files were backed up
110 110
111 111 $ ls .hg/shelve-backup
112 112 default.hg
113 113 default.patch
114 114 default.shelve
115 115
116 116 checks to make sure we dont create a directory or
117 117 hidden file while choosing a new shelve name
118 118
119 119 when we are given a name
120 120
121 121 $ hg shelve -n foo/bar
122 122 abort: shelved change names can not contain slashes
123 123 [255]
124 124 $ hg shelve -n .baz
125 125 abort: shelved change names can not start with '.'
126 126 [255]
127 127 $ hg shelve -n foo\\bar
128 128 abort: shelved change names can not contain slashes
129 129 [255]
130 130
131 131 when shelve has to choose itself
132 132
133 133 $ hg branch x/y -q
134 134 $ hg commit -q -m "Branch commit 0"
135 135 $ hg shelve
136 136 nothing changed
137 137 [1]
138 138 $ hg branch .x -q
139 139 $ hg commit -q -m "Branch commit 1"
140 140 $ hg shelve
141 141 nothing changed
142 142 [1]
143 143 $ hg branch x\\y -q
144 144 $ hg commit -q -m "Branch commit 2"
145 145 $ hg shelve
146 146 nothing changed
147 147 [1]
148 148
149 149 cleaning the branches made for name checking tests
150 150
151 151 $ hg up default -q
152 152 $ hg strip e9177275307e+6a6d231f43d+882bae7c62c2 -q
153 153
154 154 create an mq patch - shelving should work fine with a patch applied
155 155
156 156 $ echo n > n
157 157 $ hg add n
158 158 $ hg commit n -m second
159 159 $ hg qnew second.patch
160 160
161 161 shelve a change that we will delete later
162 162
163 163 $ echo a >> a/a
164 164 $ hg shelve
165 165 shelved as default
166 166 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
167 167
168 168 set up some more complex changes to shelve
169 169
170 170 $ echo a >> a/a
171 171 $ hg mv b b.rename
172 172 moving b/b to b.rename/b
173 173 $ hg cp c c.copy
174 $ hg mv d ghost
175 $ rm ghost
174 176 $ hg status -C
175 177 M a/a
176 178 A b.rename/b
177 179 b/b
178 180 A c.copy
179 181 c
180 182 R b/b
183 R d
184 ! ghost
185 d
181 186
182 187 the common case - no options or filenames
183 188
184 $ hg shelve
185 shelved as default-01
186 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
189 $ hg shelve 2>&1 | grep KeyError
190 KeyError: 'No such manifest entry.' (no-pure !)
191 raise KeyError (pure !)
192 KeyError (pure !)
193 # Get out of the broken state so later tests work
194 $ hg forget b.rename/b c.copy ghost
195 $ hg revert a/a b/b d
196 $ rm a/a.orig b.rename/b c.copy
187 197 $ hg status -C
188 198
189 199 ensure that our shelved changes exist
190 200
191 201 $ hg shelve -l
192 202 default-01 (*)* changes to: [mq]: second.patch (glob)
193 203 default (*)* changes to: [mq]: second.patch (glob)
194 204
195 205 $ hg shelve -l -p default
196 206 default (*)* changes to: [mq]: second.patch (glob)
197 207
198 208 diff --git a/a/a b/a/a
199 209 --- a/a/a
200 210 +++ b/a/a
201 211 @@ -1,1 +1,2 @@
202 212 a
203 213 +a
204 214
205 215 $ hg shelve --list --addremove
206 216 abort: options '--list' and '--addremove' may not be used together
207 217 [255]
208 218
209 219 delete our older shelved change
210 220
211 221 $ hg shelve -d default
212 222 $ hg qfinish -a -q
213 223
214 224 ensure shelve backups aren't overwritten
215 225
216 226 $ ls .hg/shelve-backup/
217 227 default-1.hg
218 228 default-1.patch
219 229 default-1.shelve
220 230 default.hg
221 231 default.patch
222 232 default.shelve
223 233
224 234 local edits should not prevent a shelved change from applying
225 235
226 236 $ printf "z\na\n" > a/a
227 237 $ hg unshelve --keep
228 238 unshelving change 'default-01'
229 239 temporarily committing pending changes (restore with 'hg unshelve --abort')
230 240 rebasing shelved changes
231 241 merging a/a
232 242
233 243 $ hg revert --all -q
234 244 $ rm a/a.orig b.rename/b c.copy
235 245
236 246 apply it and make sure our state is as expected
237 247
238 248 (this also tests that same timestamp prevents backups from being
239 249 removed, even though there are more than 'maxbackups' backups)
240 250
241 251 $ f -t .hg/shelve-backup/default.patch
242 252 .hg/shelve-backup/default.patch: file
243 253 $ touch -t 200001010000 .hg/shelve-backup/default.patch
244 254 $ f -t .hg/shelve-backup/default-1.patch
245 255 .hg/shelve-backup/default-1.patch: file
246 256 $ touch -t 200001010000 .hg/shelve-backup/default-1.patch
247 257
248 258 $ hg unshelve
249 259 unshelving change 'default-01'
250 260 $ hg status -C
251 261 M a/a
252 262 A b.rename/b
253 263 b/b
254 264 A c.copy
255 265 c
256 266 R b/b
267 R d
257 268 $ hg shelve -l
258 269
259 270 (both of default.hg and default-1.hg should be still kept, because it
260 271 is difficult to decide actual order of them from same timestamp)
261 272
262 273 $ ls .hg/shelve-backup/
263 274 default-01.hg
264 275 default-01.patch
265 276 default-01.shelve
266 277 default-1.hg
267 278 default-1.patch
268 279 default-1.shelve
269 280 default.hg
270 281 default.patch
271 282 default.shelve
272 283
273 284 $ hg unshelve
274 285 abort: no shelved changes to apply!
275 286 [255]
276 287 $ hg unshelve foo
277 288 abort: shelved change 'foo' not found
278 289 [255]
279 290
280 291 named shelves, specific filenames, and "commit messages" should all work
281 292 (this tests also that editor is invoked, if '--edit' is specified)
282 293
283 294 $ hg status -C
284 295 M a/a
285 296 A b.rename/b
286 297 b/b
287 298 A c.copy
288 299 c
289 300 R b/b
301 R d
290 302 $ HGEDITOR=cat hg shelve -q -n wibble -m wat -e a
291 303 wat
292 304
293 305
294 306 HG: Enter commit message. Lines beginning with 'HG:' are removed.
295 307 HG: Leave message empty to abort commit.
296 308 HG: --
297 309 HG: user: shelve@localhost
298 310 HG: branch 'default'
299 311 HG: changed a/a
300 312
301 313 expect "a" to no longer be present, but status otherwise unchanged
302 314
303 315 $ hg status -C
304 316 A b.rename/b
305 317 b/b
306 318 A c.copy
307 319 c
308 320 R b/b
321 R d
309 322 $ hg shelve -l --stat
310 323 wibble (*) wat (glob)
311 324 a/a | 1 +
312 325 1 files changed, 1 insertions(+), 0 deletions(-)
313 326
314 327 and now "a/a" should reappear
315 328
316 329 $ cd a
317 330 $ hg unshelve -q wibble
318 331 $ cd ..
319 332 $ hg status -C
320 333 M a/a
321 334 A b.rename/b
322 335 b/b
323 336 A c.copy
324 337 c
325 338 R b/b
339 R d
326 340
327 341 ensure old shelve backups are being deleted automatically
328 342
329 343 $ ls .hg/shelve-backup/
330 344 default-01.hg
331 345 default-01.patch
332 346 default-01.shelve
333 347 wibble.hg
334 348 wibble.patch
335 349 wibble.shelve
336 350
337 351 cause unshelving to result in a merge with 'a' conflicting
338 352
339 353 $ hg shelve -q
340 354 $ echo c>>a/a
341 355 $ hg commit -m second
342 356 $ hg tip --template '{files}\n'
343 357 a/a
344 358
345 359 add an unrelated change that should be preserved
346 360
347 361 $ mkdir foo
348 362 $ echo foo > foo/foo
349 363 $ hg add foo/foo
350 364
351 365 force a conflicted merge to occur
352 366
353 367 $ hg unshelve
354 368 unshelving change 'default'
355 369 temporarily committing pending changes (restore with 'hg unshelve --abort')
356 370 rebasing shelved changes
357 371 merging a/a
358 372 warning: conflicts while merging a/a! (edit, then use 'hg resolve --mark')
359 373 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
360 374 [1]
361 375 $ hg status -v
362 376 M a/a
363 377 M b.rename/b
364 378 M c.copy
365 379 R b/b
380 R d
366 381 ? a/a.orig
367 382 # The repository is in an unfinished *unshelve* state.
368 383
369 384 # Unresolved merge conflicts:
370 385 #
371 386 # a/a
372 387 #
373 388 # To mark files as resolved: hg resolve --mark FILE
374 389
375 390 # To continue: hg unshelve --continue
376 391 # To abort: hg unshelve --abort
377 392
378 393
379 394 ensure that we have a merge with unresolved conflicts
380 395
381 396 #if phasebased
382 397 $ hg heads -q --template '{rev}\n'
383 398 8
384 5
399 6
385 400 $ hg parents -q --template '{rev}\n'
386 401 8
387 5
402 6
388 403 #endif
389 404
390 405 #if stripbased
391 406 $ hg heads -q --template '{rev}\n'
392 407 5
393 408 4
394 409 $ hg parents -q --template '{rev}\n'
395 410 4
396 411 5
397 412 #endif
398 413
399 414 $ hg status
400 415 M a/a
401 416 M b.rename/b
402 417 M c.copy
403 418 R b/b
419 R d
404 420 ? a/a.orig
405 421 $ hg diff
406 422 diff --git a/a/a b/a/a
407 423 --- a/a/a
408 424 +++ b/a/a
409 425 @@ -1,2 +1,6 @@
410 426 a
411 427 +<<<<<<< shelve: 2377350b6337 - shelve: pending changes temporary commit
412 428 c
413 429 +=======
414 430 +a
415 +>>>>>>> working-copy: a68ec3400638 - shelve: changes to: [mq]: second.patch
431 +>>>>>>> working-copy: 203c9f771d2b - shelve: changes to: [mq]: second.patch
416 432 diff --git a/b/b b/b.rename/b
417 433 rename from b/b
418 434 rename to b.rename/b
419 435 diff --git a/c b/c.copy
420 436 copy from c
421 437 copy to c.copy
438 diff --git a/d b/d
439 deleted file mode 100644
440 --- a/d
441 +++ /dev/null
442 @@ -1,1 +0,0 @@
443 -d
422 444 $ hg resolve -l
423 445 U a/a
424 446
425 447 $ hg shelve
426 448 abort: unshelve already in progress
427 449 (use 'hg unshelve --continue' or 'hg unshelve --abort')
428 450 [255]
429 451
430 452 abort the unshelve and be happy
431 453
432 454 $ hg status
433 455 M a/a
434 456 M b.rename/b
435 457 M c.copy
436 458 R b/b
459 R d
437 460 ? a/a.orig
438 461 $ hg unshelve -a
439 462 unshelve of 'default' aborted
440 463 $ hg heads -q
441 464 [37]:2e69b451d1ea (re)
442 465 $ hg parents
443 466 changeset: [37]:2e69b451d1ea (re)
444 467 tag: tip
445 468 parent: 3:509104101065 (?)
446 469 user: test
447 470 date: Thu Jan 01 00:00:00 1970 +0000
448 471 summary: second
449 472
450 473 $ hg resolve -l
451 474 $ hg status
452 475 A foo/foo
453 476 ? a/a.orig
454 477
455 478 try to continue with no unshelve underway
456 479
457 480 $ hg unshelve -c
458 481 abort: no unshelve in progress
459 482 [255]
460 483 $ hg status
461 484 A foo/foo
462 485 ? a/a.orig
463 486
464 487 redo the unshelve to get a conflict
465 488
466 489 $ hg unshelve -q
467 490 warning: conflicts while merging a/a! (edit, then use 'hg resolve --mark')
468 491 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
469 492 [1]
470 493
471 494 attempt to continue
472 495
473 496 $ hg unshelve -c
474 497 abort: unresolved conflicts, can't continue
475 498 (see 'hg resolve', then 'hg unshelve --continue')
476 499 [255]
477 500
478 501 $ hg revert -r . a/a
479 502 $ hg resolve -m a/a
480 503 (no more unresolved files)
481 504 continue: hg unshelve --continue
482 505
483 506 $ hg commit -m 'commit while unshelve in progress'
484 507 abort: unshelve already in progress
485 508 (use 'hg unshelve --continue' or 'hg unshelve --abort')
486 509 [255]
487 510
488 511 $ hg graft --continue
489 512 abort: no graft in progress
490 513 (continue: hg unshelve --continue)
491 514 [255]
492 515 $ hg unshelve -c
493 516 unshelve of 'default' complete
494 517
495 518 ensure the repo is as we hope
496 519
497 520 $ hg parents
498 521 changeset: [37]:2e69b451d1ea (re)
499 522 tag: tip
500 523 parent: 3:509104101065 (?)
501 524 user: test
502 525 date: Thu Jan 01 00:00:00 1970 +0000
503 526 summary: second
504 527
505 528 $ hg heads -q
506 529 [37]:2e69b451d1ea (re)
507 530
508 531 $ hg status -C
509 532 A b.rename/b
510 533 b/b
511 534 A c.copy
512 535 c
513 536 A foo/foo
514 537 R b/b
538 R d
515 539 ? a/a.orig
516 540
517 541 there should be no shelves left
518 542
519 543 $ hg shelve -l
520 544
521 545 #if execbit
522 546
523 547 ensure that metadata-only changes are shelved
524 548
525 549 $ chmod +x a/a
526 550 $ hg shelve -q -n execbit a/a
527 551 $ hg status a/a
528 552 $ hg unshelve -q execbit
529 553 $ hg status a/a
530 554 M a/a
531 555 $ hg revert a/a
532 556
533 557 #else
534 558
535 559 Dummy shelve op, to keep rev numbers aligned
536 560
537 561 $ echo foo > a/a
538 562 $ hg shelve -q -n dummy a/a
539 563 $ hg unshelve -q dummy
540 564 $ hg revert a/a
541 565
542 566 #endif
543 567
544 568 #if symlink
545 569
546 570 $ rm a/a
547 571 $ ln -s foo a/a
548 572 $ hg shelve -q -n symlink a/a
549 573 $ hg status a/a
550 574 $ hg unshelve -q -n symlink
551 575 $ hg status a/a
552 576 M a/a
553 577 $ hg revert a/a
554 578
555 579 #else
556 580
557 581 Dummy shelve op, to keep rev numbers aligned
558 582
559 583 $ echo bar > a/a
560 584 $ hg shelve -q -n dummy a/a
561 585 $ hg unshelve -q dummy
562 586 $ hg revert a/a
563 587
564 588 #endif
565 589
566 590 set up another conflict between a commit and a shelved change
567 591
568 592 $ hg revert -q -C -a
569 593 $ rm a/a.orig b.rename/b c.copy
570 594 $ echo a >> a/a
571 595 $ hg shelve -q
572 596 $ echo x >> a/a
573 597 $ hg ci -m 'create conflict'
574 598 $ hg add foo/foo
575 599
576 600 if we resolve a conflict while unshelving, the unshelve should succeed
577 601
578 602 $ hg unshelve --tool :merge-other --keep
579 603 unshelving change 'default'
580 604 temporarily committing pending changes (restore with 'hg unshelve --abort')
581 605 rebasing shelved changes
582 606 merging a/a
583 607 $ hg parents -q
584 608 (4|13):33f7f61e6c5e (re)
585 609 $ hg shelve -l
586 610 default (*)* changes to: second (glob)
587 611 $ hg status
588 612 M a/a
589 613 A foo/foo
590 614 $ cat a/a
591 615 a
592 616 c
593 617 a
594 618 $ cat > a/a << EOF
595 619 > a
596 620 > c
597 621 > x
598 622 > EOF
599 623
600 624 $ HGMERGE=true hg unshelve
601 625 unshelving change 'default'
602 626 temporarily committing pending changes (restore with 'hg unshelve --abort')
603 627 rebasing shelved changes
604 628 merging a/a
605 629 note: unshelved changes already existed in the working copy
606 630 $ hg parents -q
607 631 (4|13):33f7f61e6c5e (re)
608 632 $ hg shelve -l
609 633 $ hg status
610 634 A foo/foo
611 635 $ cat a/a
612 636 a
613 637 c
614 638 x
615 639
616 640 test keep and cleanup
617 641
618 642 $ hg shelve
619 643 shelved as default
620 644 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
621 645 $ hg shelve --list
622 646 default (*)* changes to: create conflict (glob)
623 647 $ hg unshelve -k
624 648 unshelving change 'default'
625 649 $ hg shelve --list
626 650 default (*)* changes to: create conflict (glob)
627 651 $ hg shelve --cleanup
628 652 $ hg shelve --list
629 653
630 654 $ hg shelve --cleanup --delete
631 655 abort: options '--cleanup' and '--delete' may not be used together
632 656 [255]
633 657 $ hg shelve --cleanup --patch
634 658 abort: options '--cleanup' and '--patch' may not be used together
635 659 [255]
636 660 $ hg shelve --cleanup --message MESSAGE
637 661 abort: options '--cleanup' and '--message' may not be used together
638 662 [255]
639 663
640 664 test bookmarks
641 665
642 666 $ hg bookmark test
643 667 $ hg bookmark
644 668 \* test (4|13):33f7f61e6c5e (re)
645 669 $ hg shelve
646 670 shelved as test
647 671 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
648 672 $ hg bookmark
649 673 \* test (4|13):33f7f61e6c5e (re)
650 674 $ hg unshelve
651 675 unshelving change 'test'
652 676 $ hg bookmark
653 677 \* test (4|13):33f7f61e6c5e (re)
654 678
655 679 shelve should still work even if mq is disabled
656 680
657 681 $ hg --config extensions.mq=! shelve
658 682 shelved as test
659 683 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
660 684 $ hg --config extensions.mq=! shelve --list
661 685 test (*)* changes to: create conflict (glob)
662 686 $ hg bookmark
663 687 \* test (4|13):33f7f61e6c5e (re)
664 688 $ hg --config extensions.mq=! unshelve
665 689 unshelving change 'test'
666 690 $ hg bookmark
667 691 \* test (4|13):33f7f61e6c5e (re)
668 692
669 693 Recreate some conflict again
670 694
671 695 $ hg up -C -r 2e69b451d1ea
672 696 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
673 697 (leaving bookmark test)
674 698 $ echo y >> a/a
675 699 $ hg shelve
676 700 shelved as default
677 701 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
678 702 $ hg up test
679 703 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
680 704 (activating bookmark test)
681 705 $ hg bookmark
682 706 \* test (4|13):33f7f61e6c5e (re)
683 707 $ hg unshelve
684 708 unshelving change 'default'
685 709 rebasing shelved changes
686 710 merging a/a
687 711 warning: conflicts while merging a/a! (edit, then use 'hg resolve --mark')
688 712 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
689 713 [1]
690 714 $ hg bookmark
691 715 test (4|13):33f7f61e6c5e (re)
692 716
693 717 Test that resolving all conflicts in one direction (so that the rebase
694 718 is a no-op), works (issue4398)
695 719
696 720 $ hg revert -a -r .
697 721 reverting a/a
698 722 $ hg resolve -m a/a
699 723 (no more unresolved files)
700 724 continue: hg unshelve --continue
701 725 $ hg unshelve -c
702 726 note: unshelved changes already existed in the working copy
703 727 unshelve of 'default' complete
704 728 $ hg bookmark
705 729 \* test (4|13):33f7f61e6c5e (re)
706 730 $ hg diff
707 731 $ hg status
708 732 ? a/a.orig
709 733 ? foo/foo
710 734 $ hg summary
711 735 parent: (4|13):33f7f61e6c5e tip (re)
712 736 create conflict
713 737 branch: default
714 738 bookmarks: *test
715 739 commit: 2 unknown (clean)
716 740 update: (current)
717 741 phases: 5 draft
718 742
719 743 $ hg shelve --delete --stat
720 744 abort: options '--delete' and '--stat' may not be used together
721 745 [255]
722 746 $ hg shelve --delete --name NAME
723 747 abort: options '--delete' and '--name' may not be used together
724 748 [255]
725 749
726 750 Test interactive shelve
727 751 $ cat <<EOF >> $HGRCPATH
728 752 > [ui]
729 753 > interactive = true
730 754 > EOF
731 755 $ echo 'a' >> a/b
732 756 $ cat a/a >> a/b
733 757 $ echo 'x' >> a/b
734 758 $ mv a/b a/a
735 759 $ echo 'a' >> foo/foo
736 760 $ hg st
737 761 M a/a
738 762 ? a/a.orig
739 763 ? foo/foo
740 764 $ cat a/a
741 765 a
742 766 a
743 767 c
744 768 x
745 769 x
746 770 $ cat foo/foo
747 771 foo
748 772 a
749 773 $ hg shelve --interactive --config ui.interactive=false
750 774 abort: running non-interactively
751 775 [255]
752 776 $ hg shelve --interactive << EOF
753 777 > y
754 778 > y
755 779 > n
756 780 > EOF
757 781 diff --git a/a/a b/a/a
758 782 2 hunks, 2 lines changed
759 783 examine changes to 'a/a'?
760 784 (enter ? for help) [Ynesfdaq?] y
761 785
762 786 @@ -1,3 +1,4 @@
763 787 +a
764 788 a
765 789 c
766 790 x
767 791 record change 1/2 to 'a/a'?
768 792 (enter ? for help) [Ynesfdaq?] y
769 793
770 794 @@ -1,3 +2,4 @@
771 795 a
772 796 c
773 797 x
774 798 +x
775 799 record change 2/2 to 'a/a'?
776 800 (enter ? for help) [Ynesfdaq?] n
777 801
778 802 shelved as test
779 803 merging a/a
780 804 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
781 805 $ cat a/a
782 806 a
783 807 c
784 808 x
785 809 x
786 810 $ cat foo/foo
787 811 foo
788 812 a
789 813 $ hg st
790 814 M a/a
791 815 ? foo/foo
792 816 $ hg bookmark
793 817 \* test (4|13):33f7f61e6c5e (re)
794 818 $ hg unshelve
795 819 unshelving change 'test'
796 820 temporarily committing pending changes (restore with 'hg unshelve --abort')
797 821 rebasing shelved changes
798 822 merging a/a
799 823 $ hg bookmark
800 824 \* test (4|13):33f7f61e6c5e (re)
801 825 $ cat a/a
802 826 a
803 827 a
804 828 c
805 829 x
806 830 x
807 831
808 832 shelve --patch and shelve --stat should work with valid shelfnames
809 833
810 834 $ hg up --clean .
811 835 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
812 836 (leaving bookmark test)
813 837 $ hg shelve --list
814 838 $ echo 'patch a' > shelf-patch-a
815 839 $ hg add shelf-patch-a
816 840 $ hg shelve
817 841 shelved as default
818 842 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
819 843 $ echo 'patch b' > shelf-patch-b
820 844 $ hg add shelf-patch-b
821 845 $ hg shelve
822 846 shelved as default-01
823 847 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
824 848 $ hg shelve --patch default default-01
825 849 default-01 (*)* changes to: create conflict (glob)
826 850
827 851 diff --git a/shelf-patch-b b/shelf-patch-b
828 852 new file mode 100644
829 853 --- /dev/null
830 854 +++ b/shelf-patch-b
831 855 @@ -0,0 +1,1 @@
832 856 +patch b
833 857 default (*)* changes to: create conflict (glob)
834 858
835 859 diff --git a/shelf-patch-a b/shelf-patch-a
836 860 new file mode 100644
837 861 --- /dev/null
838 862 +++ b/shelf-patch-a
839 863 @@ -0,0 +1,1 @@
840 864 +patch a
841 865 $ hg shelve --stat default default-01
842 866 default-01 (*)* changes to: create conflict (glob)
843 867 shelf-patch-b | 1 +
844 868 1 files changed, 1 insertions(+), 0 deletions(-)
845 869 default (*)* changes to: create conflict (glob)
846 870 shelf-patch-a | 1 +
847 871 1 files changed, 1 insertions(+), 0 deletions(-)
848 872 $ hg shelve --patch default
849 873 default (*)* changes to: create conflict (glob)
850 874
851 875 diff --git a/shelf-patch-a b/shelf-patch-a
852 876 new file mode 100644
853 877 --- /dev/null
854 878 +++ b/shelf-patch-a
855 879 @@ -0,0 +1,1 @@
856 880 +patch a
857 881 $ hg shelve --stat default
858 882 default (*)* changes to: create conflict (glob)
859 883 shelf-patch-a | 1 +
860 884 1 files changed, 1 insertions(+), 0 deletions(-)
861 885 $ hg shelve --patch nonexistentshelf
862 886 abort: cannot find shelf nonexistentshelf
863 887 [255]
864 888 $ hg shelve --stat nonexistentshelf
865 889 abort: cannot find shelf nonexistentshelf
866 890 [255]
867 891 $ hg shelve --patch default nonexistentshelf
868 892 abort: cannot find shelf nonexistentshelf
869 893 [255]
870 894
871 895 when the user asks for a patch, we assume they want the most recent shelve if
872 896 they don't provide a shelve name
873 897
874 898 $ hg shelve --patch
875 899 default-01 (*)* changes to: create conflict (glob)
876 900
877 901 diff --git a/shelf-patch-b b/shelf-patch-b
878 902 new file mode 100644
879 903 --- /dev/null
880 904 +++ b/shelf-patch-b
881 905 @@ -0,0 +1,1 @@
882 906 +patch b
883 907
884 908 $ cd ..
885 909
886 910 Shelve from general delta repo uses bundle2 on disk
887 911 --------------------------------------------------
888 912
889 913 no general delta
890 914
891 915 $ hg clone --pull repo bundle1 --config format.usegeneraldelta=0
892 916 requesting all changes
893 917 adding changesets
894 918 adding manifests
895 919 adding file changes
896 920 added 5 changesets with 8 changes to 6 files
897 921 new changesets cc01e2b0c59f:33f7f61e6c5e
898 922 updating to branch default
899 923 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
900 924 $ cd bundle1
901 925 $ echo babar > jungle
902 926 $ hg add jungle
903 927 $ hg shelve
904 928 shelved as default
905 929 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
906 930 $ hg debugbundle .hg/shelved/*.hg
907 931 330882a04d2ce8487636b1fb292e5beea77fa1e3
908 932 $ cd ..
909 933
910 934 with general delta
911 935
912 936 $ hg clone --pull repo bundle2 --config format.usegeneraldelta=1
913 937 requesting all changes
914 938 adding changesets
915 939 adding manifests
916 940 adding file changes
917 941 added 5 changesets with 8 changes to 6 files
918 942 new changesets cc01e2b0c59f:33f7f61e6c5e
919 943 updating to branch default
920 944 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
921 945 $ cd bundle2
922 946 $ echo babar > jungle
923 947 $ hg add jungle
924 948 $ hg shelve
925 949 shelved as default
926 950 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
927 951 $ hg debugbundle .hg/shelved/*.hg
928 952 Stream params: {Compression: BZ}
929 953 changegroup -- {nbchanges: 1, version: 02} (mandatory: True)
930 954 330882a04d2ce8487636b1fb292e5beea77fa1e3
931 955
932 956 Test shelve --keep
933 957
934 958 $ hg unshelve
935 959 unshelving change 'default'
936 960 $ hg shelve --keep --list
937 961 abort: options '--list' and '--keep' may not be used together
938 962 [255]
939 963 $ hg shelve --keep --patch
940 964 abort: options '--patch' and '--keep' may not be used together
941 965 [255]
942 966 $ hg shelve --keep --delete
943 967 abort: options '--delete' and '--keep' may not be used together
944 968 [255]
945 969 $ hg shelve --keep
946 970 shelved as default
947 971 $ hg diff
948 972 diff --git a/jungle b/jungle
949 973 new file mode 100644
950 974 --- /dev/null
951 975 +++ b/jungle
952 976 @@ -0,0 +1,1 @@
953 977 +babar
954 978
955 979 Test shelve --delete
956 980
957 981 $ hg shelve --list
958 982 default (*s ago) changes to: create conflict (glob)
959 983 $ hg shelve --delete doesnotexist
960 984 abort: shelved change 'doesnotexist' not found
961 985 [255]
962 986 $ hg shelve --delete default
963 987
964 988 $ cd ..
965 989
966 990 Test visibility of in-memory changes inside transaction to external hook
967 991 ------------------------------------------------------------------------
968 992
969 993 $ cd repo
970 994
971 995 $ echo xxxx >> x
972 996 $ hg commit -m "#5: changes to invoke rebase"
973 997
974 998 $ cat > $TESTTMP/checkvisibility.sh <<EOF
975 999 > echo "==== \$1:"
976 1000 > hg parents --template "VISIBLE {rev}:{node|short}\n"
977 1001 > # test that pending changes are hidden
978 1002 > unset HG_PENDING
979 1003 > hg parents --template "ACTUAL {rev}:{node|short}\n"
980 1004 > echo "===="
981 1005 > EOF
982 1006
983 1007 $ cat >> .hg/hgrc <<EOF
984 1008 > [defaults]
985 1009 > # to fix hash id of temporary revisions
986 1010 > unshelve = --date '0 0'
987 1011 > EOF
988 1012
989 1013 "hg unshelve" at REV5 implies steps below:
990 1014
991 1015 (1) commit changes in the working directory (REV6)
992 1016 (2) unbundle shelved revision (REV7)
993 1017 (3) rebase: merge REV7 into REV6 (REV6 => REV6, REV7)
994 1018 (4) rebase: commit merged revision (REV8)
995 1019 (5) rebase: update to REV6 (REV8 => REV6)
996 1020 (6) update to REV5 (REV6 => REV5)
997 1021 (7) abort transaction
998 1022
999 1023 == test visibility to external preupdate hook
1000 1024
1001 1025 $ cat >> .hg/hgrc <<EOF
1002 1026 > [hooks]
1003 1027 > preupdate.visibility = sh $TESTTMP/checkvisibility.sh preupdate
1004 1028 > EOF
1005 1029
1006 1030 $ echo nnnn >> n
1007 1031
1008 1032 $ sh $TESTTMP/checkvisibility.sh before-unshelving
1009 1033 ==== before-unshelving:
1010 1034 VISIBLE (5|19):703117a2acfb (re)
1011 1035 ACTUAL (5|19):703117a2acfb (re)
1012 1036 ====
1013 1037
1014 1038 $ hg unshelve --keep default
1015 1039 temporarily committing pending changes (restore with 'hg unshelve --abort')
1016 1040 rebasing shelved changes
1017 1041 ==== preupdate:
1018 1042 VISIBLE (6|20):54c00d20fb3f (re)
1019 1043 ACTUAL (5|19):703117a2acfb (re)
1020 1044 ====
1021 1045 ==== preupdate:
1022 1046 VISIBLE (8|21):8efe6f7537dc (re)
1023 1047 ACTUAL (5|19):703117a2acfb (re)
1024 1048 ====
1025 1049 ==== preupdate:
1026 1050 VISIBLE (6|20):54c00d20fb3f (re)
1027 1051 ACTUAL (5|19):703117a2acfb (re)
1028 1052 ====
1029 1053
1030 1054 $ cat >> .hg/hgrc <<EOF
1031 1055 > [hooks]
1032 1056 > preupdate.visibility =
1033 1057 > EOF
1034 1058
1035 1059 $ sh $TESTTMP/checkvisibility.sh after-unshelving
1036 1060 ==== after-unshelving:
1037 1061 VISIBLE (5|19):703117a2acfb (re)
1038 1062 ACTUAL (5|19):703117a2acfb (re)
1039 1063 ====
1040 1064
1041 1065 == test visibility to external update hook
1042 1066
1043 1067 $ hg update -q -C 703117a2acfb
1044 1068
1045 1069 $ cat >> .hg/hgrc <<EOF
1046 1070 > [hooks]
1047 1071 > update.visibility = sh $TESTTMP/checkvisibility.sh update
1048 1072 > EOF
1049 1073
1050 1074 $ echo nnnn >> n
1051 1075
1052 1076 $ sh $TESTTMP/checkvisibility.sh before-unshelving
1053 1077 ==== before-unshelving:
1054 1078 VISIBLE (5|19):703117a2acfb (re)
1055 1079 ACTUAL (5|19):703117a2acfb (re)
1056 1080 ====
1057 1081
1058 1082 $ hg unshelve --keep default
1059 1083 temporarily committing pending changes (restore with 'hg unshelve --abort')
1060 1084 rebasing shelved changes
1061 1085 ==== update:
1062 1086 VISIBLE (6|20):54c00d20fb3f (re)
1063 1087 VISIBLE 1?7:492ed9d705e5 (re)
1064 1088 ACTUAL (5|19):703117a2acfb (re)
1065 1089 ====
1066 1090 ==== update:
1067 1091 VISIBLE (6|20):54c00d20fb3f (re)
1068 1092 ACTUAL (5|19):703117a2acfb (re)
1069 1093 ====
1070 1094 ==== update:
1071 1095 VISIBLE (5|19):703117a2acfb (re)
1072 1096 ACTUAL (5|19):703117a2acfb (re)
1073 1097 ====
1074 1098
1075 1099 $ cat >> .hg/hgrc <<EOF
1076 1100 > [hooks]
1077 1101 > update.visibility =
1078 1102 > EOF
1079 1103
1080 1104 $ sh $TESTTMP/checkvisibility.sh after-unshelving
1081 1105 ==== after-unshelving:
1082 1106 VISIBLE (5|19):703117a2acfb (re)
1083 1107 ACTUAL (5|19):703117a2acfb (re)
1084 1108 ====
1085 1109
1086 1110 $ cd ..
1087 1111
1088 1112 Keep active bookmark while (un)shelving even on shared repo (issue4940)
1089 1113 -----------------------------------------------------------------------
1090 1114
1091 1115 $ cat <<EOF >> $HGRCPATH
1092 1116 > [extensions]
1093 1117 > share =
1094 1118 > EOF
1095 1119
1096 1120 $ hg bookmarks -R repo
1097 1121 test (4|13):33f7f61e6c5e (re)
1098 1122 $ hg share -B repo share
1099 1123 updating working directory
1100 1124 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
1101 1125 $ cd share
1102 1126
1103 1127 $ hg bookmarks
1104 1128 test (4|13):33f7f61e6c5e (re)
1105 1129 $ hg bookmarks foo
1106 1130 $ hg bookmarks
1107 1131 \* foo (5|19):703117a2acfb (re)
1108 1132 test (4|13):33f7f61e6c5e (re)
1109 1133 $ echo x >> x
1110 1134 $ hg shelve
1111 1135 shelved as foo
1112 1136 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1113 1137 $ hg bookmarks
1114 1138 \* foo (5|19):703117a2acfb (re)
1115 1139 test (4|13):33f7f61e6c5e (re)
1116 1140
1117 1141 $ hg unshelve
1118 1142 unshelving change 'foo'
1119 1143 $ hg bookmarks
1120 1144 \* foo (5|19):703117a2acfb (re)
1121 1145 test (4|13):33f7f61e6c5e (re)
1122 1146
1123 1147 $ cd ..
1124 1148
1125 1149 Abort unshelve while merging (issue5123)
1126 1150 ----------------------------------------
1127 1151
1128 1152 $ hg init issue5123
1129 1153 $ cd issue5123
1130 1154 $ echo > a
1131 1155 $ hg ci -Am a
1132 1156 adding a
1133 1157 $ hg co null
1134 1158 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1135 1159 $ echo > b
1136 1160 $ hg ci -Am b
1137 1161 adding b
1138 1162 created new head
1139 1163 $ echo > c
1140 1164 $ hg add c
1141 1165 $ hg shelve
1142 1166 shelved as default
1143 1167 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1144 1168 $ hg co 1
1145 1169 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1146 1170 $ hg merge 0
1147 1171 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1148 1172 (branch merge, don't forget to commit)
1149 1173 -- successful merge with two parents
1150 1174 $ hg log -G
1151 1175 @ changeset: 1:406bf70c274f
1152 1176 tag: tip
1153 1177 parent: -1:000000000000
1154 1178 user: test
1155 1179 date: Thu Jan 01 00:00:00 1970 +0000
1156 1180 summary: b
1157 1181
1158 1182 @ changeset: 0:ada8c9eb8252
1159 1183 user: test
1160 1184 date: Thu Jan 01 00:00:00 1970 +0000
1161 1185 summary: a
1162 1186
1163 1187 -- trying to pull in the shelve bits
1164 1188 -- unshelve should abort otherwise, it'll eat my second parent.
1165 1189 $ hg unshelve
1166 1190 abort: outstanding uncommitted merge
1167 1191 (use 'hg commit' or 'hg merge --abort')
1168 1192 [255]
1169 1193
1170 1194 $ cd ..
1171 1195
1172 1196 -- test for interactive mode on unshelve
1173 1197
1174 1198 $ hg init a
1175 1199 $ cd a
1176 1200 $ echo > b
1177 1201 $ hg ci -Am b
1178 1202 adding b
1179 1203 $ echo > c
1180 1204 $ echo > d
1181 1205 $ hg add .
1182 1206 adding c
1183 1207 adding d
1184 1208 $ hg shelve
1185 1209 shelved as default
1186 1210 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1187 1211 $ echo > e
1188 1212 $ hg add e
1189 1213 $ hg ci -m e
1190 1214 $ hg shelve --patch
1191 1215 default (*s ago) changes to: b (glob)
1192 1216
1193 1217 diff --git a/c b/c
1194 1218 new file mode 100644
1195 1219 --- /dev/null
1196 1220 +++ b/c
1197 1221 @@ -0,0 +1,1 @@
1198 1222 +
1199 1223 diff --git a/d b/d
1200 1224 new file mode 100644
1201 1225 --- /dev/null
1202 1226 +++ b/d
1203 1227 @@ -0,0 +1,1 @@
1204 1228 +
1205 1229 $ hg unshelve -i <<EOF
1206 1230 > y
1207 1231 > y
1208 1232 > y
1209 1233 > n
1210 1234 > EOF
1211 1235 unshelving change 'default'
1212 1236 rebasing shelved changes
1213 1237 diff --git a/c b/c
1214 1238 new file mode 100644
1215 1239 examine changes to 'c'?
1216 1240 (enter ? for help) [Ynesfdaq?] y
1217 1241
1218 1242 @@ -0,0 +1,1 @@
1219 1243 +
1220 1244 record change 1/2 to 'c'?
1221 1245 (enter ? for help) [Ynesfdaq?] y
1222 1246
1223 1247 diff --git a/d b/d
1224 1248 new file mode 100644
1225 1249 examine changes to 'd'?
1226 1250 (enter ? for help) [Ynesfdaq?] y
1227 1251
1228 1252 @@ -0,0 +1,1 @@
1229 1253 +
1230 1254 record change 2/2 to 'd'?
1231 1255 (enter ? for help) [Ynesfdaq?] n
1232 1256
1233 1257 $ ls
1234 1258 b
1235 1259 c
1236 1260 e
1237 1261 -- shelve should not contain `c` now
1238 1262 $ hg shelve --patch
1239 1263 default (*s ago) changes to: b (glob)
1240 1264
1241 1265 diff --git a/d b/d
1242 1266 new file mode 100644
1243 1267 --- /dev/null
1244 1268 +++ b/d
1245 1269 @@ -0,0 +1,1 @@
1246 1270 +
1247 1271 $ hg unshelve -i <<EOF
1248 1272 > y
1249 1273 > y
1250 1274 > EOF
1251 1275 unshelving change 'default'
1252 1276 temporarily committing pending changes (restore with 'hg unshelve --abort')
1253 1277 rebasing shelved changes
1254 1278 diff --git a/d b/d
1255 1279 new file mode 100644
1256 1280 examine changes to 'd'?
1257 1281 (enter ? for help) [Ynesfdaq?] y
1258 1282
1259 1283 @@ -0,0 +1,1 @@
1260 1284 +
1261 1285 record this change to 'd'?
1262 1286 (enter ? for help) [Ynesfdaq?] y
1263 1287
1264 1288
1265 1289 $ hg status -v
1266 1290 A c
1267 1291 A d
1268 1292 $ ls
1269 1293 b
1270 1294 c
1271 1295 d
1272 1296 e
1273 1297 $ hg shelve --list
1274 1298
1275 1299 -- now, unshelve selected changes from a file
1276 1300
1277 1301 $ echo B > foo
1278 1302 $ hg add foo
1279 1303 $ hg ci -m 'add B to foo'
1280 1304 $ cat > foo <<EOF
1281 1305 > A
1282 1306 > B
1283 1307 > C
1284 1308 > EOF
1285 1309 $ echo > garbage
1286 1310 $ hg st
1287 1311 M foo
1288 1312 ? garbage
1289 1313 $ hg shelve --unknown
1290 1314 shelved as default
1291 1315 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1292 1316 $ cat foo
1293 1317 B
1294 1318 $ hg unshelve -i <<EOF
1295 1319 > y
1296 1320 > y
1297 1321 > n
1298 1322 > y
1299 1323 > y
1300 1324 > EOF
1301 1325 unshelving change 'default'
1302 1326 rebasing shelved changes
1303 1327 diff --git a/foo b/foo
1304 1328 2 hunks, 2 lines changed
1305 1329 examine changes to 'foo'?
1306 1330 (enter ? for help) [Ynesfdaq?] y
1307 1331
1308 1332 @@ -1,1 +1,2 @@
1309 1333 +A
1310 1334 B
1311 1335 record change 1/3 to 'foo'?
1312 1336 (enter ? for help) [Ynesfdaq?] y
1313 1337
1314 1338 @@ -1,1 +2,2 @@
1315 1339 B
1316 1340 +C
1317 1341 record change 2/3 to 'foo'?
1318 1342 (enter ? for help) [Ynesfdaq?] n
1319 1343
1320 1344 diff --git a/garbage b/garbage
1321 1345 new file mode 100644
1322 1346 examine changes to 'garbage'?
1323 1347 (enter ? for help) [Ynesfdaq?] y
1324 1348
1325 1349 @@ -0,0 +1,1 @@
1326 1350 +
1327 1351 record change 3/3 to 'garbage'?
1328 1352 (enter ? for help) [Ynesfdaq?] y
1329 1353
1330 1354 $ hg st
1331 1355 M foo
1332 1356 ? garbage
1333 1357 $ cat foo
1334 1358 A
1335 1359 B
1336 1360 $ hg shelve --patch
1337 1361 default (*s ago) changes to: add B to foo (glob)
1338 1362
1339 1363 diff --git a/foo b/foo
1340 1364 --- a/foo
1341 1365 +++ b/foo
1342 1366 @@ -1,2 +1,3 @@
1343 1367 A
1344 1368 B
1345 1369 +C
1346 1370
1347 1371 -- unshelve interactive on conflicts
1348 1372
1349 1373 $ echo A >> bar1
1350 1374 $ echo A >> bar2
1351 1375 $ hg add bar1 bar2
1352 1376 $ hg ci -m 'add A to bars'
1353 1377 $ echo B >> bar1
1354 1378 $ echo B >> bar2
1355 1379 $ hg shelve
1356 1380 shelved as default-01
1357 1381 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1358 1382 $ echo C >> bar1
1359 1383 $ echo C >> bar2
1360 1384 $ hg ci -m 'add C to bars'
1361 1385 $ hg unshelve -i
1362 1386 unshelving change 'default-01'
1363 1387 rebasing shelved changes
1364 1388 merging bar1
1365 1389 merging bar2
1366 1390 warning: conflicts while merging bar1! (edit, then use 'hg resolve --mark')
1367 1391 warning: conflicts while merging bar2! (edit, then use 'hg resolve --mark')
1368 1392 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
1369 1393 [1]
1370 1394
1371 1395 $ cat > bar1 <<EOF
1372 1396 > A
1373 1397 > B
1374 1398 > C
1375 1399 > EOF
1376 1400 $ cat > bar2 <<EOF
1377 1401 > A
1378 1402 > B
1379 1403 > C
1380 1404 > EOF
1381 1405 $ hg resolve -m bar1 bar2
1382 1406 (no more unresolved files)
1383 1407 continue: hg unshelve --continue
1384 1408
1385 1409 -- using --continue with --interactive should throw an error
1386 1410 $ hg unshelve --continue -i
1387 1411 abort: cannot use both continue and interactive
1388 1412 [255]
1389 1413
1390 1414 $ cat bar1
1391 1415 A
1392 1416 B
1393 1417 C
1394 1418
1395 1419 #if stripbased
1396 1420 $ hg log -r 3:: -G
1397 1421 @ changeset: 5:f1d5f53e397b
1398 1422 | tag: tip
1399 1423 | parent: 3:e28fd7fa7938
1400 1424 | user: shelve@localhost
1401 1425 | date: Thu Jan 01 00:00:00 1970 +0000
1402 1426 | summary: changes to: add A to bars
1403 1427 |
1404 1428 | @ changeset: 4:fe451a778c81
1405 1429 |/ user: test
1406 1430 | date: Thu Jan 01 00:00:00 1970 +0000
1407 1431 | summary: add C to bars
1408 1432 |
1409 1433 o changeset: 3:e28fd7fa7938
1410 1434 | user: test
1411 1435 ~ date: Thu Jan 01 00:00:00 1970 +0000
1412 1436 summary: add A to bars
1413 1437
1414 1438 #endif
1415 1439
1416 1440 $ hg unshelve --continue <<EOF
1417 1441 > y
1418 1442 > y
1419 1443 > y
1420 1444 > n
1421 1445 > EOF
1422 1446 diff --git a/bar1 b/bar1
1423 1447 1 hunks, 1 lines changed
1424 1448 examine changes to 'bar1'?
1425 1449 (enter ? for help) [Ynesfdaq?] y
1426 1450
1427 1451 @@ -1,2 +1,3 @@
1428 1452 A
1429 1453 +B
1430 1454 C
1431 1455 record change 1/2 to 'bar1'?
1432 1456 (enter ? for help) [Ynesfdaq?] y
1433 1457
1434 1458 diff --git a/bar2 b/bar2
1435 1459 1 hunks, 1 lines changed
1436 1460 examine changes to 'bar2'?
1437 1461 (enter ? for help) [Ynesfdaq?] y
1438 1462
1439 1463 @@ -1,2 +1,3 @@
1440 1464 A
1441 1465 +B
1442 1466 C
1443 1467 record change 2/2 to 'bar2'?
1444 1468 (enter ? for help) [Ynesfdaq?] n
1445 1469
1446 1470 unshelve of 'default-01' complete
1447 1471
1448 1472 #if stripbased
1449 1473 $ hg log -r 3:: -G
1450 1474 @ changeset: 4:fe451a778c81
1451 1475 | tag: tip
1452 1476 | user: test
1453 1477 | date: Thu Jan 01 00:00:00 1970 +0000
1454 1478 | summary: add C to bars
1455 1479 |
1456 1480 o changeset: 3:e28fd7fa7938
1457 1481 | user: test
1458 1482 ~ date: Thu Jan 01 00:00:00 1970 +0000
1459 1483 summary: add A to bars
1460 1484
1461 1485 #endif
1462 1486
1463 1487 $ hg unshelve --continue
1464 1488 abort: no unshelve in progress
1465 1489 [255]
1466 1490
1467 1491 $ hg shelve --list
1468 1492 default-01 (*)* changes to: add A to bars (glob)
1469 1493 default (*)* changes to: add B to foo (glob)
1470 1494 $ hg unshelve -n default-01 -i <<EOF
1471 1495 > y
1472 1496 > y
1473 1497 > EOF
1474 1498 temporarily committing pending changes (restore with 'hg unshelve --abort')
1475 1499 rebasing shelved changes
1476 1500 diff --git a/bar2 b/bar2
1477 1501 1 hunks, 1 lines changed
1478 1502 examine changes to 'bar2'?
1479 1503 (enter ? for help) [Ynesfdaq?] y
1480 1504
1481 1505 @@ -1,2 +1,3 @@
1482 1506 A
1483 1507 +B
1484 1508 C
1485 1509 record this change to 'bar2'?
1486 1510 (enter ? for help) [Ynesfdaq?] y
1487 1511
1488 1512 -- test for --interactive --keep
1489 1513 $ hg unshelve -i --keep
1490 1514 abort: --keep on --interactive is not yet supported
1491 1515 [255]
General Comments 0
You need to be logged in to leave comments. Login now