diff hgext/factotum.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 e8348f1cc228
children bacca31f4835
line wrap: on
line diff
--- a/hgext/factotum.py	Mon Oct 05 22:49:24 2015 -0700
+++ b/hgext/factotum.py	Thu Oct 08 12:55:45 2015 -0700
@@ -47,7 +47,7 @@
 
 from mercurial.i18n import _
 from mercurial.url import passwordmgr
-from mercurial import httpconnection, util
+from mercurial import httpconnection, error
 import os, urllib2
 
 ERRMAX = 128
@@ -56,7 +56,7 @@
 
 def auth_getkey(self, params):
     if not self.ui.interactive():
-        raise util.Abort(_('factotum not interactive'))
+        raise error.Abort(_('factotum not interactive'))
     if 'user=' not in params:
         params = '%s user?' % params
     params = '%s !password?' % params
@@ -77,10 +77,10 @@
                         if passwd.endswith("'"):
                             passwd = passwd[1:-1].replace("''", "'")
                         else:
-                            raise util.Abort(_('malformed password string'))
+                            raise error.Abort(_('malformed password string'))
                     return (user, passwd)
         except (OSError, IOError):
-            raise util.Abort(_('factotum not responding'))
+            raise error.Abort(_('factotum not responding'))
         finally:
             os.close(fd)
         getkey(self, params)