Differences between revisions 1 and 2
Revision 1 as of 2005-09-22 15:19:04
Size: 366
Editor: mpm
Comment:
Revision 2 as of 2005-10-23 13:02:35
Size: 703
Editor: tonfa
Comment: add example hook for closing bug in roundup
Deletions are marked like this. Additions are marked like this.
Line 16: Line 16:

And this should work for closing bugs in roundup (not tested):
{{{
#!/bin/sh

ISSUE=`hg log -vr $NODE | grep -o "\<fix:[[:alnum:]]*" | sed s/fix://`
[ -z $ISSUE ] && exit
SUBJECT=`hg log -r $NODE | grep "^summary:" | cut -b 14-`
hg log -vr $NODE | mail -s "[$ISSUE] [status=resolved] commit: $SUBJECT" roundup@example.com
}}}

You can use the hook feature to automatically send mail when a commit occurs. Add the following to .hg/hgrc:

[hooks]
commit = commithook

And put this in a file called commithook in your path:

SUBJECT=`hg log -r $NODE | grep "^summary:" | cut -b 14-`
hg log -vpr $NODE | mail -s "commit: $SUBJECT" commit-list@example.com

And this should work for closing bugs in roundup (not tested):

ISSUE=`hg log -vr $NODE | grep -o "\<fix:[[:alnum:]]*" | sed s/fix://`
[ -z $ISSUE ] && exit
SUBJECT=`hg log -r $NODE | grep "^summary:" | cut -b 14-`
hg log -vr $NODE | mail -s "[$ISSUE] [status=resolved] commit: $SUBJECT" roundup@example.com

Hook (last edited 2021-08-23 00:42:32 by PaulBissex)