4

Is it possible to temporarily disable a hook when running a mercurial command? e.g., something like:

hg push --no-hook
4

3 回答 3

7

According to this bugfeature, the following skips local hooks:

hg --config alias._pull=pull _pull

Obviously this is a hack, but it has worked since 2011, and is the only way to skip local hooks given the lack of a '--no-hooks' option.

于 2015-01-22T19:09:41.980 回答
3

You can't disable a remote repository's hook. But you could enable or disable a local hook via --config option:

$ hg commit -m test --config 'hooks.commit.info=set | grep "^HG_"'
于 2013-02-15T12:45:45.523 回答
0

If this is an outgoing or preoutgoing hook that is locally configured, you can disable it by commenting out its entry under [hooks] in .hg/hgrc. If this is a hook configured on the repository that you are pushing to (changegroup, incoming, prechangegroup, pretxnchangegroup), you will have to comment out its entry under [hooks] in the target repository's .hg/hgrc (if you have access to it).

于 2013-02-14T23:53:49.533 回答