Contents
hooks for sending email push notifications
This extension implements hooks to send email notifications when changesets are sent from or received by the local repository.
First, enable the extension as explained in hg help extensions, and register the hook you want to run. incoming and changegroup hooks are run when changesets are received, while outgoing hooks are for changesets sent to another repository:
[hooks] # one email for each incoming changeset incoming.notify = python:hgext.notify.hook # one email for all incoming changesets changegroup.notify = python:hgext.notify.hook # one email for all outgoing changesets outgoing.notify = python:hgext.notify.hook
This registers the hooks. To enable notification, subscribers must be assigned to repositories. The [usersubs] section maps multiple repositories to a given recipient. The [reposubs] section maps multiple recipients to a single repository:
[usersubs] # key is subscriber email, value is a comma-separated list of repo patterns user@host = pattern [reposubs] # key is repo pattern, value is a comma-separated list of subscriber emails pattern = user@host
A pattern is a glob matching the absolute path to a repository, optionally combined with a revset expression. A revset expression, if present, is separated from the glob by a hash. Example:
[reposubs] */widgets#branch(release) = qa-team@example.com
This sends to qa-team@example.com whenever a changeset on the release branch triggers a notification in any repository ending in widgets.
In order to place them under direct user management, [usersubs] and [reposubs] sections may be placed in a separate hgrc file and incorporated by reference:
[notify] config = /path/to/subscriptionsfile
Notifications will not be sent until the notify.test value is set to False; see below.
Notifications content can be tweaked with the following configuration entries:
Space-separated list of change sources. Notifications are activated only when a changeset's source is in this list. Sources may be:
serve: | changesets received via http or ssh |
---|---|
pull: | changesets received via hg pull |
unbundle: | changesets received via hg unbundle |
push: | changesets sent or received via hg push |
bundle: | changesets sent via hg unbundle |
Default: serve.
If set and the changeset has a predecessor in the repository, try to thread the notification mail with the predecessor. This adds the "In-Reply-To" header to the notification mail with a reference to the predecessor with the smallest revision number. Mail threads can still be torn, especially when changesets are folded.
This option must be used in combination with notify.messageidseed.
If set, the following entries will also be used to customize the notifications: