Subject: [FFC-dev] hg commit info

From: Anders Logg <[email-masked]>
Date: Wed, 1 Feb 2006 16:34:03 -0600

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 <[email-masked]>"

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" [email-masked]

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

---

From: Anders Logg <[email-masked]>
Date: Thu, 2 Feb 2006 10:36:04 -0600

I thought about this some more, and I got it working (somewhat).
Emails are now generated to [email-masked] 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" [email-masked]

/Anders

On Wed, Feb 01, 2006 at 04:34:03PM -0600, Anders Logg wrote:
> _______________________________________________
> FFC-dev mailing list
> [email-masked]
> 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/