← Back to team overview

ffc team mailing list archive

Re: hg commit info

 

I thought about this some more, and I got it working (somewhat).
Emails are now generated to ffc-dev@xxxxxxxxxx whenever something is
pushed to the primary repository. The email contains a summary of the
last three changesets (although the push may contain more changesets).

Here's the setup for reference.

In .hg/hgrc in the primary repository (the one we're pushing to):

[hooks]
changegroup = '/path/to/script/notify-ffc.sh'

The script notify-ffc.sh looks as follows:

#!/bin/sh

TMPFILE="/tmp/hgmessage.log"

rm -f $TMPFILE

echo "\
One or more new changesets pushed to the primary FFC repository.
A short summary of the last three changesets is included below.
" >> $TMPFILE

cd /home/fenics/hg/projects/ffc
hg log -vr -1:-3 >> $TMPFILE

echo "\
----------------------------------------------------
For more details, visit http://www.fenics.org/hg/ffc"; >> $TMPFILE

SUBJECT="[HG] "`hg log -r tip | grep "^summary:" | cut -b 14-`
cat $TMPFILE  | mail -s "$SUBJECT" ffc-dev@xxxxxxxxxx


/Anders


On Wed, Feb 01, 2006 at 04:34:03PM -0600, Anders Logg wrote:
> I have tried to make hg generate emails to the mailing list whenever a
> push occurs to the primary repository, but this does not seem to be
> possible (without too much manual intervention). Instead, I have set
> up my local repository to generate emails on commits, which seems to
> be more in line with the philosophy of hg.
> 
> As a result, an email is generated every time I make a commit to my
> local repository, but not when I push changes to the public repository
> on fenics.org. Note that there may (and perhaps should) be several
> commits between each push, so commits that are announced to the
> mailing list may not be directly available from the public repository.
> If you want to track when changes occur in the public repository,
> simply point your browser to http://www.fenics.org/hg/ffc or read the
> RSS feed for hg/ffc (available on the same page).
> 
> Here's how to set up the automatic emailing (taken from the hg wiki):
> 
> In ~/.hgrc, add the following lines and edit appropriately:
> 
> [ui]
> username = "Anders Logg <logg@xxxxxxxxx>"
> 
> In .hg/hgrc in your working repository, add the following lines:
> 
> [hooks]
> commit = /path/to/script/notify-ffc.sh
> 
> and put the following in the script notify-ffc.sh:
> 
> #!/bin/sh
> 
> SUBJECT=`hg log -r $NODE | grep "^summary:" | cut -b 14-`
> hg log -vpr $NODE | mail -s "[HG] $SUBJECT" ffc-dev@xxxxxxxxxx
> 
> If you want me to be able to pull changes from your tree and merge
> with the official tree, then publish your repository somewhere,
> perhaps under ~/hg/ffc on your account on fenics.org (if you should
> have one) or publish it on the web.
> 
> /Anders
> 
> _______________________________________________
> FFC-dev mailing list
> FFC-dev@xxxxxxxxxx
> http://www.fenics.org/cgi-bin/mailman/listinfo/ffc-dev
> 

-- 
Anders Logg
Research Assistant Professor
Toyota Technological Institute at Chicago
http://www.tti-c.org/logg/



References