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