Mercurial > hg
comparison mercurial/shelve.py @ 42614:117437f3f541
continue: added support for unshelve
This patch adds the support for `ushelve` in `hg continue` plan.
`hgcontinueunshelve()` has been created for independent calls.
In case an interrupted unshelve is resumed via hg continue the
shelvedstate needs to be loaded seperately. This has been
ensured by `_loadunshelvedstate()`
`hgcontinueunshelve()` is then registered as `continuefunc` for state
detection API.
Results are shown as tests.
Differential Revision: https://phab.mercurial-scm.org/D6652
author | Taapas Agrawal <taapas2897@gmail.com> |
---|---|
date | Wed, 17 Jul 2019 22:24:17 +0530 |
parents | 3fb0493812c0 |
children | 5162753c4c14 |
comparison
equal
deleted
inserted
replaced
42613:35ebdbb38efb | 42614:117437f3f541 |
---|---|
749 _restoreactivebookmark(repo, state.activebookmark) | 749 _restoreactivebookmark(repo, state.activebookmark) |
750 shelvedstate.clear(repo) | 750 shelvedstate.clear(repo) |
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 |
757 # contains unknown files that are part of the pending change | 763 # contains unknown files that are part of the pending change |
758 s = repo.status() | 764 s = repo.status() |