Comments
Patch
@@ -827,7 +827,6 @@
# message.
opts['message'] = ('changes to: %s' %
shelvectx.p1().description().split('\n', 1)[0])
- opts['interactive-unshelve'] = True
pats = []
if not interactive:
newnode = repo.commit(text=shelvectx.description(),
@@ -839,7 +838,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(),
@@ -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