##// END OF EJS Templates
continue: added support for unshelve...
Taapas Agrawal -
r42833:117437f3 default
parent child Browse files
Show More
@@ -6219,6 +6219,7 b' def unshelve(ui, repo, *shelved, **opts)'
6219 statemod.addunfinished(
6219 statemod.addunfinished(
6220 'unshelve', fname='shelvedstate', continueflag=True,
6220 'unshelve', fname='shelvedstate', continueflag=True,
6221 abortfunc=shelvemod.hgabortunshelve,
6221 abortfunc=shelvemod.hgabortunshelve,
6222 continuefunc=shelvemod.hgcontinueunshelve,
6222 cmdmsg=_('unshelve already in progress'),
6223 cmdmsg=_('unshelve already in progress'),
6223 )
6224 )
6224
6225
@@ -751,6 +751,12 b' def unshelvecontinue(ui, repo, state, op'
751 unshelvecleanup(ui, repo, state.name, opts)
751 unshelvecleanup(ui, repo, state.name, opts)
752 ui.status(_("unshelve of '%s' complete\n") % state.name)
752 ui.status(_("unshelve of '%s' complete\n") % state.name)
753
753
754 def hgcontinueunshelve(ui, repo):
755 """logic to resume unshelve using 'hg continue'"""
756 with repo.wlock():
757 state = _loadshelvedstate(ui, repo, {'continue' : True})
758 return unshelvecontinue(ui, repo, state, {'keep' : state.keep})
759
754 def _commitworkingcopychanges(ui, repo, opts, tmpwctx):
760 def _commitworkingcopychanges(ui, repo, opts, tmpwctx):
755 """Temporarily commit working copy changes before moving unshelve commit"""
761 """Temporarily commit working copy changes before moving unshelve commit"""
756 # Store pending changes in a commit and remember added in case a shelve
762 # Store pending changes in a commit and remember added in case a shelve
@@ -1,5 +1,6 b''
1 #testcases stripbased phasebased
1 #testcases stripbased phasebased
2 #testcases abortflag abortcommand
2 #testcases abortflag abortcommand
3 #testcases continueflag continuecommand
3
4
4 $ cat <<EOF >> $HGRCPATH
5 $ cat <<EOF >> $HGRCPATH
5 > [extensions]
6 > [extensions]
@@ -27,6 +28,13 b''
27 > EOF
28 > EOF
28 #endif
29 #endif
29
30
31 #if continueflag
32 $ cat >> $HGRCPATH <<EOF
33 > [alias]
34 > continue = unshelve --continue
35 > EOF
36 #endif
37
30 shelve should leave dirstate clean (issue4055)
38 shelve should leave dirstate clean (issue4055)
31
39
32 $ hg init shelverebase
40 $ hg init shelverebase
@@ -560,7 +568,7 b' will be preserved.'
560 $ hg resolve --mark a
568 $ hg resolve --mark a
561 (no more unresolved files)
569 (no more unresolved files)
562 continue: hg unshelve --continue
570 continue: hg unshelve --continue
563 $ hg unshelve --continue
571 $ hg continue
564 marked working directory as branch test
572 marked working directory as branch test
565 unshelve of 'default' complete
573 unshelve of 'default' complete
566 $ cat a
574 $ cat a
@@ -641,7 +649,13 b' in previous versions) and running unshel'
641 $ hg resolve --mark a
649 $ hg resolve --mark a
642 (no more unresolved files)
650 (no more unresolved files)
643 continue: hg unshelve --continue
651 continue: hg unshelve --continue
644 $ hg unshelve --continue
652
653 #if continuecommand
654 $ hg continue --dry-run
655 unshelve in progress, will be resumed
656 #endif
657
658 $ hg continue
645 unshelve of 'default' complete
659 unshelve of 'default' complete
646 $ cat a
660 $ cat a
647 aaabbbccc
661 aaabbbccc
@@ -704,7 +718,7 b' Prepare unshelve with a corrupted shelve'
704 $ echo somethingsomething > .hg/shelvedstate
718 $ echo somethingsomething > .hg/shelvedstate
705
719
706 Unshelve --continue fails with appropriate message if shelvedstate is corrupted
720 Unshelve --continue fails with appropriate message if shelvedstate is corrupted
707 $ hg unshelve --continue
721 $ hg continue
708 abort: corrupted shelved state file
722 abort: corrupted shelved state file
709 (please run hg unshelve --abort to abort unshelve operation)
723 (please run hg unshelve --abort to abort unshelve operation)
710 [255]
724 [255]
@@ -751,7 +765,7 b' Unshelve respects --keep even if user in'
751 $ hg resolve --mark file
765 $ hg resolve --mark file
752 (no more unresolved files)
766 (no more unresolved files)
753 continue: hg unshelve --continue
767 continue: hg unshelve --continue
754 $ hg unshelve --continue
768 $ hg continue
755 unshelve of 'default' complete
769 unshelve of 'default' complete
756 $ hg shelve --list
770 $ hg shelve --list
757 default (*s ago) * changes to: 1 (glob)
771 default (*s ago) * changes to: 1 (glob)
@@ -822,7 +836,7 b' putting v1 shelvedstate file in place of'
822 (no more unresolved files)
836 (no more unresolved files)
823 continue: hg unshelve --continue
837 continue: hg unshelve --continue
824 mercurial does not crash
838 mercurial does not crash
825 $ hg unshelve --continue
839 $ hg continue
826 unshelve of 'ashelve' complete
840 unshelve of 'ashelve' complete
827
841
828 #if phasebased
842 #if phasebased
General Comments 0
You need to be logged in to leave comments. Login now