Comments
Patch
@@ -3347,13 +3347,28 @@
_('hg graft --continue')),
]
-def checkafterresolved(repo):
- contmsg = _("continue: %s\n")
+def howtocontinue(repo):
+ contmsg = _("continue: %s")
for f, msg in afterresolvedstates:
if repo.vfs.exists(f):
- repo.ui.warn(contmsg % msg)
- return
- repo.ui.note(contmsg % _("hg commit"))
+ return contmsg % msg, repo.ui.warn
+ workingctx = repo[None]
+ if (any(repo.status())
+ or any(workingctx.sub(s).dirty() for s in workingctx.substate)):
+ return contmsg % _("hg commit"), repo.ui.note
+ return None, None
+
+def checkafterresolved(repo):
+ msg, reporter = howtocontinue(repo)
+ if msg is not None and reporter is not None:
+ reporter("%s\n" % msg)
+
+def wrongtooltocontinue(repo, msg):
+ after = howtocontinue(repo)
+ hint = None
+ if after:
+ hint = after[0]
+ raise error.Abort(msg, hint=hint)
class dirstateguard(object):
'''Restore dirstate at unexpected failure.