diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -239,7 +239,7 @@ return newchunks, newopts def dorecord(ui, repo, commitfunc, cmdsuggest, backupall, - filterfn, *pats, **opts): + filterfn, allowunfinished=False, *pats, **opts): opts = pycompat.byteskwargs(opts) if not ui.interactive(): if cmdsuggest: @@ -265,8 +265,13 @@ In the end we'll record interesting changes, and everything else will be left in place, so the user can continue working. + + We will prevent committing changesets on unfinished states if and only + if `allowunfinished` is not set `True`. For example, `unshelve` on + interactive mode does a commit during an unfinished state and we don't + want to prevent that. """ - if not opts.get('interactive-unshelve'): + if not allowunfinished: checkunfinished(repo, commit=True) wctx = repo[None] merge = len(wctx.parents()) > 1 diff --git a/mercurial/shelve.py b/mercurial/shelve.py --- a/mercurial/shelve.py +++ b/mercurial/shelve.py @@ -824,7 +824,6 @@ bool to know whether the shelve is partly done or completely done. """ opts['message'] = shelvectx.description() - opts['interactive-unshelve'] = True pats = [] if not interactive: newnode = repo.commit(text=shelvectx.description(), @@ -836,7 +835,7 @@ commitfunc = getcommitfunc(shelvectx.extra(), interactive=True, editor=True) newnode = cmdutil.dorecord(ui, repo, commitfunc, None, False, - cmdutil.recordfilter, *pats, + cmdutil.recordfilter, True, *pats, **pycompat.strkwargs(opts)) snode = repo.commit(text=shelvectx.description(), extra=shelvectx.extra(),