diff mercurial/dispatch.py @ 19011:12acbea17625

dispatch: print 'abort:' when a pre-command hook fails (BC) This also changes the exit code from whatever the hook returned to 255. This brings it in line with all the other hooks that abort.
author Siddharth Agarwal <sid0@fb.com>
date Tue, 16 Apr 2013 14:39:37 -0700
parents e5d9441ec281
children f01ae031f84c
line wrap: on
line diff
--- a/mercurial/dispatch.py	Mon Apr 15 23:31:56 2013 +0200
+++ b/mercurial/dispatch.py	Tue Apr 16 14:39:37 2013 -0700
@@ -511,10 +511,8 @@
 
 def runcommand(lui, repo, cmd, fullargs, ui, options, d, cmdpats, cmdoptions):
     # run pre-hook, and abort if it fails
-    ret = hook.hook(lui, repo, "pre-%s" % cmd, False, args=" ".join(fullargs),
-                    pats=cmdpats, opts=cmdoptions)
-    if ret:
-        return ret
+    hook.hook(lui, repo, "pre-%s" % cmd, True, args=" ".join(fullargs),
+              pats=cmdpats, opts=cmdoptions)
     ret = _runcommand(ui, options, cmd, d)
     # run post-hook, passing command result
     hook.hook(lui, repo, "post-%s" % cmd, False, args=" ".join(fullargs),