changeset 13118:789e0fa2fcea stable

hook: assume relative path to hook is given from repo root
author Alexander Solovyov <alexander@solovyov.net>
date Tue, 07 Dec 2010 15:27:04 +0100
parents 594ed85b6a3f
children ecf7d6e0eef0
files mercurial/hook.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hook.py	Fri Dec 10 19:08:17 2010 -0600
+++ b/mercurial/hook.py	Tue Dec 07 15:27:04 2010 +0100
@@ -135,7 +135,9 @@
             elif cmd.startswith('python:'):
                 if cmd.count(':') >= 2:
                     path, cmd = cmd[7:].rsplit(':', 1)
-                    mod = extensions.loadpath(path, 'hghook.%s' % hname)
+                    path = util.expandpath(path)
+                    mod = extensions.loadpath(os.path.join(repo.root, path),
+                                              'hghook.%s' % hname)
                     hookfn = getattr(mod, cmd)
                 else:
                     hookfn = cmd[7:].strip()