Show More
This diff has been collapsed as it changes many lines, (815 lines changed) Show them Hide them | |||||
@@ -668,269 +668,8 b' shelve should still work even if mq is d' | |||||
668 | $ hg bookmark |
|
668 | $ hg bookmark | |
669 | \* test (4|13):33f7f61e6c5e (re) |
|
669 | \* test (4|13):33f7f61e6c5e (re) | |
670 |
|
670 | |||
671 | shelve should leave dirstate clean (issue4055) |
|
|||
672 |
|
||||
673 | $ cd .. |
|
|||
674 | $ hg init shelverebase |
|
|||
675 | $ cd shelverebase |
|
|||
676 | $ printf 'x\ny\n' > x |
|
|||
677 | $ echo z > z |
|
|||
678 | $ hg commit -Aqm xy |
|
|||
679 | $ echo z >> x |
|
|||
680 | $ hg commit -Aqm z |
|
|||
681 | $ hg up 5c4c67fb7dce |
|
|||
682 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
683 | $ printf 'a\nx\ny\nz\n' > x |
|
|||
684 | $ hg commit -Aqm xyz |
|
|||
685 | $ echo c >> z |
|
|||
686 | $ hg shelve |
|
|||
687 | shelved as default |
|
|||
688 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
689 |
|
||||
690 | $ hg rebase -d 6c103be8f4e4 --config extensions.rebase= |
|
|||
691 | rebasing 2:323bfa07f744 "xyz"( \(tip\))? (re) |
|
|||
692 | merging x |
|
|||
693 | saved backup bundle to \$TESTTMP/shelverebase/.hg/strip-backup/323bfa07f744-(78114325|7ae538ef)-rebase.hg (re) |
|
|||
694 | $ hg unshelve |
|
|||
695 | unshelving change 'default' |
|
|||
696 | rebasing shelved changes |
|
|||
697 | $ hg status |
|
|||
698 | M z |
|
|||
699 |
|
||||
700 | $ cd .. |
|
|||
701 |
|
||||
702 | shelve should only unshelve pending changes (issue4068) |
|
|||
703 |
|
||||
704 | $ hg init onlypendingchanges |
|
|||
705 | $ cd onlypendingchanges |
|
|||
706 | $ touch a |
|
|||
707 | $ hg ci -Aqm a |
|
|||
708 | $ touch b |
|
|||
709 | $ hg ci -Aqm b |
|
|||
710 | $ hg up -q 3903775176ed |
|
|||
711 | $ touch c |
|
|||
712 | $ hg ci -Aqm c |
|
|||
713 |
|
||||
714 | $ touch d |
|
|||
715 | $ hg add d |
|
|||
716 | $ hg shelve |
|
|||
717 | shelved as default |
|
|||
718 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
|||
719 | $ hg up -q 0e067c57feba |
|
|||
720 | $ hg unshelve |
|
|||
721 | unshelving change 'default' |
|
|||
722 | rebasing shelved changes |
|
|||
723 | $ hg status |
|
|||
724 | A d |
|
|||
725 |
|
||||
726 | unshelve should work on an ancestor of the original commit |
|
|||
727 |
|
||||
728 | $ hg shelve |
|
|||
729 | shelved as default |
|
|||
730 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
|||
731 | $ hg up 3903775176ed |
|
|||
732 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
|||
733 | $ hg unshelve |
|
|||
734 | unshelving change 'default' |
|
|||
735 | rebasing shelved changes |
|
|||
736 | $ hg status |
|
|||
737 | A d |
|
|||
738 |
|
||||
739 | test bug 4073 we need to enable obsolete markers for it |
|
|||
740 |
|
||||
741 | $ cat >> $HGRCPATH << EOF |
|
|||
742 | > [experimental] |
|
|||
743 | > evolution.createmarkers=True |
|
|||
744 | > EOF |
|
|||
745 | $ hg shelve |
|
|||
746 | shelved as default |
|
|||
747 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
|||
748 | $ hg debugobsolete `hg log -r 0e067c57feba -T '{node}'` |
|
|||
749 | obsoleted 1 changesets |
|
|||
750 | $ hg unshelve |
|
|||
751 | unshelving change 'default' |
|
|||
752 |
|
||||
753 | unshelve should leave unknown files alone (issue4113) |
|
|||
754 |
|
||||
755 | $ echo e > e |
|
|||
756 | $ hg shelve |
|
|||
757 | shelved as default |
|
|||
758 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
|||
759 | $ hg status |
|
|||
760 | ? e |
|
|||
761 | $ hg unshelve |
|
|||
762 | unshelving change 'default' |
|
|||
763 | $ hg status |
|
|||
764 | A d |
|
|||
765 | ? e |
|
|||
766 | $ cat e |
|
|||
767 | e |
|
|||
768 |
|
||||
769 | unshelve should keep a copy of unknown files |
|
|||
770 |
|
||||
771 | $ hg add e |
|
|||
772 | $ hg shelve |
|
|||
773 | shelved as default |
|
|||
774 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
|||
775 | $ echo z > e |
|
|||
776 | $ hg unshelve |
|
|||
777 | unshelving change 'default' |
|
|||
778 | $ cat e |
|
|||
779 | e |
|
|||
780 | $ cat e.orig |
|
|||
781 | z |
|
|||
782 |
|
||||
783 |
|
||||
784 | unshelve and conflicts with tracked and untracked files |
|
|||
785 |
|
||||
786 | preparing: |
|
|||
787 |
|
||||
788 | $ rm *.orig |
|
|||
789 | $ hg ci -qm 'commit stuff' |
|
|||
790 | $ hg phase -p null: |
|
|||
791 |
|
||||
792 | no other changes - no merge: |
|
|||
793 |
|
||||
794 | $ echo f > f |
|
|||
795 | $ hg add f |
|
|||
796 | $ hg shelve |
|
|||
797 | shelved as default |
|
|||
798 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
|||
799 | $ echo g > f |
|
|||
800 | $ hg unshelve |
|
|||
801 | unshelving change 'default' |
|
|||
802 | $ hg st |
|
|||
803 | A f |
|
|||
804 | ? f.orig |
|
|||
805 | $ cat f |
|
|||
806 | f |
|
|||
807 | $ cat f.orig |
|
|||
808 | g |
|
|||
809 |
|
||||
810 | other uncommitted changes - merge: |
|
|||
811 |
|
||||
812 | $ hg st |
|
|||
813 | A f |
|
|||
814 | ? f.orig |
|
|||
815 | $ hg shelve |
|
|||
816 | shelved as default |
|
|||
817 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
|||
818 | #if repobundlerepo |
|
|||
819 | $ hg log -G --template '{rev} {desc|firstline} {author}' -R bundle://.hg/shelved/default.hg -r 'bundle()' --hidden |
|
|||
820 | o [48] changes to: commit stuff shelve@localhost (re) |
|
|||
821 | | |
|
|||
822 | ~ |
|
|||
823 | #endif |
|
|||
824 | $ hg log -G --template '{rev} {desc|firstline} {author}' |
|
|||
825 | @ [37] commit stuff test (re) |
|
|||
826 | | |
|
|||
827 | | o 2 c test |
|
|||
828 | |/ |
|
|||
829 | o 0 a test |
|
|||
830 |
|
||||
831 | $ mv f.orig f |
|
|||
832 | $ echo 1 > a |
|
|||
833 | $ hg unshelve --date '1073741824 0' |
|
|||
834 | unshelving change 'default' |
|
|||
835 | temporarily committing pending changes (restore with 'hg unshelve --abort') |
|
|||
836 | rebasing shelved changes |
|
|||
837 | merging f |
|
|||
838 | warning: conflicts while merging f! (edit, then use 'hg resolve --mark') |
|
|||
839 | unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') |
|
|||
840 | [1] |
|
|||
841 |
|
||||
842 | #if phasebased |
|
|||
843 | $ hg log -G --template '{rev} {desc|firstline} {author} {date|isodate}' |
|
|||
844 | @ 9 pending changes temporary commit shelve@localhost 2004-01-10 13:37 +0000 |
|
|||
845 | | |
|
|||
846 | | @ 8 changes to: commit stuff shelve@localhost 1970-01-01 00:00 +0000 |
|
|||
847 | |/ |
|
|||
848 | o 7 commit stuff test 1970-01-01 00:00 +0000 |
|
|||
849 | | |
|
|||
850 | | o 2 c test 1970-01-01 00:00 +0000 |
|
|||
851 | |/ |
|
|||
852 | o 0 a test 1970-01-01 00:00 +0000 |
|
|||
853 |
|
||||
854 | #endif |
|
|||
855 |
|
||||
856 | #if stripbased |
|
|||
857 | $ hg log -G --template '{rev} {desc|firstline} {author} {date|isodate}' |
|
|||
858 | @ 5 changes to: commit stuff shelve@localhost 1970-01-01 00:00 +0000 |
|
|||
859 | | |
|
|||
860 | | @ 4 pending changes temporary commit shelve@localhost 2004-01-10 13:37 +0000 |
|
|||
861 | |/ |
|
|||
862 | o 3 commit stuff test 1970-01-01 00:00 +0000 |
|
|||
863 | | |
|
|||
864 | | o 2 c test 1970-01-01 00:00 +0000 |
|
|||
865 | |/ |
|
|||
866 | o 0 a test 1970-01-01 00:00 +0000 |
|
|||
867 |
|
||||
868 | #endif |
|
|||
869 |
|
||||
870 | $ hg st |
|
|||
871 | M f |
|
|||
872 | ? f.orig |
|
|||
873 | $ cat f |
|
|||
874 | <<<<<<< shelve: d44eae5c3d33 - shelve: pending changes temporary commit |
|
|||
875 | g |
|
|||
876 | ======= |
|
|||
877 | f |
|
|||
878 | >>>>>>> working-copy: aef214a5229c - shelve: changes to: commit stuff |
|
|||
879 | $ cat f.orig |
|
|||
880 | g |
|
|||
881 | $ hg unshelve --abort -t false |
|
|||
882 | tool option will be ignored |
|
|||
883 | unshelve of 'default' aborted |
|
|||
884 | $ hg st |
|
|||
885 | M a |
|
|||
886 | ? f.orig |
|
|||
887 | $ cat f.orig |
|
|||
888 | g |
|
|||
889 | $ hg unshelve |
|
|||
890 | unshelving change 'default' |
|
|||
891 | temporarily committing pending changes (restore with 'hg unshelve --abort') |
|
|||
892 | rebasing shelved changes |
|
|||
893 | $ hg st |
|
|||
894 | M a |
|
|||
895 | A f |
|
|||
896 | ? f.orig |
|
|||
897 |
|
||||
898 | other committed changes - merge: |
|
|||
899 |
|
||||
900 | $ hg shelve f |
|
|||
901 | shelved as default |
|
|||
902 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
|||
903 | $ hg ci a -m 'intermediate other change' |
|
|||
904 | $ mv f.orig f |
|
|||
905 | $ hg unshelve |
|
|||
906 | unshelving change 'default' |
|
|||
907 | rebasing shelved changes |
|
|||
908 | merging f |
|
|||
909 | warning: conflicts while merging f! (edit, then use 'hg resolve --mark') |
|
|||
910 | unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') |
|
|||
911 | [1] |
|
|||
912 | $ hg st |
|
|||
913 | M f |
|
|||
914 | ? f.orig |
|
|||
915 | $ cat f |
|
|||
916 | <<<<<<< shelve: 6b563750f973 - test: intermediate other change |
|
|||
917 | g |
|
|||
918 | ======= |
|
|||
919 | f |
|
|||
920 | >>>>>>> working-copy: aef214a5229c - shelve: changes to: commit stuff |
|
|||
921 | $ cat f.orig |
|
|||
922 | g |
|
|||
923 | $ hg unshelve --abort |
|
|||
924 | unshelve of 'default' aborted |
|
|||
925 | $ hg st |
|
|||
926 | ? f.orig |
|
|||
927 | $ cat f.orig |
|
|||
928 | g |
|
|||
929 | $ hg shelve --delete default |
|
|||
930 |
|
||||
931 | Recreate some conflict again |
|
671 | Recreate some conflict again | |
932 |
|
672 | |||
933 | $ cd ../repo |
|
|||
934 | $ hg up -C -r 2e69b451d1ea |
|
673 | $ hg up -C -r 2e69b451d1ea | |
935 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
674 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
936 | (leaving bookmark test) |
|
675 | (leaving bookmark test) | |
@@ -1143,21 +882,6 b" they don't provide a shelve name" | |||||
1143 |
|
882 | |||
1144 | $ cd .. |
|
883 | $ cd .. | |
1145 |
|
884 | |||
1146 | you shouldn't be able to ask for the patch/stats of the most recent shelve if |
|
|||
1147 | there are no shelves |
|
|||
1148 |
|
||||
1149 | $ hg init noshelves |
|
|||
1150 | $ cd noshelves |
|
|||
1151 |
|
||||
1152 | $ hg shelve --patch |
|
|||
1153 | abort: there are no shelves to show |
|
|||
1154 | [255] |
|
|||
1155 | $ hg shelve --stat |
|
|||
1156 | abort: there are no shelves to show |
|
|||
1157 | [255] |
|
|||
1158 |
|
||||
1159 | $ cd .. |
|
|||
1160 |
|
||||
1161 | Shelve from general delta repo uses bundle2 on disk |
|
885 | Shelve from general delta repo uses bundle2 on disk | |
1162 | -------------------------------------------------- |
|
886 | -------------------------------------------------- | |
1163 |
|
887 | |||
@@ -1327,43 +1051,6 b' Test visibility of in-memory changes ins' | |||||
1327 |
|
1051 | |||
1328 | $ cd .. |
|
1052 | $ cd .. | |
1329 |
|
1053 | |||
1330 | test .orig files go where the user wants them to |
|
|||
1331 | --------------------------------------------------------------- |
|
|||
1332 | $ hg init salvage |
|
|||
1333 | $ cd salvage |
|
|||
1334 | $ echo 'content' > root |
|
|||
1335 | $ hg commit -A -m 'root' -q |
|
|||
1336 | $ echo '' > root |
|
|||
1337 | $ hg shelve -q |
|
|||
1338 | $ echo 'contADDent' > root |
|
|||
1339 | $ hg unshelve -q --config 'ui.origbackuppath=.hg/origbackups' |
|
|||
1340 | warning: conflicts while merging root! (edit, then use 'hg resolve --mark') |
|
|||
1341 | unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') |
|
|||
1342 | [1] |
|
|||
1343 | $ ls .hg/origbackups |
|
|||
1344 | root |
|
|||
1345 | $ rm -rf .hg/origbackups |
|
|||
1346 |
|
||||
1347 | test Abort unshelve always gets user out of the unshelved state |
|
|||
1348 | --------------------------------------------------------------- |
|
|||
1349 |
|
||||
1350 | with a corrupted shelve state file |
|
|||
1351 | $ sed 's/ae8c668541e8/123456789012/' .hg/shelvedstate > ../corrupt-shelvedstate |
|
|||
1352 | $ mv ../corrupt-shelvedstate .hg/shelvestate |
|
|||
1353 | $ hg unshelve --abort 2>&1 | grep 'aborted' |
|
|||
1354 | unshelve of 'default' aborted |
|
|||
1355 | $ hg summary |
|
|||
1356 | parent: 0:ae8c668541e8 tip |
|
|||
1357 | root |
|
|||
1358 | branch: default |
|
|||
1359 | commit: 1 modified |
|
|||
1360 | update: (current) |
|
|||
1361 | phases: 1 draft |
|
|||
1362 | $ hg up -C . |
|
|||
1363 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
1364 |
|
||||
1365 | $ cd .. |
|
|||
1366 |
|
||||
1367 | Keep active bookmark while (un)shelving even on shared repo (issue4940) |
|
1054 | Keep active bookmark while (un)shelving even on shared repo (issue4940) | |
1368 | ----------------------------------------------------------------------- |
|
1055 | ----------------------------------------------------------------------- | |
1369 |
|
1056 | |||
@@ -1400,505 +1087,3 b' Keep active bookmark while (un)shelving ' | |||||
1400 | test (4|13):33f7f61e6c5e (re) |
|
1087 | test (4|13):33f7f61e6c5e (re) | |
1401 |
|
1088 | |||
1402 | $ cd .. |
|
1089 | $ cd .. | |
1403 |
|
||||
1404 | Shelve and unshelve unknown files. For the purposes of unshelve, a shelved |
|
|||
1405 | unknown file is the same as a shelved added file, except that it will be in |
|
|||
1406 | unknown state after unshelve if and only if it was either absent or unknown |
|
|||
1407 | before the unshelve operation. |
|
|||
1408 |
|
||||
1409 | $ hg init unknowns |
|
|||
1410 | $ cd unknowns |
|
|||
1411 |
|
||||
1412 | The simplest case is if I simply have an unknown file that I shelve and unshelve |
|
|||
1413 |
|
||||
1414 | $ echo unknown > unknown |
|
|||
1415 | $ hg status |
|
|||
1416 | ? unknown |
|
|||
1417 | $ hg shelve --unknown |
|
|||
1418 | shelved as default |
|
|||
1419 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
|||
1420 | $ hg status |
|
|||
1421 | $ hg unshelve |
|
|||
1422 | unshelving change 'default' |
|
|||
1423 | $ hg status |
|
|||
1424 | ? unknown |
|
|||
1425 | $ rm unknown |
|
|||
1426 |
|
||||
1427 | If I shelve, add the file, and unshelve, does it stay added? |
|
|||
1428 |
|
||||
1429 | $ echo unknown > unknown |
|
|||
1430 | $ hg shelve -u |
|
|||
1431 | shelved as default |
|
|||
1432 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
|||
1433 | $ hg status |
|
|||
1434 | $ touch unknown |
|
|||
1435 | $ hg add unknown |
|
|||
1436 | $ hg status |
|
|||
1437 | A unknown |
|
|||
1438 | $ hg unshelve |
|
|||
1439 | unshelving change 'default' |
|
|||
1440 | temporarily committing pending changes (restore with 'hg unshelve --abort') |
|
|||
1441 | rebasing shelved changes |
|
|||
1442 | merging unknown |
|
|||
1443 | $ hg status |
|
|||
1444 | A unknown |
|
|||
1445 | $ hg forget unknown |
|
|||
1446 | $ rm unknown |
|
|||
1447 |
|
||||
1448 | And if I shelve, commit, then unshelve, does it become modified? |
|
|||
1449 |
|
||||
1450 | $ echo unknown > unknown |
|
|||
1451 | $ hg shelve -u |
|
|||
1452 | shelved as default |
|
|||
1453 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
|||
1454 | $ hg status |
|
|||
1455 | $ touch unknown |
|
|||
1456 | $ hg add unknown |
|
|||
1457 | $ hg commit -qm "Add unknown" |
|
|||
1458 | $ hg status |
|
|||
1459 | $ hg unshelve |
|
|||
1460 | unshelving change 'default' |
|
|||
1461 | rebasing shelved changes |
|
|||
1462 | merging unknown |
|
|||
1463 | $ hg status |
|
|||
1464 | M unknown |
|
|||
1465 | $ hg remove --force unknown |
|
|||
1466 | $ hg commit -qm "Remove unknown" |
|
|||
1467 |
|
||||
1468 | $ cd .. |
|
|||
1469 |
|
||||
1470 | We expects that non-bare shelve keeps newly created branch in |
|
|||
1471 | working directory. |
|
|||
1472 |
|
||||
1473 | $ hg init shelve-preserve-new-branch |
|
|||
1474 | $ cd shelve-preserve-new-branch |
|
|||
1475 | $ echo "a" >> a |
|
|||
1476 | $ hg add a |
|
|||
1477 | $ echo "b" >> b |
|
|||
1478 | $ hg add b |
|
|||
1479 | $ hg commit -m "ab" |
|
|||
1480 | $ echo "aa" >> a |
|
|||
1481 | $ echo "bb" >> b |
|
|||
1482 | $ hg branch new-branch |
|
|||
1483 | marked working directory as branch new-branch |
|
|||
1484 | (branches are permanent and global, did you want a bookmark?) |
|
|||
1485 | $ hg status |
|
|||
1486 | M a |
|
|||
1487 | M b |
|
|||
1488 | $ hg branch |
|
|||
1489 | new-branch |
|
|||
1490 | $ hg shelve a |
|
|||
1491 | shelved as default |
|
|||
1492 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
1493 | $ hg branch |
|
|||
1494 | new-branch |
|
|||
1495 | $ hg status |
|
|||
1496 | M b |
|
|||
1497 | $ touch "c" >> c |
|
|||
1498 | $ hg add c |
|
|||
1499 | $ hg status |
|
|||
1500 | M b |
|
|||
1501 | A c |
|
|||
1502 | $ hg shelve --exclude c |
|
|||
1503 | shelved as default-01 |
|
|||
1504 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
1505 | $ hg branch |
|
|||
1506 | new-branch |
|
|||
1507 | $ hg status |
|
|||
1508 | A c |
|
|||
1509 | $ hg shelve --include c |
|
|||
1510 | shelved as default-02 |
|
|||
1511 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
|||
1512 | $ hg branch |
|
|||
1513 | new-branch |
|
|||
1514 | $ hg status |
|
|||
1515 | $ echo "d" >> d |
|
|||
1516 | $ hg add d |
|
|||
1517 | $ hg status |
|
|||
1518 | A d |
|
|||
1519 |
|
||||
1520 | We expect that bare-shelve will not keep branch in current working directory. |
|
|||
1521 |
|
||||
1522 | $ hg shelve |
|
|||
1523 | shelved as default-03 |
|
|||
1524 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
|||
1525 | $ hg branch |
|
|||
1526 | default |
|
|||
1527 | $ cd .. |
|
|||
1528 |
|
||||
1529 | When i shelve commit on newly created branch i expect |
|
|||
1530 | that after unshelve newly created branch will be preserved. |
|
|||
1531 |
|
||||
1532 | $ hg init shelve_on_new_branch_simple |
|
|||
1533 | $ cd shelve_on_new_branch_simple |
|
|||
1534 | $ echo "aaa" >> a |
|
|||
1535 | $ hg commit -A -m "a" |
|
|||
1536 | adding a |
|
|||
1537 | $ hg branch |
|
|||
1538 | default |
|
|||
1539 | $ hg branch test |
|
|||
1540 | marked working directory as branch test |
|
|||
1541 | (branches are permanent and global, did you want a bookmark?) |
|
|||
1542 | $ echo "bbb" >> a |
|
|||
1543 | $ hg status |
|
|||
1544 | M a |
|
|||
1545 | $ hg shelve |
|
|||
1546 | shelved as default |
|
|||
1547 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
1548 | $ hg branch |
|
|||
1549 | default |
|
|||
1550 | $ echo "bbb" >> b |
|
|||
1551 | $ hg status |
|
|||
1552 | ? b |
|
|||
1553 | $ hg unshelve |
|
|||
1554 | unshelving change 'default' |
|
|||
1555 | marked working directory as branch test |
|
|||
1556 | $ hg status |
|
|||
1557 | M a |
|
|||
1558 | ? b |
|
|||
1559 | $ hg branch |
|
|||
1560 | test |
|
|||
1561 | $ cd .. |
|
|||
1562 |
|
||||
1563 | When i shelve commit on newly created branch, make |
|
|||
1564 | some changes, unshelve it and running into merge |
|
|||
1565 | conflicts i expect that after fixing them and |
|
|||
1566 | running unshelve --continue newly created branch |
|
|||
1567 | will be preserved. |
|
|||
1568 |
|
||||
1569 | $ hg init shelve_on_new_branch_conflict |
|
|||
1570 | $ cd shelve_on_new_branch_conflict |
|
|||
1571 | $ echo "aaa" >> a |
|
|||
1572 | $ hg commit -A -m "a" |
|
|||
1573 | adding a |
|
|||
1574 | $ hg branch |
|
|||
1575 | default |
|
|||
1576 | $ hg branch test |
|
|||
1577 | marked working directory as branch test |
|
|||
1578 | (branches are permanent and global, did you want a bookmark?) |
|
|||
1579 | $ echo "bbb" >> a |
|
|||
1580 | $ hg status |
|
|||
1581 | M a |
|
|||
1582 | $ hg shelve |
|
|||
1583 | shelved as default |
|
|||
1584 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
1585 | $ hg branch |
|
|||
1586 | default |
|
|||
1587 | $ echo "ccc" >> a |
|
|||
1588 | $ hg status |
|
|||
1589 | M a |
|
|||
1590 | $ hg unshelve |
|
|||
1591 | unshelving change 'default' |
|
|||
1592 | temporarily committing pending changes (restore with 'hg unshelve --abort') |
|
|||
1593 | rebasing shelved changes |
|
|||
1594 | merging a |
|
|||
1595 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') |
|
|||
1596 | unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') |
|
|||
1597 | [1] |
|
|||
1598 | $ echo "aaabbbccc" > a |
|
|||
1599 | $ rm a.orig |
|
|||
1600 | $ hg resolve --mark a |
|
|||
1601 | (no more unresolved files) |
|
|||
1602 | continue: hg unshelve --continue |
|
|||
1603 | $ hg unshelve --continue |
|
|||
1604 | marked working directory as branch test |
|
|||
1605 | unshelve of 'default' complete |
|
|||
1606 | $ cat a |
|
|||
1607 | aaabbbccc |
|
|||
1608 | $ hg status |
|
|||
1609 | M a |
|
|||
1610 | $ hg branch |
|
|||
1611 | test |
|
|||
1612 | $ hg commit -m "test-commit" |
|
|||
1613 |
|
||||
1614 | When i shelve on test branch, update to default branch |
|
|||
1615 | and unshelve i expect that it will not preserve previous |
|
|||
1616 | test branch. |
|
|||
1617 |
|
||||
1618 | $ echo "xxx" > b |
|
|||
1619 | $ hg add b |
|
|||
1620 | $ hg shelve |
|
|||
1621 | shelved as test |
|
|||
1622 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
|||
1623 | $ hg update -r 7049e48789d7 |
|
|||
1624 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
1625 | $ hg unshelve |
|
|||
1626 | unshelving change 'test' |
|
|||
1627 | rebasing shelved changes |
|
|||
1628 | $ hg status |
|
|||
1629 | A b |
|
|||
1630 | $ hg branch |
|
|||
1631 | default |
|
|||
1632 | $ cd .. |
|
|||
1633 |
|
||||
1634 | When i unshelve resulting in merge conflicts and makes saved |
|
|||
1635 | file shelvedstate looks like in previous versions in |
|
|||
1636 | mercurial(without restore branch information in 7th line) i |
|
|||
1637 | expect that after resolving conflicts and successfully |
|
|||
1638 | running 'shelve --continue' the branch information won't be |
|
|||
1639 | restored and branch will be unchanged. |
|
|||
1640 |
|
||||
1641 | shelve on new branch, conflict with previous shelvedstate |
|
|||
1642 |
|
||||
1643 | $ hg init conflict |
|
|||
1644 | $ cd conflict |
|
|||
1645 | $ echo "aaa" >> a |
|
|||
1646 | $ hg commit -A -m "a" |
|
|||
1647 | adding a |
|
|||
1648 | $ hg branch |
|
|||
1649 | default |
|
|||
1650 | $ hg branch test |
|
|||
1651 | marked working directory as branch test |
|
|||
1652 | (branches are permanent and global, did you want a bookmark?) |
|
|||
1653 | $ echo "bbb" >> a |
|
|||
1654 | $ hg status |
|
|||
1655 | M a |
|
|||
1656 | $ hg shelve |
|
|||
1657 | shelved as default |
|
|||
1658 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
1659 | $ hg branch |
|
|||
1660 | default |
|
|||
1661 | $ echo "ccc" >> a |
|
|||
1662 | $ hg status |
|
|||
1663 | M a |
|
|||
1664 | $ hg unshelve |
|
|||
1665 | unshelving change 'default' |
|
|||
1666 | temporarily committing pending changes (restore with 'hg unshelve --abort') |
|
|||
1667 | rebasing shelved changes |
|
|||
1668 | merging a |
|
|||
1669 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') |
|
|||
1670 | unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') |
|
|||
1671 | [1] |
|
|||
1672 |
|
||||
1673 | Removing restore branch information from shelvedstate file(making it looks like |
|
|||
1674 | in previous versions) and running unshelve --continue |
|
|||
1675 |
|
||||
1676 | $ cp .hg/shelvedstate .hg/shelvedstate_old |
|
|||
1677 | $ cat .hg/shelvedstate_old | grep -v 'branchtorestore' > .hg/shelvedstate |
|
|||
1678 |
|
||||
1679 | $ echo "aaabbbccc" > a |
|
|||
1680 | $ rm a.orig |
|
|||
1681 | $ hg resolve --mark a |
|
|||
1682 | (no more unresolved files) |
|
|||
1683 | continue: hg unshelve --continue |
|
|||
1684 | $ hg unshelve --continue |
|
|||
1685 | unshelve of 'default' complete |
|
|||
1686 | $ cat a |
|
|||
1687 | aaabbbccc |
|
|||
1688 | $ hg status |
|
|||
1689 | M a |
|
|||
1690 | $ hg branch |
|
|||
1691 | default |
|
|||
1692 | $ cd .. |
|
|||
1693 |
|
||||
1694 | On non bare shelve the branch information shouldn't be restored |
|
|||
1695 |
|
||||
1696 | $ hg init bare_shelve_on_new_branch |
|
|||
1697 | $ cd bare_shelve_on_new_branch |
|
|||
1698 | $ echo "aaa" >> a |
|
|||
1699 | $ hg commit -A -m "a" |
|
|||
1700 | adding a |
|
|||
1701 | $ hg branch |
|
|||
1702 | default |
|
|||
1703 | $ hg branch test |
|
|||
1704 | marked working directory as branch test |
|
|||
1705 | (branches are permanent and global, did you want a bookmark?) |
|
|||
1706 | $ echo "bbb" >> a |
|
|||
1707 | $ hg status |
|
|||
1708 | M a |
|
|||
1709 | $ hg shelve a |
|
|||
1710 | shelved as default |
|
|||
1711 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
1712 | $ hg branch |
|
|||
1713 | test |
|
|||
1714 | $ hg branch default |
|
|||
1715 | marked working directory as branch default |
|
|||
1716 | (branches are permanent and global, did you want a bookmark?) |
|
|||
1717 | $ echo "bbb" >> b |
|
|||
1718 | $ hg status |
|
|||
1719 | ? b |
|
|||
1720 | $ hg unshelve |
|
|||
1721 | unshelving change 'default' |
|
|||
1722 | $ hg status |
|
|||
1723 | M a |
|
|||
1724 | ? b |
|
|||
1725 | $ hg branch |
|
|||
1726 | default |
|
|||
1727 | $ cd .. |
|
|||
1728 |
|
||||
1729 | Prepare unshelve with a corrupted shelvedstate |
|
|||
1730 | $ hg init r1 && cd r1 |
|
|||
1731 | $ echo text1 > file && hg add file |
|
|||
1732 | $ hg shelve |
|
|||
1733 | shelved as default |
|
|||
1734 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
|||
1735 | $ echo text2 > file && hg ci -Am text1 |
|
|||
1736 | adding file |
|
|||
1737 | $ hg unshelve |
|
|||
1738 | unshelving change 'default' |
|
|||
1739 | rebasing shelved changes |
|
|||
1740 | merging file |
|
|||
1741 | warning: conflicts while merging file! (edit, then use 'hg resolve --mark') |
|
|||
1742 | unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') |
|
|||
1743 | [1] |
|
|||
1744 | $ echo somethingsomething > .hg/shelvedstate |
|
|||
1745 |
|
||||
1746 | Unshelve --continue fails with appropriate message if shelvedstate is corrupted |
|
|||
1747 | $ hg unshelve --continue |
|
|||
1748 | abort: corrupted shelved state file |
|
|||
1749 | (please run hg unshelve --abort to abort unshelve operation) |
|
|||
1750 | [255] |
|
|||
1751 |
|
||||
1752 | Unshelve --abort works with a corrupted shelvedstate |
|
|||
1753 | $ hg unshelve --abort |
|
|||
1754 | could not read shelved state file, your working copy may be in an unexpected state |
|
|||
1755 | please update to some commit |
|
|||
1756 |
|
||||
1757 | Unshelve --abort fails with appropriate message if there's no unshelve in |
|
|||
1758 | progress |
|
|||
1759 | $ hg unshelve --abort |
|
|||
1760 | abort: no unshelve in progress |
|
|||
1761 | [255] |
|
|||
1762 | $ cd .. |
|
|||
1763 |
|
||||
1764 | Unshelve respects --keep even if user intervention is needed |
|
|||
1765 | $ hg init unshelvekeep && cd unshelvekeep |
|
|||
1766 | $ echo 1 > file && hg ci -Am 1 |
|
|||
1767 | adding file |
|
|||
1768 | $ echo 2 >> file |
|
|||
1769 | $ hg shelve |
|
|||
1770 | shelved as default |
|
|||
1771 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
1772 | $ echo 3 >> file && hg ci -Am 13 |
|
|||
1773 | $ hg shelve --list |
|
|||
1774 | default (*s ago) * changes to: 1 (glob) |
|
|||
1775 | $ hg unshelve --keep |
|
|||
1776 | unshelving change 'default' |
|
|||
1777 | rebasing shelved changes |
|
|||
1778 | merging file |
|
|||
1779 | warning: conflicts while merging file! (edit, then use 'hg resolve --mark') |
|
|||
1780 | unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') |
|
|||
1781 | [1] |
|
|||
1782 | $ hg resolve --mark file |
|
|||
1783 | (no more unresolved files) |
|
|||
1784 | continue: hg unshelve --continue |
|
|||
1785 | $ hg unshelve --continue |
|
|||
1786 | unshelve of 'default' complete |
|
|||
1787 | $ hg shelve --list |
|
|||
1788 | default (*s ago) * changes to: 1 (glob) |
|
|||
1789 | $ cd .. |
|
|||
1790 |
|
||||
1791 | Unshelving when there are deleted files does not crash (issue4176) |
|
|||
1792 | $ hg init unshelve-deleted-file && cd unshelve-deleted-file |
|
|||
1793 | $ echo a > a && echo b > b && hg ci -Am ab |
|
|||
1794 | adding a |
|
|||
1795 | adding b |
|
|||
1796 | $ echo aa > a && hg shelve |
|
|||
1797 | shelved as default |
|
|||
1798 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
1799 | $ rm b |
|
|||
1800 | $ hg st |
|
|||
1801 | ! b |
|
|||
1802 | $ hg unshelve |
|
|||
1803 | unshelving change 'default' |
|
|||
1804 | $ hg shelve |
|
|||
1805 | shelved as default |
|
|||
1806 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
1807 | $ rm a && echo b > b |
|
|||
1808 | $ hg st |
|
|||
1809 | ! a |
|
|||
1810 | $ hg unshelve |
|
|||
1811 | unshelving change 'default' |
|
|||
1812 | abort: shelved change touches missing files |
|
|||
1813 | (run hg status to see which files are missing) |
|
|||
1814 | [255] |
|
|||
1815 | $ hg st |
|
|||
1816 | ! a |
|
|||
1817 | $ cd .. |
|
|||
1818 |
|
||||
1819 | New versions of Mercurial know how to read onld shelvedstate files |
|
|||
1820 | $ hg init oldshelvedstate |
|
|||
1821 | $ cd oldshelvedstate |
|
|||
1822 | $ echo root > root && hg ci -Am root |
|
|||
1823 | adding root |
|
|||
1824 | $ echo 1 > a |
|
|||
1825 | $ hg add a |
|
|||
1826 | $ hg shelve --name ashelve |
|
|||
1827 | shelved as ashelve |
|
|||
1828 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
|||
1829 | $ echo 2 > a |
|
|||
1830 | $ hg ci -Am a |
|
|||
1831 | adding a |
|
|||
1832 | $ hg unshelve |
|
|||
1833 | unshelving change 'ashelve' |
|
|||
1834 | rebasing shelved changes |
|
|||
1835 | merging a |
|
|||
1836 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') |
|
|||
1837 | unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') |
|
|||
1838 | [1] |
|
|||
1839 | putting v1 shelvedstate file in place of a created v2 |
|
|||
1840 | $ cat << EOF > .hg/shelvedstate |
|
|||
1841 | > 1 |
|
|||
1842 | > ashelve |
|
|||
1843 | > 8b058dae057a5a78f393f4535d9e363dd5efac9d |
|
|||
1844 | > 8b058dae057a5a78f393f4535d9e363dd5efac9d |
|
|||
1845 | > 8b058dae057a5a78f393f4535d9e363dd5efac9d f543b27db2cdb41737e2e0008dc524c471da1446 |
|
|||
1846 | > f543b27db2cdb41737e2e0008dc524c471da1446 |
|
|||
1847 | > |
|
|||
1848 | > nokeep |
|
|||
1849 | > :no-active-bookmark |
|
|||
1850 | > EOF |
|
|||
1851 | $ echo 1 > a |
|
|||
1852 | $ hg resolve --mark a |
|
|||
1853 | (no more unresolved files) |
|
|||
1854 | continue: hg unshelve --continue |
|
|||
1855 | mercurial does not crash |
|
|||
1856 | $ hg unshelve --continue |
|
|||
1857 | unshelve of 'ashelve' complete |
|
|||
1858 |
|
||||
1859 | #if phasebased |
|
|||
1860 |
|
||||
1861 | Unshelve with some metadata file missing |
|
|||
1862 | ---------------------------------------- |
|
|||
1863 |
|
||||
1864 | $ hg shelve |
|
|||
1865 | shelved as default |
|
|||
1866 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
1867 | $ echo 3 > a |
|
|||
1868 |
|
||||
1869 | Test with the `.shelve` missing, but the changeset still in the repo (non-natural case) |
|
|||
1870 |
|
||||
1871 | $ rm .hg/shelved/default.shelve |
|
|||
1872 | $ hg unshelve |
|
|||
1873 | unshelving change 'default' |
|
|||
1874 | temporarily committing pending changes (restore with 'hg unshelve --abort') |
|
|||
1875 | rebasing shelved changes |
|
|||
1876 | merging a |
|
|||
1877 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') |
|
|||
1878 | unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') |
|
|||
1879 | [1] |
|
|||
1880 | $ hg unshelve --abort |
|
|||
1881 | unshelve of 'default' aborted |
|
|||
1882 |
|
||||
1883 | Unshelve without .shelve metadata (can happen when upgrading a repository with old shelve) |
|
|||
1884 |
|
||||
1885 | $ cat .hg/shelved/default.shelve |
|
|||
1886 | node=82e0cb9893247d12667017593ce1e5655860f1ac |
|
|||
1887 | $ hg strip --hidden --rev 82e0cb989324 --no-backup |
|
|||
1888 | $ rm .hg/shelved/default.shelve |
|
|||
1889 | $ hg unshelve |
|
|||
1890 | unshelving change 'default' |
|
|||
1891 | temporarily committing pending changes (restore with 'hg unshelve --abort') |
|
|||
1892 | rebasing shelved changes |
|
|||
1893 | merging a |
|
|||
1894 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') |
|
|||
1895 | unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') |
|
|||
1896 | [1] |
|
|||
1897 | $ cat .hg/shelved/default.shelve |
|
|||
1898 | node=82e0cb9893247d12667017593ce1e5655860f1ac |
|
|||
1899 | $ hg unshelve --abort |
|
|||
1900 | unshelve of 'default' aborted |
|
|||
1901 |
|
||||
1902 | #endif |
|
|||
1903 |
|
||||
1904 | $ cd .. |
|
This diff has been collapsed as it changes many lines, (1069 lines changed) Show them Hide them | |||||
@@ -20,657 +20,8 b'' | |||||
20 |
|
20 | |||
21 | #endif |
|
21 | #endif | |
22 |
|
22 | |||
23 | $ hg init repo |
|
|||
24 | $ cd repo |
|
|||
25 | $ mkdir a b |
|
|||
26 | $ echo a > a/a |
|
|||
27 | $ echo b > b/b |
|
|||
28 | $ echo c > c |
|
|||
29 | $ echo d > d |
|
|||
30 | $ echo x > x |
|
|||
31 | $ hg addremove -q |
|
|||
32 |
|
||||
33 | shelve has a help message |
|
|||
34 | $ hg shelve -h |
|
|||
35 | hg shelve [OPTION]... [FILE]... |
|
|||
36 |
|
||||
37 | save and set aside changes from the working directory |
|
|||
38 |
|
||||
39 | Shelving takes files that "hg status" reports as not clean, saves the |
|
|||
40 | modifications to a bundle (a shelved change), and reverts the files so |
|
|||
41 | that their state in the working directory becomes clean. |
|
|||
42 |
|
||||
43 | To restore these changes to the working directory, using "hg unshelve"; |
|
|||
44 | this will work even if you switch to a different commit. |
|
|||
45 |
|
||||
46 | When no files are specified, "hg shelve" saves all not-clean files. If |
|
|||
47 | specific files or directories are named, only changes to those files are |
|
|||
48 | shelved. |
|
|||
49 |
|
||||
50 | In bare shelve (when no files are specified, without interactive, include |
|
|||
51 | and exclude option), shelving remembers information if the working |
|
|||
52 | directory was on newly created branch, in other words working directory |
|
|||
53 | was on different branch than its first parent. In this situation |
|
|||
54 | unshelving restores branch information to the working directory. |
|
|||
55 |
|
||||
56 | Each shelved change has a name that makes it easier to find later. The |
|
|||
57 | name of a shelved change defaults to being based on the active bookmark, |
|
|||
58 | or if there is no active bookmark, the current named branch. To specify a |
|
|||
59 | different name, use "--name". |
|
|||
60 |
|
||||
61 | To see a list of existing shelved changes, use the "--list" option. For |
|
|||
62 | each shelved change, this will print its name, age, and description; use " |
|
|||
63 | --patch" or "--stat" for more details. |
|
|||
64 |
|
||||
65 | To delete specific shelved changes, use "--delete". To delete all shelved |
|
|||
66 | changes, use "--cleanup". |
|
|||
67 |
|
||||
68 | (use 'hg help -e shelve' to show help for the shelve extension) |
|
|||
69 |
|
||||
70 | options ([+] can be repeated): |
|
|||
71 |
|
||||
72 | -A --addremove mark new/missing files as added/removed before |
|
|||
73 | shelving |
|
|||
74 | -u --unknown store unknown files in the shelve |
|
|||
75 | --cleanup delete all shelved changes |
|
|||
76 | --date DATE shelve with the specified commit date |
|
|||
77 | -d --delete delete the named shelved change(s) |
|
|||
78 | -e --edit invoke editor on commit messages |
|
|||
79 | -l --list list current shelves |
|
|||
80 | -m --message TEXT use text as shelve message |
|
|||
81 | -n --name NAME use the given name for the shelved commit |
|
|||
82 | -p --patch output patches for changes (provide the names of the |
|
|||
83 | shelved changes as positional arguments) |
|
|||
84 | -i --interactive interactive mode, only works while creating a shelve |
|
|||
85 | --stat output diffstat-style summary of changes (provide |
|
|||
86 | the names of the shelved changes as positional |
|
|||
87 | arguments) |
|
|||
88 | -I --include PATTERN [+] include names matching the given patterns |
|
|||
89 | -X --exclude PATTERN [+] exclude names matching the given patterns |
|
|||
90 | --mq operate on patch repository |
|
|||
91 |
|
||||
92 | (some details hidden, use --verbose to show complete help) |
|
|||
93 |
|
||||
94 | shelving in an empty repo should be possible |
|
|||
95 | (this tests also that editor is not invoked, if '--edit' is not |
|
|||
96 | specified) |
|
|||
97 |
|
||||
98 | $ HGEDITOR=cat hg shelve |
|
|||
99 | shelved as default |
|
|||
100 | 0 files updated, 0 files merged, 5 files removed, 0 files unresolved |
|
|||
101 |
|
||||
102 | $ hg unshelve |
|
|||
103 | unshelving change 'default' |
|
|||
104 |
|
||||
105 | $ hg commit -q -m 'initial commit' |
|
|||
106 |
|
||||
107 | $ hg shelve |
|
|||
108 | nothing changed |
|
|||
109 | [1] |
|
|||
110 |
|
||||
111 | make sure shelve files were backed up |
|
|||
112 |
|
||||
113 | $ ls .hg/shelve-backup |
|
|||
114 | default.hg |
|
|||
115 | default.patch |
|
|||
116 | default.shelve |
|
|||
117 |
|
||||
118 | checks to make sure we dont create a directory or |
|
|||
119 | hidden file while choosing a new shelve name |
|
|||
120 |
|
||||
121 | when we are given a name |
|
|||
122 |
|
||||
123 | $ hg shelve -n foo/bar |
|
|||
124 | abort: shelved change names can not contain slashes |
|
|||
125 | [255] |
|
|||
126 | $ hg shelve -n .baz |
|
|||
127 | abort: shelved change names can not start with '.' |
|
|||
128 | [255] |
|
|||
129 | $ hg shelve -n foo\\bar |
|
|||
130 | abort: shelved change names can not contain slashes |
|
|||
131 | [255] |
|
|||
132 |
|
||||
133 | when shelve has to choose itself |
|
|||
134 |
|
||||
135 | $ hg branch x/y -q |
|
|||
136 | $ hg commit -q -m "Branch commit 0" |
|
|||
137 | $ hg shelve |
|
|||
138 | nothing changed |
|
|||
139 | [1] |
|
|||
140 | $ hg branch .x -q |
|
|||
141 | $ hg commit -q -m "Branch commit 1" |
|
|||
142 | $ hg shelve |
|
|||
143 | nothing changed |
|
|||
144 | [1] |
|
|||
145 | $ hg branch x\\y -q |
|
|||
146 | $ hg commit -q -m "Branch commit 2" |
|
|||
147 | $ hg shelve |
|
|||
148 | nothing changed |
|
|||
149 | [1] |
|
|||
150 |
|
||||
151 | cleaning the branches made for name checking tests |
|
|||
152 |
|
||||
153 | $ hg up default -q |
|
|||
154 | $ hg strip e9177275307e+6a6d231f43d+882bae7c62c2 -q |
|
|||
155 |
|
||||
156 | create an mq patch - shelving should work fine with a patch applied |
|
|||
157 |
|
||||
158 | $ echo n > n |
|
|||
159 | $ hg add n |
|
|||
160 | $ hg commit n -m second |
|
|||
161 | $ hg qnew second.patch |
|
|||
162 |
|
||||
163 | shelve a change that we will delete later |
|
|||
164 |
|
||||
165 | $ echo a >> a/a |
|
|||
166 | $ hg shelve |
|
|||
167 | shelved as default |
|
|||
168 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
169 |
|
||||
170 | set up some more complex changes to shelve |
|
|||
171 |
|
||||
172 | $ echo a >> a/a |
|
|||
173 | $ hg mv b b.rename |
|
|||
174 | moving b/b to b.rename/b |
|
|||
175 | $ hg cp c c.copy |
|
|||
176 | $ hg status -C |
|
|||
177 | M a/a |
|
|||
178 | A b.rename/b |
|
|||
179 | b/b |
|
|||
180 | A c.copy |
|
|||
181 | c |
|
|||
182 | R b/b |
|
|||
183 |
|
||||
184 | the common case - no options or filenames |
|
|||
185 |
|
||||
186 | $ hg shelve |
|
|||
187 | shelved as default-01 |
|
|||
188 | 2 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
|||
189 | $ hg status -C |
|
|||
190 |
|
||||
191 | ensure that our shelved changes exist |
|
|||
192 |
|
||||
193 | $ hg shelve -l |
|
|||
194 | default-01 (*)* changes to: [mq]: second.patch (glob) |
|
|||
195 | default (*)* changes to: [mq]: second.patch (glob) |
|
|||
196 |
|
||||
197 | $ hg shelve -l -p default |
|
|||
198 | default (*)* changes to: [mq]: second.patch (glob) |
|
|||
199 |
|
||||
200 | diff --git a/a/a b/a/a |
|
|||
201 | --- a/a/a |
|
|||
202 | +++ b/a/a |
|
|||
203 | @@ -1,1 +1,2 @@ |
|
|||
204 | a |
|
|||
205 | +a |
|
|||
206 |
|
||||
207 | $ hg shelve --list --addremove |
|
|||
208 | abort: options '--list' and '--addremove' may not be used together |
|
|||
209 | [255] |
|
|||
210 |
|
||||
211 | delete our older shelved change |
|
|||
212 |
|
||||
213 | $ hg shelve -d default |
|
|||
214 | $ hg qfinish -a -q |
|
|||
215 |
|
||||
216 | ensure shelve backups aren't overwritten |
|
|||
217 |
|
||||
218 | $ ls .hg/shelve-backup/ |
|
|||
219 | default-1.hg |
|
|||
220 | default-1.patch |
|
|||
221 | default-1.shelve |
|
|||
222 | default.hg |
|
|||
223 | default.patch |
|
|||
224 | default.shelve |
|
|||
225 |
|
||||
226 | local edits should not prevent a shelved change from applying |
|
|||
227 |
|
||||
228 | $ printf "z\na\n" > a/a |
|
|||
229 | $ hg unshelve --keep |
|
|||
230 | unshelving change 'default-01' |
|
|||
231 | temporarily committing pending changes (restore with 'hg unshelve --abort') |
|
|||
232 | rebasing shelved changes |
|
|||
233 | merging a/a |
|
|||
234 |
|
||||
235 | $ hg revert --all -q |
|
|||
236 | $ rm a/a.orig b.rename/b c.copy |
|
|||
237 |
|
||||
238 | apply it and make sure our state is as expected |
|
|||
239 |
|
||||
240 | (this also tests that same timestamp prevents backups from being |
|
|||
241 | removed, even though there are more than 'maxbackups' backups) |
|
|||
242 |
|
||||
243 | $ f -t .hg/shelve-backup/default.patch |
|
|||
244 | .hg/shelve-backup/default.patch: file |
|
|||
245 | $ touch -t 200001010000 .hg/shelve-backup/default.patch |
|
|||
246 | $ f -t .hg/shelve-backup/default-1.patch |
|
|||
247 | .hg/shelve-backup/default-1.patch: file |
|
|||
248 | $ touch -t 200001010000 .hg/shelve-backup/default-1.patch |
|
|||
249 |
|
||||
250 | $ hg unshelve |
|
|||
251 | unshelving change 'default-01' |
|
|||
252 | $ hg status -C |
|
|||
253 | M a/a |
|
|||
254 | A b.rename/b |
|
|||
255 | b/b |
|
|||
256 | A c.copy |
|
|||
257 | c |
|
|||
258 | R b/b |
|
|||
259 | $ hg shelve -l |
|
|||
260 |
|
||||
261 | (both of default.hg and default-1.hg should be still kept, because it |
|
|||
262 | is difficult to decide actual order of them from same timestamp) |
|
|||
263 |
|
||||
264 | $ ls .hg/shelve-backup/ |
|
|||
265 | default-01.hg |
|
|||
266 | default-01.patch |
|
|||
267 | default-01.shelve |
|
|||
268 | default-1.hg |
|
|||
269 | default-1.patch |
|
|||
270 | default-1.shelve |
|
|||
271 | default.hg |
|
|||
272 | default.patch |
|
|||
273 | default.shelve |
|
|||
274 |
|
||||
275 | $ hg unshelve |
|
|||
276 | abort: no shelved changes to apply! |
|
|||
277 | [255] |
|
|||
278 | $ hg unshelve foo |
|
|||
279 | abort: shelved change 'foo' not found |
|
|||
280 | [255] |
|
|||
281 |
|
||||
282 | named shelves, specific filenames, and "commit messages" should all work |
|
|||
283 | (this tests also that editor is invoked, if '--edit' is specified) |
|
|||
284 |
|
||||
285 | $ hg status -C |
|
|||
286 | M a/a |
|
|||
287 | A b.rename/b |
|
|||
288 | b/b |
|
|||
289 | A c.copy |
|
|||
290 | c |
|
|||
291 | R b/b |
|
|||
292 | $ HGEDITOR=cat hg shelve -q -n wibble -m wat -e a |
|
|||
293 | wat |
|
|||
294 |
|
||||
295 |
|
||||
296 | HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
|||
297 | HG: Leave message empty to abort commit. |
|
|||
298 | HG: -- |
|
|||
299 | HG: user: shelve@localhost |
|
|||
300 | HG: branch 'default' |
|
|||
301 | HG: changed a/a |
|
|||
302 |
|
||||
303 | expect "a" to no longer be present, but status otherwise unchanged |
|
|||
304 |
|
||||
305 | $ hg status -C |
|
|||
306 | A b.rename/b |
|
|||
307 | b/b |
|
|||
308 | A c.copy |
|
|||
309 | c |
|
|||
310 | R b/b |
|
|||
311 | $ hg shelve -l --stat |
|
|||
312 | wibble (*) wat (glob) |
|
|||
313 | a/a | 1 + |
|
|||
314 | 1 files changed, 1 insertions(+), 0 deletions(-) |
|
|||
315 |
|
||||
316 | and now "a/a" should reappear |
|
|||
317 |
|
||||
318 | $ cd a |
|
|||
319 | $ hg unshelve -q wibble |
|
|||
320 | $ cd .. |
|
|||
321 | $ hg status -C |
|
|||
322 | M a/a |
|
|||
323 | A b.rename/b |
|
|||
324 | b/b |
|
|||
325 | A c.copy |
|
|||
326 | c |
|
|||
327 | R b/b |
|
|||
328 |
|
||||
329 | ensure old shelve backups are being deleted automatically |
|
|||
330 |
|
||||
331 | $ ls .hg/shelve-backup/ |
|
|||
332 | default-01.hg |
|
|||
333 | default-01.patch |
|
|||
334 | default-01.shelve |
|
|||
335 | wibble.hg |
|
|||
336 | wibble.patch |
|
|||
337 | wibble.shelve |
|
|||
338 |
|
||||
339 | cause unshelving to result in a merge with 'a' conflicting |
|
|||
340 |
|
||||
341 | $ hg shelve -q |
|
|||
342 | $ echo c>>a/a |
|
|||
343 | $ hg commit -m second |
|
|||
344 | $ hg tip --template '{files}\n' |
|
|||
345 | a/a |
|
|||
346 |
|
||||
347 | add an unrelated change that should be preserved |
|
|||
348 |
|
||||
349 | $ mkdir foo |
|
|||
350 | $ echo foo > foo/foo |
|
|||
351 | $ hg add foo/foo |
|
|||
352 |
|
||||
353 | force a conflicted merge to occur |
|
|||
354 |
|
||||
355 | $ hg unshelve |
|
|||
356 | unshelving change 'default' |
|
|||
357 | temporarily committing pending changes (restore with 'hg unshelve --abort') |
|
|||
358 | rebasing shelved changes |
|
|||
359 | merging a/a |
|
|||
360 | warning: conflicts while merging a/a! (edit, then use 'hg resolve --mark') |
|
|||
361 | unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') |
|
|||
362 | [1] |
|
|||
363 | $ hg status -v |
|
|||
364 | M a/a |
|
|||
365 | M b.rename/b |
|
|||
366 | M c.copy |
|
|||
367 | R b/b |
|
|||
368 | ? a/a.orig |
|
|||
369 | # The repository is in an unfinished *unshelve* state. |
|
|||
370 |
|
||||
371 | # Unresolved merge conflicts: |
|
|||
372 | # |
|
|||
373 | # a/a |
|
|||
374 | # |
|
|||
375 | # To mark files as resolved: hg resolve --mark FILE |
|
|||
376 |
|
||||
377 | # To continue: hg unshelve --continue |
|
|||
378 | # To abort: hg unshelve --abort |
|
|||
379 |
|
||||
380 |
|
||||
381 | ensure that we have a merge with unresolved conflicts |
|
|||
382 |
|
||||
383 | #if phasebased |
|
|||
384 | $ hg heads -q --template '{rev}\n' |
|
|||
385 | 8 |
|
|||
386 | 5 |
|
|||
387 | $ hg parents -q --template '{rev}\n' |
|
|||
388 | 8 |
|
|||
389 | 5 |
|
|||
390 | #endif |
|
|||
391 |
|
||||
392 | #if stripbased |
|
|||
393 | $ hg heads -q --template '{rev}\n' |
|
|||
394 | 5 |
|
|||
395 | 4 |
|
|||
396 | $ hg parents -q --template '{rev}\n' |
|
|||
397 | 4 |
|
|||
398 | 5 |
|
|||
399 | #endif |
|
|||
400 |
|
||||
401 | $ hg status |
|
|||
402 | M a/a |
|
|||
403 | M b.rename/b |
|
|||
404 | M c.copy |
|
|||
405 | R b/b |
|
|||
406 | ? a/a.orig |
|
|||
407 | $ hg diff |
|
|||
408 | diff --git a/a/a b/a/a |
|
|||
409 | --- a/a/a |
|
|||
410 | +++ b/a/a |
|
|||
411 | @@ -1,2 +1,6 @@ |
|
|||
412 | a |
|
|||
413 | +<<<<<<< shelve: 2377350b6337 - shelve: pending changes temporary commit |
|
|||
414 | c |
|
|||
415 | +======= |
|
|||
416 | +a |
|
|||
417 | +>>>>>>> working-copy: a68ec3400638 - shelve: changes to: [mq]: second.patch |
|
|||
418 | diff --git a/b/b b/b.rename/b |
|
|||
419 | rename from b/b |
|
|||
420 | rename to b.rename/b |
|
|||
421 | diff --git a/c b/c.copy |
|
|||
422 | copy from c |
|
|||
423 | copy to c.copy |
|
|||
424 | $ hg resolve -l |
|
|||
425 | U a/a |
|
|||
426 |
|
||||
427 | $ hg shelve |
|
|||
428 | abort: unshelve already in progress |
|
|||
429 | (use 'hg unshelve --continue' or 'hg unshelve --abort') |
|
|||
430 | [255] |
|
|||
431 |
|
||||
432 | abort the unshelve and be happy |
|
|||
433 |
|
||||
434 | $ hg status |
|
|||
435 | M a/a |
|
|||
436 | M b.rename/b |
|
|||
437 | M c.copy |
|
|||
438 | R b/b |
|
|||
439 | ? a/a.orig |
|
|||
440 | $ hg unshelve -a |
|
|||
441 | unshelve of 'default' aborted |
|
|||
442 | $ hg heads -q |
|
|||
443 | [37]:2e69b451d1ea (re) |
|
|||
444 | $ hg parents |
|
|||
445 | changeset: [37]:2e69b451d1ea (re) |
|
|||
446 | tag: tip |
|
|||
447 | parent: 3:509104101065 (?) |
|
|||
448 | user: test |
|
|||
449 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
450 | summary: second |
|
|||
451 |
|
||||
452 | $ hg resolve -l |
|
|||
453 | $ hg status |
|
|||
454 | A foo/foo |
|
|||
455 | ? a/a.orig |
|
|||
456 |
|
||||
457 | try to continue with no unshelve underway |
|
|||
458 |
|
||||
459 | $ hg unshelve -c |
|
|||
460 | abort: no unshelve in progress |
|
|||
461 | [255] |
|
|||
462 | $ hg status |
|
|||
463 | A foo/foo |
|
|||
464 | ? a/a.orig |
|
|||
465 |
|
||||
466 | redo the unshelve to get a conflict |
|
|||
467 |
|
||||
468 | $ hg unshelve -q |
|
|||
469 | warning: conflicts while merging a/a! (edit, then use 'hg resolve --mark') |
|
|||
470 | unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') |
|
|||
471 | [1] |
|
|||
472 |
|
||||
473 | attempt to continue |
|
|||
474 |
|
||||
475 | $ hg unshelve -c |
|
|||
476 | abort: unresolved conflicts, can't continue |
|
|||
477 | (see 'hg resolve', then 'hg unshelve --continue') |
|
|||
478 | [255] |
|
|||
479 |
|
||||
480 | $ hg revert -r . a/a |
|
|||
481 | $ hg resolve -m a/a |
|
|||
482 | (no more unresolved files) |
|
|||
483 | continue: hg unshelve --continue |
|
|||
484 |
|
||||
485 | $ hg commit -m 'commit while unshelve in progress' |
|
|||
486 | abort: unshelve already in progress |
|
|||
487 | (use 'hg unshelve --continue' or 'hg unshelve --abort') |
|
|||
488 | [255] |
|
|||
489 |
|
||||
490 | $ hg graft --continue |
|
|||
491 | abort: no graft in progress |
|
|||
492 | (continue: hg unshelve --continue) |
|
|||
493 | [255] |
|
|||
494 | $ hg unshelve -c |
|
|||
495 | unshelve of 'default' complete |
|
|||
496 |
|
||||
497 | ensure the repo is as we hope |
|
|||
498 |
|
||||
499 | $ hg parents |
|
|||
500 | changeset: [37]:2e69b451d1ea (re) |
|
|||
501 | tag: tip |
|
|||
502 | parent: 3:509104101065 (?) |
|
|||
503 | user: test |
|
|||
504 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
505 | summary: second |
|
|||
506 |
|
||||
507 | $ hg heads -q |
|
|||
508 | [37]:2e69b451d1ea (re) |
|
|||
509 |
|
||||
510 | $ hg status -C |
|
|||
511 | A b.rename/b |
|
|||
512 | b/b |
|
|||
513 | A c.copy |
|
|||
514 | c |
|
|||
515 | A foo/foo |
|
|||
516 | R b/b |
|
|||
517 | ? a/a.orig |
|
|||
518 |
|
||||
519 | there should be no shelves left |
|
|||
520 |
|
||||
521 | $ hg shelve -l |
|
|||
522 |
|
||||
523 | #if execbit |
|
|||
524 |
|
||||
525 | ensure that metadata-only changes are shelved |
|
|||
526 |
|
||||
527 | $ chmod +x a/a |
|
|||
528 | $ hg shelve -q -n execbit a/a |
|
|||
529 | $ hg status a/a |
|
|||
530 | $ hg unshelve -q execbit |
|
|||
531 | $ hg status a/a |
|
|||
532 | M a/a |
|
|||
533 | $ hg revert a/a |
|
|||
534 |
|
||||
535 | #else |
|
|||
536 |
|
||||
537 | Dummy shelve op, to keep rev numbers aligned |
|
|||
538 |
|
||||
539 | $ echo foo > a/a |
|
|||
540 | $ hg shelve -q -n dummy a/a |
|
|||
541 | $ hg unshelve -q dummy |
|
|||
542 | $ hg revert a/a |
|
|||
543 |
|
||||
544 | #endif |
|
|||
545 |
|
||||
546 | #if symlink |
|
|||
547 |
|
||||
548 | $ rm a/a |
|
|||
549 | $ ln -s foo a/a |
|
|||
550 | $ hg shelve -q -n symlink a/a |
|
|||
551 | $ hg status a/a |
|
|||
552 | $ hg unshelve -q -n symlink |
|
|||
553 | $ hg status a/a |
|
|||
554 | M a/a |
|
|||
555 | $ hg revert a/a |
|
|||
556 |
|
||||
557 | #else |
|
|||
558 |
|
||||
559 | Dummy shelve op, to keep rev numbers aligned |
|
|||
560 |
|
||||
561 | $ echo bar > a/a |
|
|||
562 | $ hg shelve -q -n dummy a/a |
|
|||
563 | $ hg unshelve -q dummy |
|
|||
564 | $ hg revert a/a |
|
|||
565 |
|
||||
566 | #endif |
|
|||
567 |
|
||||
568 | set up another conflict between a commit and a shelved change |
|
|||
569 |
|
||||
570 | $ hg revert -q -C -a |
|
|||
571 | $ rm a/a.orig b.rename/b c.copy |
|
|||
572 | $ echo a >> a/a |
|
|||
573 | $ hg shelve -q |
|
|||
574 | $ echo x >> a/a |
|
|||
575 | $ hg ci -m 'create conflict' |
|
|||
576 | $ hg add foo/foo |
|
|||
577 |
|
||||
578 | if we resolve a conflict while unshelving, the unshelve should succeed |
|
|||
579 |
|
||||
580 | $ hg unshelve --tool :merge-other --keep |
|
|||
581 | unshelving change 'default' |
|
|||
582 | temporarily committing pending changes (restore with 'hg unshelve --abort') |
|
|||
583 | rebasing shelved changes |
|
|||
584 | merging a/a |
|
|||
585 | $ hg parents -q |
|
|||
586 | (4|13):33f7f61e6c5e (re) |
|
|||
587 | $ hg shelve -l |
|
|||
588 | default (*)* changes to: second (glob) |
|
|||
589 | $ hg status |
|
|||
590 | M a/a |
|
|||
591 | A foo/foo |
|
|||
592 | $ cat a/a |
|
|||
593 | a |
|
|||
594 | c |
|
|||
595 | a |
|
|||
596 | $ cat > a/a << EOF |
|
|||
597 | > a |
|
|||
598 | > c |
|
|||
599 | > x |
|
|||
600 | > EOF |
|
|||
601 |
|
||||
602 | $ HGMERGE=true hg unshelve |
|
|||
603 | unshelving change 'default' |
|
|||
604 | temporarily committing pending changes (restore with 'hg unshelve --abort') |
|
|||
605 | rebasing shelved changes |
|
|||
606 | merging a/a |
|
|||
607 | note: unshelved changes already existed in the working copy |
|
|||
608 | $ hg parents -q |
|
|||
609 | (4|13):33f7f61e6c5e (re) |
|
|||
610 | $ hg shelve -l |
|
|||
611 | $ hg status |
|
|||
612 | A foo/foo |
|
|||
613 | $ cat a/a |
|
|||
614 | a |
|
|||
615 | c |
|
|||
616 | x |
|
|||
617 |
|
||||
618 | test keep and cleanup |
|
|||
619 |
|
||||
620 | $ hg shelve |
|
|||
621 | shelved as default |
|
|||
622 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
|||
623 | $ hg shelve --list |
|
|||
624 | default (*)* changes to: create conflict (glob) |
|
|||
625 | $ hg unshelve -k |
|
|||
626 | unshelving change 'default' |
|
|||
627 | $ hg shelve --list |
|
|||
628 | default (*)* changes to: create conflict (glob) |
|
|||
629 | $ hg shelve --cleanup |
|
|||
630 | $ hg shelve --list |
|
|||
631 |
|
||||
632 | $ hg shelve --cleanup --delete |
|
|||
633 | abort: options '--cleanup' and '--delete' may not be used together |
|
|||
634 | [255] |
|
|||
635 | $ hg shelve --cleanup --patch |
|
|||
636 | abort: options '--cleanup' and '--patch' may not be used together |
|
|||
637 | [255] |
|
|||
638 | $ hg shelve --cleanup --message MESSAGE |
|
|||
639 | abort: options '--cleanup' and '--message' may not be used together |
|
|||
640 | [255] |
|
|||
641 |
|
||||
642 | test bookmarks |
|
|||
643 |
|
||||
644 | $ hg bookmark test |
|
|||
645 | $ hg bookmark |
|
|||
646 | \* test (4|13):33f7f61e6c5e (re) |
|
|||
647 | $ hg shelve |
|
|||
648 | shelved as test |
|
|||
649 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
|||
650 | $ hg bookmark |
|
|||
651 | \* test (4|13):33f7f61e6c5e (re) |
|
|||
652 | $ hg unshelve |
|
|||
653 | unshelving change 'test' |
|
|||
654 | $ hg bookmark |
|
|||
655 | \* test (4|13):33f7f61e6c5e (re) |
|
|||
656 |
|
||||
657 | shelve should still work even if mq is disabled |
|
|||
658 |
|
||||
659 | $ hg --config extensions.mq=! shelve |
|
|||
660 | shelved as test |
|
|||
661 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
|||
662 | $ hg --config extensions.mq=! shelve --list |
|
|||
663 | test (*)* changes to: create conflict (glob) |
|
|||
664 | $ hg bookmark |
|
|||
665 | \* test (4|13):33f7f61e6c5e (re) |
|
|||
666 | $ hg --config extensions.mq=! unshelve |
|
|||
667 | unshelving change 'test' |
|
|||
668 | $ hg bookmark |
|
|||
669 | \* test (4|13):33f7f61e6c5e (re) |
|
|||
670 |
|
||||
671 | shelve should leave dirstate clean (issue4055) |
|
23 | shelve should leave dirstate clean (issue4055) | |
672 |
|
24 | |||
673 | $ cd .. |
|
|||
674 | $ hg init shelverebase |
|
25 | $ hg init shelverebase | |
675 | $ cd shelverebase |
|
26 | $ cd shelverebase | |
676 | $ printf 'x\ny\n' > x |
|
27 | $ printf 'x\ny\n' > x | |
@@ -927,220 +278,6 b' unshelve and conflicts with tracked and ' | |||||
927 | $ cat f.orig |
|
278 | $ cat f.orig | |
928 | g |
|
279 | g | |
929 | $ hg shelve --delete default |
|
280 | $ hg shelve --delete default | |
930 |
|
||||
931 | Recreate some conflict again |
|
|||
932 |
|
||||
933 | $ cd ../repo |
|
|||
934 | $ hg up -C -r 2e69b451d1ea |
|
|||
935 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
936 | (leaving bookmark test) |
|
|||
937 | $ echo y >> a/a |
|
|||
938 | $ hg shelve |
|
|||
939 | shelved as default |
|
|||
940 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
941 | $ hg up test |
|
|||
942 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
943 | (activating bookmark test) |
|
|||
944 | $ hg bookmark |
|
|||
945 | \* test (4|13):33f7f61e6c5e (re) |
|
|||
946 | $ hg unshelve |
|
|||
947 | unshelving change 'default' |
|
|||
948 | rebasing shelved changes |
|
|||
949 | merging a/a |
|
|||
950 | warning: conflicts while merging a/a! (edit, then use 'hg resolve --mark') |
|
|||
951 | unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') |
|
|||
952 | [1] |
|
|||
953 | $ hg bookmark |
|
|||
954 | test (4|13):33f7f61e6c5e (re) |
|
|||
955 |
|
||||
956 | Test that resolving all conflicts in one direction (so that the rebase |
|
|||
957 | is a no-op), works (issue4398) |
|
|||
958 |
|
||||
959 | $ hg revert -a -r . |
|
|||
960 | reverting a/a |
|
|||
961 | $ hg resolve -m a/a |
|
|||
962 | (no more unresolved files) |
|
|||
963 | continue: hg unshelve --continue |
|
|||
964 | $ hg unshelve -c |
|
|||
965 | note: unshelved changes already existed in the working copy |
|
|||
966 | unshelve of 'default' complete |
|
|||
967 | $ hg bookmark |
|
|||
968 | \* test (4|13):33f7f61e6c5e (re) |
|
|||
969 | $ hg diff |
|
|||
970 | $ hg status |
|
|||
971 | ? a/a.orig |
|
|||
972 | ? foo/foo |
|
|||
973 | $ hg summary |
|
|||
974 | parent: (4|13):33f7f61e6c5e tip (re) |
|
|||
975 | create conflict |
|
|||
976 | branch: default |
|
|||
977 | bookmarks: *test |
|
|||
978 | commit: 2 unknown (clean) |
|
|||
979 | update: (current) |
|
|||
980 | phases: 5 draft |
|
|||
981 |
|
||||
982 | $ hg shelve --delete --stat |
|
|||
983 | abort: options '--delete' and '--stat' may not be used together |
|
|||
984 | [255] |
|
|||
985 | $ hg shelve --delete --name NAME |
|
|||
986 | abort: options '--delete' and '--name' may not be used together |
|
|||
987 | [255] |
|
|||
988 |
|
||||
989 | Test interactive shelve |
|
|||
990 | $ cat <<EOF >> $HGRCPATH |
|
|||
991 | > [ui] |
|
|||
992 | > interactive = true |
|
|||
993 | > EOF |
|
|||
994 | $ echo 'a' >> a/b |
|
|||
995 | $ cat a/a >> a/b |
|
|||
996 | $ echo 'x' >> a/b |
|
|||
997 | $ mv a/b a/a |
|
|||
998 | $ echo 'a' >> foo/foo |
|
|||
999 | $ hg st |
|
|||
1000 | M a/a |
|
|||
1001 | ? a/a.orig |
|
|||
1002 | ? foo/foo |
|
|||
1003 | $ cat a/a |
|
|||
1004 | a |
|
|||
1005 | a |
|
|||
1006 | c |
|
|||
1007 | x |
|
|||
1008 | x |
|
|||
1009 | $ cat foo/foo |
|
|||
1010 | foo |
|
|||
1011 | a |
|
|||
1012 | $ hg shelve --interactive --config ui.interactive=false |
|
|||
1013 | abort: running non-interactively |
|
|||
1014 | [255] |
|
|||
1015 | $ hg shelve --interactive << EOF |
|
|||
1016 | > y |
|
|||
1017 | > y |
|
|||
1018 | > n |
|
|||
1019 | > EOF |
|
|||
1020 | diff --git a/a/a b/a/a |
|
|||
1021 | 2 hunks, 2 lines changed |
|
|||
1022 | examine changes to 'a/a'? [Ynesfdaq?] y |
|
|||
1023 |
|
||||
1024 | @@ -1,3 +1,4 @@ |
|
|||
1025 | +a |
|
|||
1026 | a |
|
|||
1027 | c |
|
|||
1028 | x |
|
|||
1029 | record change 1/2 to 'a/a'? [Ynesfdaq?] y |
|
|||
1030 |
|
||||
1031 | @@ -1,3 +2,4 @@ |
|
|||
1032 | a |
|
|||
1033 | c |
|
|||
1034 | x |
|
|||
1035 | +x |
|
|||
1036 | record change 2/2 to 'a/a'? [Ynesfdaq?] n |
|
|||
1037 |
|
||||
1038 | shelved as test |
|
|||
1039 | merging a/a |
|
|||
1040 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
|||
1041 | $ cat a/a |
|
|||
1042 | a |
|
|||
1043 | c |
|
|||
1044 | x |
|
|||
1045 | x |
|
|||
1046 | $ cat foo/foo |
|
|||
1047 | foo |
|
|||
1048 | a |
|
|||
1049 | $ hg st |
|
|||
1050 | M a/a |
|
|||
1051 | ? foo/foo |
|
|||
1052 | $ hg bookmark |
|
|||
1053 | \* test (4|13):33f7f61e6c5e (re) |
|
|||
1054 | $ hg unshelve |
|
|||
1055 | unshelving change 'test' |
|
|||
1056 | temporarily committing pending changes (restore with 'hg unshelve --abort') |
|
|||
1057 | rebasing shelved changes |
|
|||
1058 | merging a/a |
|
|||
1059 | $ hg bookmark |
|
|||
1060 | \* test (4|13):33f7f61e6c5e (re) |
|
|||
1061 | $ cat a/a |
|
|||
1062 | a |
|
|||
1063 | a |
|
|||
1064 | c |
|
|||
1065 | x |
|
|||
1066 | x |
|
|||
1067 |
|
||||
1068 | shelve --patch and shelve --stat should work with valid shelfnames |
|
|||
1069 |
|
||||
1070 | $ hg up --clean . |
|
|||
1071 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
1072 | (leaving bookmark test) |
|
|||
1073 | $ hg shelve --list |
|
|||
1074 | $ echo 'patch a' > shelf-patch-a |
|
|||
1075 | $ hg add shelf-patch-a |
|
|||
1076 | $ hg shelve |
|
|||
1077 | shelved as default |
|
|||
1078 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
|||
1079 | $ echo 'patch b' > shelf-patch-b |
|
|||
1080 | $ hg add shelf-patch-b |
|
|||
1081 | $ hg shelve |
|
|||
1082 | shelved as default-01 |
|
|||
1083 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
|||
1084 | $ hg shelve --patch default default-01 |
|
|||
1085 | default-01 (*)* changes to: create conflict (glob) |
|
|||
1086 |
|
||||
1087 | diff --git a/shelf-patch-b b/shelf-patch-b |
|
|||
1088 | new file mode 100644 |
|
|||
1089 | --- /dev/null |
|
|||
1090 | +++ b/shelf-patch-b |
|
|||
1091 | @@ -0,0 +1,1 @@ |
|
|||
1092 | +patch b |
|
|||
1093 | default (*)* changes to: create conflict (glob) |
|
|||
1094 |
|
||||
1095 | diff --git a/shelf-patch-a b/shelf-patch-a |
|
|||
1096 | new file mode 100644 |
|
|||
1097 | --- /dev/null |
|
|||
1098 | +++ b/shelf-patch-a |
|
|||
1099 | @@ -0,0 +1,1 @@ |
|
|||
1100 | +patch a |
|
|||
1101 | $ hg shelve --stat default default-01 |
|
|||
1102 | default-01 (*)* changes to: create conflict (glob) |
|
|||
1103 | shelf-patch-b | 1 + |
|
|||
1104 | 1 files changed, 1 insertions(+), 0 deletions(-) |
|
|||
1105 | default (*)* changes to: create conflict (glob) |
|
|||
1106 | shelf-patch-a | 1 + |
|
|||
1107 | 1 files changed, 1 insertions(+), 0 deletions(-) |
|
|||
1108 | $ hg shelve --patch default |
|
|||
1109 | default (*)* changes to: create conflict (glob) |
|
|||
1110 |
|
||||
1111 | diff --git a/shelf-patch-a b/shelf-patch-a |
|
|||
1112 | new file mode 100644 |
|
|||
1113 | --- /dev/null |
|
|||
1114 | +++ b/shelf-patch-a |
|
|||
1115 | @@ -0,0 +1,1 @@ |
|
|||
1116 | +patch a |
|
|||
1117 | $ hg shelve --stat default |
|
|||
1118 | default (*)* changes to: create conflict (glob) |
|
|||
1119 | shelf-patch-a | 1 + |
|
|||
1120 | 1 files changed, 1 insertions(+), 0 deletions(-) |
|
|||
1121 | $ hg shelve --patch nonexistentshelf |
|
|||
1122 | abort: cannot find shelf nonexistentshelf |
|
|||
1123 | [255] |
|
|||
1124 | $ hg shelve --stat nonexistentshelf |
|
|||
1125 | abort: cannot find shelf nonexistentshelf |
|
|||
1126 | [255] |
|
|||
1127 | $ hg shelve --patch default nonexistentshelf |
|
|||
1128 | abort: cannot find shelf nonexistentshelf |
|
|||
1129 | [255] |
|
|||
1130 |
|
||||
1131 | when the user asks for a patch, we assume they want the most recent shelve if |
|
|||
1132 | they don't provide a shelve name |
|
|||
1133 |
|
||||
1134 | $ hg shelve --patch |
|
|||
1135 | default-01 (*)* changes to: create conflict (glob) |
|
|||
1136 |
|
||||
1137 | diff --git a/shelf-patch-b b/shelf-patch-b |
|
|||
1138 | new file mode 100644 |
|
|||
1139 | --- /dev/null |
|
|||
1140 | +++ b/shelf-patch-b |
|
|||
1141 | @@ -0,0 +1,1 @@ |
|
|||
1142 | +patch b |
|
|||
1143 |
|
||||
1144 | $ cd .. |
|
281 | $ cd .. | |
1145 |
|
282 | |||
1146 | you shouldn't be able to ask for the patch/stats of the most recent shelve if |
|
283 | you shouldn't be able to ask for the patch/stats of the most recent shelve if | |
@@ -1158,175 +295,6 b' there are no shelves' | |||||
1158 |
|
295 | |||
1159 | $ cd .. |
|
296 | $ cd .. | |
1160 |
|
297 | |||
1161 | Shelve from general delta repo uses bundle2 on disk |
|
|||
1162 | -------------------------------------------------- |
|
|||
1163 |
|
||||
1164 | no general delta |
|
|||
1165 |
|
||||
1166 | $ hg clone --pull repo bundle1 --config format.usegeneraldelta=0 |
|
|||
1167 | requesting all changes |
|
|||
1168 | adding changesets |
|
|||
1169 | adding manifests |
|
|||
1170 | adding file changes |
|
|||
1171 | added 5 changesets with 8 changes to 6 files |
|
|||
1172 | new changesets cc01e2b0c59f:33f7f61e6c5e |
|
|||
1173 | updating to branch default |
|
|||
1174 | 6 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
1175 | $ cd bundle1 |
|
|||
1176 | $ echo babar > jungle |
|
|||
1177 | $ hg add jungle |
|
|||
1178 | $ hg shelve |
|
|||
1179 | shelved as default |
|
|||
1180 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
|||
1181 | $ hg debugbundle .hg/shelved/*.hg |
|
|||
1182 | 330882a04d2ce8487636b1fb292e5beea77fa1e3 |
|
|||
1183 | $ cd .. |
|
|||
1184 |
|
||||
1185 | with general delta |
|
|||
1186 |
|
||||
1187 | $ hg clone --pull repo bundle2 --config format.usegeneraldelta=1 |
|
|||
1188 | requesting all changes |
|
|||
1189 | adding changesets |
|
|||
1190 | adding manifests |
|
|||
1191 | adding file changes |
|
|||
1192 | added 5 changesets with 8 changes to 6 files |
|
|||
1193 | new changesets cc01e2b0c59f:33f7f61e6c5e |
|
|||
1194 | updating to branch default |
|
|||
1195 | 6 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
1196 | $ cd bundle2 |
|
|||
1197 | $ echo babar > jungle |
|
|||
1198 | $ hg add jungle |
|
|||
1199 | $ hg shelve |
|
|||
1200 | shelved as default |
|
|||
1201 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
|||
1202 | $ hg debugbundle .hg/shelved/*.hg |
|
|||
1203 | Stream params: {Compression: BZ} |
|
|||
1204 | changegroup -- {nbchanges: 1, version: 02} (mandatory: True) |
|
|||
1205 | 330882a04d2ce8487636b1fb292e5beea77fa1e3 |
|
|||
1206 | $ cd .. |
|
|||
1207 |
|
||||
1208 | Test visibility of in-memory changes inside transaction to external hook |
|
|||
1209 | ------------------------------------------------------------------------ |
|
|||
1210 |
|
||||
1211 | $ cd repo |
|
|||
1212 |
|
||||
1213 | $ echo xxxx >> x |
|
|||
1214 | $ hg commit -m "#5: changes to invoke rebase" |
|
|||
1215 |
|
||||
1216 | $ cat > $TESTTMP/checkvisibility.sh <<EOF |
|
|||
1217 | > echo "==== \$1:" |
|
|||
1218 | > hg parents --template "VISIBLE {rev}:{node|short}\n" |
|
|||
1219 | > # test that pending changes are hidden |
|
|||
1220 | > unset HG_PENDING |
|
|||
1221 | > hg parents --template "ACTUAL {rev}:{node|short}\n" |
|
|||
1222 | > echo "====" |
|
|||
1223 | > EOF |
|
|||
1224 |
|
||||
1225 | $ cat >> .hg/hgrc <<EOF |
|
|||
1226 | > [defaults] |
|
|||
1227 | > # to fix hash id of temporary revisions |
|
|||
1228 | > unshelve = --date '0 0' |
|
|||
1229 | > EOF |
|
|||
1230 |
|
||||
1231 | "hg unshelve" at REV5 implies steps below: |
|
|||
1232 |
|
||||
1233 | (1) commit changes in the working directory (REV6) |
|
|||
1234 | (2) unbundle shelved revision (REV7) |
|
|||
1235 | (3) rebase: merge REV7 into REV6 (REV6 => REV6, REV7) |
|
|||
1236 | (4) rebase: commit merged revision (REV8) |
|
|||
1237 | (5) rebase: update to REV6 (REV8 => REV6) |
|
|||
1238 | (6) update to REV5 (REV6 => REV5) |
|
|||
1239 | (7) abort transaction |
|
|||
1240 |
|
||||
1241 | == test visibility to external preupdate hook |
|
|||
1242 |
|
||||
1243 | $ cat >> .hg/hgrc <<EOF |
|
|||
1244 | > [hooks] |
|
|||
1245 | > preupdate.visibility = sh $TESTTMP/checkvisibility.sh preupdate |
|
|||
1246 | > EOF |
|
|||
1247 |
|
||||
1248 | $ echo nnnn >> n |
|
|||
1249 |
|
||||
1250 | $ sh $TESTTMP/checkvisibility.sh before-unshelving |
|
|||
1251 | ==== before-unshelving: |
|
|||
1252 | VISIBLE (5|19):703117a2acfb (re) |
|
|||
1253 | ACTUAL (5|19):703117a2acfb (re) |
|
|||
1254 | ==== |
|
|||
1255 |
|
||||
1256 | $ hg unshelve --keep default |
|
|||
1257 | temporarily committing pending changes (restore with 'hg unshelve --abort') |
|
|||
1258 | rebasing shelved changes |
|
|||
1259 | ==== preupdate: |
|
|||
1260 | VISIBLE (6|20):54c00d20fb3f (re) |
|
|||
1261 | ACTUAL (5|19):703117a2acfb (re) |
|
|||
1262 | ==== |
|
|||
1263 | ==== preupdate: |
|
|||
1264 | VISIBLE (8|21):8efe6f7537dc (re) |
|
|||
1265 | ACTUAL (5|19):703117a2acfb (re) |
|
|||
1266 | ==== |
|
|||
1267 | ==== preupdate: |
|
|||
1268 | VISIBLE (6|20):54c00d20fb3f (re) |
|
|||
1269 | ACTUAL (5|19):703117a2acfb (re) |
|
|||
1270 | ==== |
|
|||
1271 |
|
||||
1272 | $ cat >> .hg/hgrc <<EOF |
|
|||
1273 | > [hooks] |
|
|||
1274 | > preupdate.visibility = |
|
|||
1275 | > EOF |
|
|||
1276 |
|
||||
1277 | $ sh $TESTTMP/checkvisibility.sh after-unshelving |
|
|||
1278 | ==== after-unshelving: |
|
|||
1279 | VISIBLE (5|19):703117a2acfb (re) |
|
|||
1280 | ACTUAL (5|19):703117a2acfb (re) |
|
|||
1281 | ==== |
|
|||
1282 |
|
||||
1283 | == test visibility to external update hook |
|
|||
1284 |
|
||||
1285 | $ hg update -q -C 703117a2acfb |
|
|||
1286 |
|
||||
1287 | $ cat >> .hg/hgrc <<EOF |
|
|||
1288 | > [hooks] |
|
|||
1289 | > update.visibility = sh $TESTTMP/checkvisibility.sh update |
|
|||
1290 | > EOF |
|
|||
1291 |
|
||||
1292 | $ echo nnnn >> n |
|
|||
1293 |
|
||||
1294 | $ sh $TESTTMP/checkvisibility.sh before-unshelving |
|
|||
1295 | ==== before-unshelving: |
|
|||
1296 | VISIBLE (5|19):703117a2acfb (re) |
|
|||
1297 | ACTUAL (5|19):703117a2acfb (re) |
|
|||
1298 | ==== |
|
|||
1299 |
|
||||
1300 | $ hg unshelve --keep default |
|
|||
1301 | temporarily committing pending changes (restore with 'hg unshelve --abort') |
|
|||
1302 | rebasing shelved changes |
|
|||
1303 | ==== update: |
|
|||
1304 | VISIBLE (6|20):54c00d20fb3f (re) |
|
|||
1305 | VISIBLE 1?7:492ed9d705e5 (re) |
|
|||
1306 | ACTUAL (5|19):703117a2acfb (re) |
|
|||
1307 | ==== |
|
|||
1308 | ==== update: |
|
|||
1309 | VISIBLE (6|20):54c00d20fb3f (re) |
|
|||
1310 | ACTUAL (5|19):703117a2acfb (re) |
|
|||
1311 | ==== |
|
|||
1312 | ==== update: |
|
|||
1313 | VISIBLE (5|19):703117a2acfb (re) |
|
|||
1314 | ACTUAL (5|19):703117a2acfb (re) |
|
|||
1315 | ==== |
|
|||
1316 |
|
||||
1317 | $ cat >> .hg/hgrc <<EOF |
|
|||
1318 | > [hooks] |
|
|||
1319 | > update.visibility = |
|
|||
1320 | > EOF |
|
|||
1321 |
|
||||
1322 | $ sh $TESTTMP/checkvisibility.sh after-unshelving |
|
|||
1323 | ==== after-unshelving: |
|
|||
1324 | VISIBLE (5|19):703117a2acfb (re) |
|
|||
1325 | ACTUAL (5|19):703117a2acfb (re) |
|
|||
1326 | ==== |
|
|||
1327 |
|
||||
1328 | $ cd .. |
|
|||
1329 |
|
||||
1330 | test .orig files go where the user wants them to |
|
298 | test .orig files go where the user wants them to | |
1331 | --------------------------------------------------------------- |
|
299 | --------------------------------------------------------------- | |
1332 | $ hg init salvage |
|
300 | $ hg init salvage | |
@@ -1364,43 +332,6 b' with a corrupted shelve state file' | |||||
1364 |
|
332 | |||
1365 | $ cd .. |
|
333 | $ cd .. | |
1366 |
|
334 | |||
1367 | Keep active bookmark while (un)shelving even on shared repo (issue4940) |
|
|||
1368 | ----------------------------------------------------------------------- |
|
|||
1369 |
|
||||
1370 | $ cat <<EOF >> $HGRCPATH |
|
|||
1371 | > [extensions] |
|
|||
1372 | > share = |
|
|||
1373 | > EOF |
|
|||
1374 |
|
||||
1375 | $ hg bookmarks -R repo |
|
|||
1376 | test (4|13):33f7f61e6c5e (re) |
|
|||
1377 | $ hg share -B repo share |
|
|||
1378 | updating working directory |
|
|||
1379 | 6 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
1380 | $ cd share |
|
|||
1381 |
|
||||
1382 | $ hg bookmarks |
|
|||
1383 | test (4|13):33f7f61e6c5e (re) |
|
|||
1384 | $ hg bookmarks foo |
|
|||
1385 | $ hg bookmarks |
|
|||
1386 | \* foo (5|19):703117a2acfb (re) |
|
|||
1387 | test (4|13):33f7f61e6c5e (re) |
|
|||
1388 | $ echo x >> x |
|
|||
1389 | $ hg shelve |
|
|||
1390 | shelved as foo |
|
|||
1391 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
1392 | $ hg bookmarks |
|
|||
1393 | \* foo (5|19):703117a2acfb (re) |
|
|||
1394 | test (4|13):33f7f61e6c5e (re) |
|
|||
1395 |
|
||||
1396 | $ hg unshelve |
|
|||
1397 | unshelving change 'foo' |
|
|||
1398 | $ hg bookmarks |
|
|||
1399 | \* foo (5|19):703117a2acfb (re) |
|
|||
1400 | test (4|13):33f7f61e6c5e (re) |
|
|||
1401 |
|
||||
1402 | $ cd .. |
|
|||
1403 |
|
||||
1404 | Shelve and unshelve unknown files. For the purposes of unshelve, a shelved |
|
335 | Shelve and unshelve unknown files. For the purposes of unshelve, a shelved | |
1405 | unknown file is the same as a shelved added file, except that it will be in |
|
336 | unknown file is the same as a shelved added file, except that it will be in | |
1406 | unknown state after unshelve if and only if it was either absent or unknown |
|
337 | unknown state after unshelve if and only if it was either absent or unknown |
General Comments 0
You need to be logged in to leave comments.
Login now