I have a hook function with a name precommit_bad_branchthat imports hook_utils. When called precommit_bad_branchthrough a commit, I get the following error message:
error: precommit.branch_check hook raised an exception: No module named hook_utils
abort: No module named hook_utils!
Looks like I'm not allowed to call hook_utilsfrom precommit_bad_branch. The code works fine if I call it explicitly without using Mercurial.
Is it possible for my hook to call code from another file?
My hgrc hook part is as follows:
[hooks]
precommit.branch_check = python:C:\workspaces\hg_hooks\next_hooks.py:precommit_bad_branch
precommit.debug_code_check = python:C:\workspaces\hg_hooks\common_hooks.py:precommit_contains_debug_code
preupdate.merge_check = python:C:\workspaces\hg_hooks\next_hooks.py:preupdate_bad_merge
source
share