# HG changeset patch # User Pierre-Yves David # Date 1471209429 -7200 # Node ID 3c4a20244771196e1fa5f7883dc31e01285cde92 # Parent bee7a1ef8ba898bc3333ff0072254bc910a53e8d destination: use the correct abort class for error These errors have been in Mercurial long enough. Having them will make the coming changesets simpler. diff -r bee7a1ef8ba8 -r 3c4a20244771 hgext3rd/topic/destination.py --- a/hgext3rd/topic/destination.py Sun Aug 14 19:40:53 2016 +0200 +++ b/hgext3rd/topic/destination.py Sun Aug 14 23:17:09 2016 +0200 @@ -22,14 +22,15 @@ # should look at all branch involved but... later bhead = ngtip(repo, p1.branch(), all=True) if not bhead: - raise error.Abort(_("nothing to merge")) + raise error.NoMergeDestAbort(_("nothing to merge")) elif 1 == len(bhead): return bhead.first() else: - raise error.Abort(_("branch '%s' has %d heads - " - "please merge with an explicit rev") - % (p1.branch(), len(bhead)), - hint=_("run 'hg heads .' to see heads")) + msg = _("branch '%s' has %d heads " + "- please merge with an explicit rev") + hint = _("run 'hg heads .' to see heads") + raise error.ManyMergeDestAbort(msg % (p1.branch(), len(bhead)), + hint=hint) elif 2 == len(heads): heads = [r for r in heads if r != p1.rev()] # XXX: bla bla bla bla bla @@ -39,9 +40,9 @@ "explicit revision")) return heads[0] elif 2 < len(heads): - raise error.Abort(_("topic '%s' has %d heads - " - "please merge with an explicit rev") - % (top, len(heads))) + msg = _("topic '%s' has %d heads " + "- please merge with an explicit rev") % (top, len(heads)) + raise error.ManyMergeDestAbort(msg) else: assert False # that's impossible if len(getattr(orig, 'func_defaults', ())) == 3: # version hg-3.7