Mercurial: are pre-commit hooks run for other committing commands than "hg ci"

106 views Asked by At

Are mercurial's pre-commit hooks also run for other committing commands, e.g. hg backout or hg graft? Since these commands do a commit themselves, I'd like to think this is the case but I cannot find it in the documentation anywhere.

1

There are 1 answers

0
lc2817 On BEST ANSWER

Yes they do run for these operations: they run for every commit created on the local repo. You can convince yourself that they run with a simple test like:

hg graft 10 --config hooks.precommit="echo 'hook ran'"

It will print hook ran when the hook is called