Get current hook type from hook function

Bill Barry after.fallout at gmail.com
Mon Jun 21 10:51:22 CDT 2010


Didly Bom wrote:
> Hi,
>
> is there a way to get the current hook type (changegroup, incoming, 
> etc) from within the hook function that is executed when the hook 
> event occurs?

If you are using bash/batch hooks, you can print the name of the file 
pretty easily, can't you?

It would be pretty easy to (in python) copy the hook to a new file 
before attaching it (heck, you could simply write a new file while 
attaching the hooks, all it would be is an echo command with the string 
you want to output).

Sometimes the most elegant solution isn't worth implementing if it takes 
too long to figure out.


More information about the Mercurial-devel mailing list