diff hgext/convert/darcs.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 baea47cafe75
children aaa33ec3c951
line wrap: on
line diff
--- a/hgext/convert/darcs.py	Mon Oct 05 22:49:24 2015 -0700
+++ b/hgext/convert/darcs.py	Thu Oct 08 12:55:45 2015 -0700
@@ -7,7 +7,7 @@
 
 from common import NoRepo, checktool, commandline, commit, converter_source
 from mercurial.i18n import _
-from mercurial import util
+from mercurial import util, error
 import os, shutil, tempfile, re, errno
 
 # The naming drift of ElementTree is fun!
@@ -39,11 +39,11 @@
         checktool('darcs')
         version = self.run0('--version').splitlines()[0].strip()
         if version < '2.1':
-            raise util.Abort(_('darcs version 2.1 or newer needed (found %r)') %
-                             version)
+            raise error.Abort(_('darcs version 2.1 or newer needed (found %r)')
+                              % version)
 
         if "ElementTree" not in globals():
-            raise util.Abort(_("Python ElementTree module is not available"))
+            raise error.Abort(_("Python ElementTree module is not available"))
 
         self.path = os.path.realpath(path)
 
@@ -158,7 +158,7 @@
 
     def getchanges(self, rev, full):
         if full:
-            raise util.Abort(_("convert from darcs do not support --full"))
+            raise error.Abort(_("convert from darcs do not support --full"))
         copies = {}
         changes = []
         man = None
@@ -192,7 +192,7 @@
 
     def getfile(self, name, rev):
         if rev != self.lastrev:
-            raise util.Abort(_('internal calling inconsistency'))
+            raise error.Abort(_('internal calling inconsistency'))
         path = os.path.join(self.tmppath, name)
         try:
             data = util.readfile(path)