evolve: update the abort to a ProgrammingError stable
authorSushil khanchi <sushilkhanchi97@gmail.com>
Tue, 27 Nov 2018 03:46:06 +0100
branchstable
changeset 4269 d2599da04bb5
parent 4265 4d62095d9fe6
child 4270 c8f96f4cb600
child 4272 aab3827bd12c
child 4277 7edc5c148df0
evolve: update the abort to a ProgrammingError This error should be a ProgrammingError and as Pierre-Yves David said ProgrammingError type did not existed when this code was written, so lets update this now.
hgext3rd/evolve/evolvecmd.py
--- a/hgext3rd/evolve/evolvecmd.py	Tue Nov 20 11:33:38 2018 -0500
+++ b/hgext3rd/evolve/evolvecmd.py	Tue Nov 27 03:46:06 2018 +0100
@@ -772,17 +772,18 @@
     returns the node of new commit which is formed
     """
     if orig.rev() == dest.rev():
-        raise error.Abort(_('tried to relocate a node on top of itself'),
-                          hint=_("This shouldn't happen. If you still "
-                                 "need to move changesets, please do so "
-                                 "manually with nothing to rebase - working "
-                                 "directory parent is also destination"))
+        msg = _('tried to relocate a node on top of itself')
+        hint = _("This shouldn't happen. If you still need to move changesets, "
+                 "please do so manually with nothing to rebase - working "
+                 "directory parent is also destination")
+        raise error.ProgrammingError(msg, hint=hint)
 
     if pctx is None:
         if len(orig.parents()) == 2:
-            raise error.Abort(_("tried to relocate a merge commit without "
-                                "specifying which parent should be moved"),
-                              hint=_("Specify the parent by passing in pctx"))
+            msg = _("tried to relocate a merge commit without specifying which "
+                    "parent should be moved")
+            hint = _("Specify the parent by passing in pctx")
+            raise error.ProgrammingError(msg, hint)
         pctx = orig.p1()
 
     commitmsg = orig.description()