diff hgext/strip.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 80c5b2666a96
children bcace0fbb4c8
line wrap: on
line diff
--- a/hgext/strip.py	Mon Oct 05 22:49:24 2015 -0700
+++ b/hgext/strip.py	Thu Oct 08 12:55:45 2015 -0700
@@ -6,7 +6,7 @@
 from mercurial.i18n import _
 from mercurial.node import nullid
 from mercurial.lock import release
-from mercurial import cmdutil, hg, scmutil, util
+from mercurial import cmdutil, hg, scmutil, util, error
 from mercurial import repair, bookmarks, merge
 
 cmdtable = {}
@@ -38,10 +38,10 @@
     if not force:
         if s.modified or s.added or s.removed or s.deleted:
             _("local changes found") # i18n tool detection
-            raise util.Abort(_("local changes found" + excsuffix))
+            raise error.Abort(_("local changes found" + excsuffix))
         if checksubstate(repo):
             _("local changed subrepos found") # i18n tool detection
-            raise util.Abort(_("local changed subrepos found" + excsuffix))
+            raise error.Abort(_("local changed subrepos found" + excsuffix))
     return s
 
 def strip(ui, repo, revs, update=True, backup=True, force=None, bookmark=None):
@@ -131,7 +131,7 @@
             mark = opts.get('bookmark')
             marks = repo._bookmarks
             if mark not in marks:
-                raise util.Abort(_("bookmark '%s' not found") % mark)
+                raise error.Abort(_("bookmark '%s' not found") % mark)
 
             # If the requested bookmark is not the only one pointing to a
             # a revision we have to only delete the bookmark and not strip
@@ -153,7 +153,7 @@
                 ui.write(_("bookmark '%s' deleted\n") % mark)
 
         if not revs:
-            raise util.Abort(_('empty revision set'))
+            raise error.Abort(_('empty revision set'))
 
         descendants = set(cl.descendants(revs))
         strippedrevs = revs.union(descendants)