diff mercurial/hook.py @ 23426:19ebd2f88fc7

merge with stable
author Matt Mackall <mpm@selenic.com>
date Mon, 01 Dec 2014 19:34:11 -0600
parents 41c03b7592ed cdbb85489c41
children 2abbf4750915
line wrap: on
line diff
--- a/mercurial/hook.py	Fri Nov 28 20:16:15 2014 +0100
+++ b/mercurial/hook.py	Mon Dec 01 19:34:11 2014 -0600
@@ -7,7 +7,7 @@
 
 from i18n import _
 import os, sys, time
-import extensions, util, demandimport
+import extensions, util, demandimport, error
 
 def _pythonhook(ui, repo, name, hname, funcname, args, throw):
     '''call python hook. hook is callable object, looked up as
@@ -107,7 +107,7 @@
                name, funcname, duration)
     if r:
         if throw:
-            raise util.Abort(_('%s hook failed') % hname)
+            raise error.HookAbort(_('%s hook failed') % hname)
         ui.warn(_('warning: %s hook failed\n') % hname)
     return r
 
@@ -139,7 +139,7 @@
     if r:
         desc, r = util.explainexit(r)
         if throw:
-            raise util.Abort(_('%s hook %s') % (name, desc))
+            raise error.HookAbort(_('%s hook %s') % (name, desc))
         ui.warn(_('warning: %s hook %s\n') % (name, desc))
     return r