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