diff mercurial/dispatch.py @ 5869:2c565b9598b8

hooks: fix pre- and post- hooks specified in .hg/hgrc We were looking up hooks in the wrong ui object. Also, we weren't handling hooks to commands without a repo.
author Matt Mackall <mpm@selenic.com>
date Fri, 18 Jan 2008 09:03:17 -0600
parents 863e237b58fb
children b913d3aacddc
line wrap: on
line diff
--- a/mercurial/dispatch.py	Fri Jan 18 08:23:29 2008 -0600
+++ b/mercurial/dispatch.py	Fri Jan 18 09:03:17 2008 -0600
@@ -354,12 +354,12 @@
         d = lambda: func(ui, *args, **cmdoptions)
 
     # run pre-hook, and abort if it fails
-    ret = hook.hook(ui, repo, "pre-%s" % cmd, False, args=" ".join(fullargs))
+    ret = hook.hook(lui, repo, "pre-%s" % cmd, False, args=" ".join(fullargs))
     if ret:
         return ret
     ret = _runcommand(ui, options, cmd, d)
     # run post-hook, passing command result
-    hook.hook(ui, repo, "post-%s" % cmd, False, args=" ".join(fullargs),
+    hook.hook(lui, repo, "post-%s" % cmd, False, args=" ".join(fullargs),
               result = ret)
     return ret