diff -r 9f73620a65fe -r b8d54f4625cb mercurial/commands.py --- 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'):