diff mercurial/dagparser.py @ 26587:56b2bcea2529

error: get Abort from 'error' instead of 'util' The home of 'Abort' is 'error' not 'util' however, a lot of code seems to be confused about that and gives all the credit to 'util' instead of the hardworking 'error'. In a spirit of equity, we break the cycle of injustice and give back to 'error' the respect it deserves. And screw that 'util' poser. For great justice.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 08 Oct 2015 12:55:45 -0700
parents a75cda2dfc19
children c91013452b33
line wrap: on
line diff
--- a/mercurial/dagparser.py	Mon Oct 05 22:49:24 2015 -0700
+++ b/mercurial/dagparser.py	Thu Oct 08 12:55:45 2015 -0700
@@ -11,7 +11,7 @@
 import string
 
 from .i18n import _
-from . import util
+from . import error
 
 def parsedag(desc):
     '''parses a DAG from a concise textual description; generates events
@@ -269,7 +269,7 @@
                 s += c
                 i += 1
                 c = nextch()
-            raise util.Abort(_('invalid character in dag description: '
+            raise error.Abort(_('invalid character in dag description: '
                                '%s...') % s)
 
 def dagtextlines(events,
@@ -298,13 +298,13 @@
 
                 # sanity check
                 if r != wantr:
-                    raise util.Abort(_("expected id %i, got %i") % (wantr, r))
+                    raise error.Abort(_("expected id %i, got %i") % (wantr, r))
                 if not ps:
                     ps = [-1]
                 else:
                     for p in ps:
                         if p >= r:
-                            raise util.Abort(_("parent id %i is larger than "
+                            raise error.Abort(_("parent id %i is larger than "
                                                "current id %i") % (p, r))
                 wantr += 1
 
@@ -366,7 +366,7 @@
                     yield '#' + data
                     yield '\n'
                 else:
-                    raise util.Abort(_("invalid event type in dag: %s")
+                    raise error.Abort(_("invalid event type in dag: %s")
                                      % str((type, data)))
         if run:
             yield '+' + str(run)