Could someone please explain why my preoutgoing hook gets executed on doing hg strip (Mercurial Strip)? Is there any chance to disable that behavior?
I'd expected the hook to run when doing hg push.
Could someone please explain why my preoutgoing hook gets executed on doing hg strip (Mercurial Strip)? Is there any chance to disable that behavior?
I'd expected the hook to run when doing hg push.
To avoid the execution of my hook code, I've added the following lines of code to the very beginning of my hook:
if "%HG_SOURCE%" == "strip" (
exit /b 0
)
Both outgoing and preoutgoing will be provided with a parameter indicating the source action. In Python, this parameter is called source, otherwise you can access the environment variable HG_SOURCE:
hg push → HG_SOURCE is pushhg strip → HG_SOURCE is stripBased on that observation, you can simply evaluate the initial command.
Sources: