Mercurial > public > mercurial-scm > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
5868:838fa52abcc1 | 5869:2c565b9598b8 |
---|---|
352 d = lambda: func(ui, repo, *args, **cmdoptions) | 352 d = lambda: func(ui, repo, *args, **cmdoptions) |
353 else: | 353 else: |
354 d = lambda: func(ui, *args, **cmdoptions) | 354 d = lambda: func(ui, *args, **cmdoptions) |
355 | 355 |
356 # run pre-hook, and abort if it fails | 356 # run pre-hook, and abort if it fails |
357 ret = hook.hook(ui, repo, "pre-%s" % cmd, False, args=" ".join(fullargs)) | 357 ret = hook.hook(lui, repo, "pre-%s" % cmd, False, args=" ".join(fullargs)) |
358 if ret: | 358 if ret: |
359 return ret | 359 return ret |
360 ret = _runcommand(ui, options, cmd, d) | 360 ret = _runcommand(ui, options, cmd, d) |
361 # run post-hook, passing command result | 361 # run post-hook, passing command result |
362 hook.hook(ui, repo, "post-%s" % cmd, False, args=" ".join(fullargs), | 362 hook.hook(lui, repo, "post-%s" % cmd, False, args=" ".join(fullargs), |
363 result = ret) | 363 result = ret) |
364 return ret | 364 return ret |
365 | 365 |
366 def _runcommand(ui, options, cmd, cmdfunc): | 366 def _runcommand(ui, options, cmd, cmdfunc): |
367 def checkargs(): | 367 def checkargs(): |