Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hook.py @ 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 | c37f35d7f2f5 |
children | ecf7d6e0eef0 |
comparison
equal
deleted
inserted
replaced
13117:594ed85b6a3f | 13118:789e0fa2fcea |
---|---|
133 if hasattr(cmd, '__call__'): | 133 if hasattr(cmd, '__call__'): |
134 r = _pythonhook(ui, repo, name, hname, cmd, args, throw) or r | 134 r = _pythonhook(ui, repo, name, hname, cmd, args, throw) or r |
135 elif cmd.startswith('python:'): | 135 elif cmd.startswith('python:'): |
136 if cmd.count(':') >= 2: | 136 if cmd.count(':') >= 2: |
137 path, cmd = cmd[7:].rsplit(':', 1) | 137 path, cmd = cmd[7:].rsplit(':', 1) |
138 mod = extensions.loadpath(path, 'hghook.%s' % hname) | 138 path = util.expandpath(path) |
139 mod = extensions.loadpath(os.path.join(repo.root, path), | |
140 'hghook.%s' % hname) | |
139 hookfn = getattr(mod, cmd) | 141 hookfn = getattr(mod, cmd) |
140 else: | 142 else: |
141 hookfn = cmd[7:].strip() | 143 hookfn = cmd[7:].strip() |
142 r = _pythonhook(ui, repo, name, hname, hookfn, args, throw) or r | 144 r = _pythonhook(ui, repo, name, hname, hookfn, args, throw) or r |
143 else: | 145 else: |