Show More
@@ -354,12 +354,12 b' def _dispatch(ui, args):' | |||
|
354 | 354 | d = lambda: func(ui, *args, **cmdoptions) |
|
355 | 355 | |
|
356 | 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 | 358 | if ret: |
|
359 | 359 | return ret |
|
360 | 360 | ret = _runcommand(ui, options, cmd, d) |
|
361 | 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 | 363 | result = ret) |
|
364 | 364 | return ret |
|
365 | 365 |
@@ -71,7 +71,11 b' def _pythonhook(ui, repo, name, hname, f' | |||
|
71 | 71 | def _exthook(ui, repo, name, cmd, args, throw): |
|
72 | 72 | ui.note(_("running hook %s: %s\n") % (name, cmd)) |
|
73 | 73 | env = dict([('HG_' + k.upper(), v) for k, v in args.iteritems()]) |
|
74 | r = util.system(cmd, environ=env, cwd=repo.root) | |
|
74 | if repo: | |
|
75 | cwd = repo.root | |
|
76 | else: | |
|
77 | cwd = os.getcwd() | |
|
78 | r = util.system(cmd, environ=env, cwd=cwd) | |
|
75 | 79 | if r: |
|
76 | 80 | desc, r = util.explain_exit(r) |
|
77 | 81 | if throw: |
General Comments 0
You need to be logged in to leave comments.
Login now