email notifications on push

Giorgos Keramidas keramida at ceid.upatras.gr
Mon Jan 10 09:04:49 CST 2011


On Mon, 10 Jan 2011 13:44:06 +0100, Felix Dorner <fdorner at tuenti.com> wrote:
> Hey,
>
> I want to send notification emails to user A if some/path/test.txt
> changes, and to user B if /some/other/path/test.txt changes. In
> general, users should be able to specify lists of paths/globs they're
> interested in and receive notifications in case of a push that
> contains a change which matches one of their path specs. I tried out
> the notify extension, but that doesn't seem to support this. It only
> supports per-repository notifications. Has anyone maybe
> extended/implemented a hook that serves my needs and wants to share
> it?

The notify extension does include file-pattern matching support, so you
can add for example:

    # Commit-mail subscriptions.
    [usersubs]
    userA at example.org = some/path/test.txt
    userB at example.org = some/other/path/test.txt
    mailing-list at example.org = **

Updating the `.hg/hgrc' file of the repository when users change their mind
is going to be slightly more complex, as you would have to install some
sort of hook that updates it externally.

For instance, you can add a toplevel hgadmin/ directory in the repository
itself and add a version tracked file called `hgadmin/commit-mail.conf'.
Then you can install a push hook on the main repository that tracks commits
to that file and updates `.hg/hgrc' in place.

This way interested committers can register their interest to any file
pattern they like by committing to `hgadmin/commit-mail.conf', you get
tracking of who changed the file, when it was changed, by whom, etc.



More information about the Mercurial mailing list