diff hgext/relink.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 328739ea70c3
children a95c975f42e3
line wrap: on
line diff
--- a/hgext/relink.py	Mon Oct 05 22:49:24 2015 -0700
+++ b/hgext/relink.py	Thu Oct 08 12:55:45 2015 -0700
@@ -7,7 +7,7 @@
 
 """recreates hardlinks between repository clones"""
 
-from mercurial import cmdutil, hg, util
+from mercurial import cmdutil, hg, util, error
 from mercurial.i18n import _
 import os, stat
 
@@ -47,7 +47,7 @@
     """
     if (not util.safehasattr(util, 'samefile') or
         not util.safehasattr(util, 'samedevice')):
-        raise util.Abort(_('hardlinks are not supported on this system'))
+        raise error.Abort(_('hardlinks are not supported on this system'))
     src = hg.repository(repo.baseui, ui.expandpath(origin or 'default-relink',
                                           origin or 'default'))
     ui.status(_('relinking %s to %s\n') % (src.store.path, repo.store.path))
@@ -57,7 +57,7 @@
 
     if not util.samedevice(src.store.path, repo.store.path):
         # No point in continuing
-        raise util.Abort(_('source and destination are on different devices'))
+        raise error.Abort(_('source and destination are on different devices'))
 
     locallock = repo.lock()
     try:
@@ -114,7 +114,7 @@
             return False
         if not util.samedevice(src, dst):
             # No point in continuing
-            raise util.Abort(
+            raise error.Abort(
                 _('source and destination are on different devices'))
         if st.st_size != ts.st_size:
             return False