diff hgext/largefiles/lfutil.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 ba8089433090
children 832c98d79587
line wrap: on
line diff
--- a/hgext/largefiles/lfutil.py	Mon Oct 05 22:49:24 2015 -0700
+++ b/hgext/largefiles/lfutil.py	Thu Oct 08 12:55:45 2015 -0700
@@ -16,7 +16,7 @@
 
 from mercurial import dirstate, httpconnection, match as match_, util, scmutil
 from mercurial.i18n import _
-from mercurial import node
+from mercurial import node, error
 
 shortname = '.hglf'
 shortnameslash = shortname + '/'
@@ -33,10 +33,10 @@
         try:
             lfsize = float(lfsize)
         except ValueError:
-            raise util.Abort(_('largefiles: size must be number (not %s)\n')
+            raise error.Abort(_('largefiles: size must be number (not %s)\n')
                              % lfsize)
     if lfsize is None:
-        raise util.Abort(_('minimum size for largefiles must be specified'))
+        raise error.Abort(_('minimum size for largefiles must be specified'))
     return lfsize
 
 def link(src, dest):
@@ -74,7 +74,7 @@
                 if home:
                     path = os.path.join(home, '.cache', longname, hash)
         else:
-            raise util.Abort(_('unknown operating system: %s\n') % os.name)
+            raise error.Abort(_('unknown operating system: %s\n') % os.name)
     return path
 
 def inusercache(ui, hash):