hook: assume relative path to hook is given from repo root stable
authorAlexander Solovyov <alexander@solovyov.net>
Tue, 07 Dec 2010 15:27:04 +0100
branchstable
changeset 13118 789e0fa2fcea
parent 13117 594ed85b6a3f
child 13119 ecf7d6e0eef0
hook: assume relative path to hook is given from repo root
mercurial/hook.py
--- 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()