Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mercurial avoid pre-commit hook on shelving

I'm coding a simple hook in order to check syntax of project's files. I want check syntax only before a commit.

My problem is : When I do a shelve, Mercurial run pre-commit hook. The syntax checking take 4-5 minutes.

How can I avoid to run my hook on shelve ?

My .hrgc line of hook :

precommit = python ~/tools/check_syntax.py $($HG root)

I can add parameter in my check_syntax.py to avoid checking if it's required.

like image 985
Samuel Dauzon Avatar asked Feb 17 '26 06:02

Samuel Dauzon


1 Answers

You can just override the config for this particular command invocation:

hg shelve --config hooks.precommit= --name abcd

like image 83
ikostia Avatar answered Feb 18 '26 18:02

ikostia



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!