mercurial/commands.py
changeset 42579 b8d54f4625cb
parent 42568 f9da9d5f3f5a
child 42580 eb7bd7d64a9d
--- a/mercurial/commands.py	Mon Jul 08 15:01:18 2019 -0700
+++ b/mercurial/commands.py	Tue Jul 09 12:58:29 2019 +0300
@@ -3952,6 +3952,10 @@
     if abort and repo.dirstate.p2() == nullid:
         cmdutil.wrongtooltocontinue(repo, _('merge'))
     if abort:
+        state = cmdutil.getunfinishedstate(repo)
+        if state and state._opname != 'merge':
+            raise error.Abort(_('cannot abort merge with %s in progress') %
+                                (state._opname), hint=state.hint())
         if node:
             raise error.Abort(_("cannot specify a node with --abort"))
         if opts.get('rev'):