Samuel Dauzon
Samuel Dauzon

Reputation: 11324

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.

Upvotes: 3

Views: 482

Answers (1)

ikostia
ikostia

Reputation: 7587

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

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

Upvotes: 3

Related Questions