I have created a post-clone hook in .hg/hgrc. This hook sometimes executed, and sometimes not, depending on which directory hg is called from.
Let the repository be in /path/to/repos/. The post-clone hook is in /path/to/repos/.hg/hgrc.
Cloning from /path/to/repos/, the post-clone hook is executed:
$ pwd
/path/to/repos/
$ hg clone ./ /path/to/myclone/
Cloning from /path/to, the post-clone hook is not executed:
$ pwd
/path/to/
$ hg clone repos myclone
Why is the hgrc in my repository not read/post-clone hook not executed in the latter case?
Regards, Freddy
I suspect you need to put the hook in your ~/hgrc file, rather than your repo's hgrc.
Hooks do not propagate
i.e.. if you add hook to a repo, then clone the repo, don't expect the hook to be in the new clone.