email notification setup

Zbynek Winkler zwin at users.sourceforge.net
Thu Sep 22 11:37:57 CDT 2005


Zbynek Winkler wrote:

> Matt Mackall wrote:
>
>>> Does anyone have an email notificator ready for use with mercurial 
>>> changegroup hook?
>>>   
>>
>> Add this to .hg/hgrc:
>>
>> [hooks]
>> commit = commithook
>>
>> And put this in your path:
>>
>> #!/bin/sh
>>
>> SUBJECT=`hg log -r $NODE | grep "^summary:" | cut -b 14-`
>> hg log -vpr $NODE | mail -s "commit: $SUBJECT" commit-list at example.com
>>  
>>
> Thanks. I replaced 'commit' with 'changegroup' since I want to set 
> this up in a remote repo that nobody commits to.
>
> Where does $NODE come from? 

I've found it in the source. The commit hook is called with

        if not self.hook("commit", node=hex(n)):
            return None

while changegroup

        if not self.hook("changegroup"):
            return 1

Can we add the node id to the changegroup as well?
Can we add a documentation about the params available for the hooks and 
the way they are supplied?
Thanks.

Zbynek

-- 
http://zw.matfyz.cz/     http://robotika.cz/
Faculty of Mathematics and Physics, Charles University, Prague, Czech Republic



More information about the Mercurial mailing list