diff --git a/mercurial/shelve.py b/mercurial/shelve.py --- a/mercurial/shelve.py +++ b/mercurial/shelve.py @@ -177,6 +177,7 @@ _nokeep = 'nokeep' # colon is essential to differentiate from a real bookmark name _noactivebook = ':no-active-bookmark' + _interactive = 'interactive' @classmethod def _verifyandtransform(cls, d): @@ -247,6 +248,7 @@ obj.activebookmark = '' if d.get('activebook', '') != cls._noactivebook: obj.activebookmark = d.get('activebook', '') + obj.interactive = d.get('interactive') == cls._interactive except (error.RepoLookupError, KeyError) as err: raise error.CorruptedState(pycompat.bytestr(err)) @@ -254,7 +256,7 @@ @classmethod def save(cls, repo, name, originalwctx, pendingctx, nodestoremove, - branchtorestore, keep=False, activebook=''): + branchtorestore, keep=False, activebook='', interactive=False): info = { "name": name, "originalwctx": nodemod.hex(originalwctx.node()), @@ -267,6 +269,8 @@ "keep": cls._keep if keep else cls._nokeep, "activebook": activebook or cls._noactivebook } + if interactive: + info['interactive'] = cls._interactive scmutil.simplekeyvaluefile( repo.vfs, cls._filename).write(info, firstline=("%d" % cls._version)) @@ -698,7 +702,7 @@ """subcommand to continue an in-progress unshelve""" # We're finishing off a merge. First parent is our original # parent, second is the temporary "fake" commit we're unshelving. - interactive = opts.get('interactive') + interactive = state.interactive with repo.lock(): checkparents(repo, state) ms = merge.mergestate.read(repo) @@ -854,7 +858,8 @@ nodestoremove = [repo.changelog.node(rev) for rev in pycompat.xrange(oldtiprev, len(repo))] shelvedstate.save(repo, basename, pctx, tmpwctx, nodestoremove, - branchtorestore, opts.get('keep'), activebookmark) + branchtorestore, opts.get('keep'), activebookmark, + interactive) raise error.InterventionRequired( _("unresolved conflicts (see 'hg resolve', then " "'hg unshelve --continue')"))