[Pidgin] UsingPidginMercurial modified
trac at pidgin.im
Fri Jul 13 00:19:30 EDT 2012
Changed page "UsingPidginMercurial" by datallah from 18.104.22.168*
Page URL: <http://developer.pidgin.im/wiki/UsingPidginMercurial>
Diff URL: <http://developer.pidgin.im/wiki/UsingPidginMercurial?action=diff&version=13>
Comment: Added more information about the notification repo works
--- UsingPidginMercurial (version: 12)
+++ UsingPidginMercurial (version: 13)
@@ -119,6 +119,30 @@
Additionally, there is a safety net built into the mercurial-server configuration. In `/etc/mercurial-server` on rock.pidgin.im is a default ACL (`access.conf`) and a `keys` directory structure. This default ACL is what grants "root" users their privileges, and the `keys` directory structure contains the relevant keys in the `keys/root` directory. These keys are located here in the server's filesystem instead of in the hgadmin repository as a safety net. When building the files used by mercurial-server, the tools ''always'' read from `/etc/mercurial-server` ''before'' reading from `hgadmin`; this allows access to the hgadmin repo in the event that it is damaged either through accidental or intentional means. This safety net means that at least two people will ''always'' have access to our repositories.
+=== How the email and CIA notification works ===
+As detailed below, we use slightly modified versions of the notify and hgcia hooks that are distributed with hg. They are modified in order to support notification for multiple repositories without triggering duplicate notifications as the same revisions are pushed between various repositories on the server.
+The way it works is that there is a special repository that isn't served publicly (`/srv/mercurial-server/notification-repo/`) which is used to trigger the notifications as new revisions are enter it. A hook is set up for the `hg` user and mercurial-server (`'changegroup.notify_sync'` - see below) so that revisions pushed into any repository will automatically be pulled into the notification repo. This can be disabled on a per repository basis by overriding and disabling the hook in the appropriate repository-specific `.hg/hgrc` file:
+In order to trigger notifications for a new repository that is not related (has no shared history) to any repository that has already been synced to the notification repo (e.g. the first time that the repository containing the pidgin website was synced to the notification repo), an initial manual pull must be made with the `--force` parameter specified:
+/srv/mercurial-server/repos/util/hg_hooks/notify_repo_sync.sh /absolute/path/to/new/repo --force
+In order to avoid triggering notifications for revisions that aren't already in the notification repo (e.g. when the imfreedom.org website was converted from mtn to hg), the hooks can be disabled as the relevant revisions are pulled into the notification repo. Note, this should only be done when notifications have already been sent out for these revisions in some other way.
+hg --cwd /srv/mercurial-server/notification-repo pull /path/to/source/repo \
+ --config hooks.changegroup.cia= \
+ --config hooks.incoming.notify= \
+ --config hooks.changegroup.pushlog= \
+ --config hooks.pretxnchangegroup.authorcheck= \
+ --config hooks.changegroup.notify_sync=
== Hooks / Extensions ==
There are a number of hooks, extensions and other configuration in place for the various repositories:
@@ -129,7 +153,6 @@
* This is registered globally as `'pretxnchangegroup.authorcheck'` for both the `hg` user and mercurial-server
* [http://hg.pidgin.im/util/hg_hooks/file/tip/notify_repo_sync.sh notify_repo_sync.sh] trigger a sync in the background with the notification repo to trigger email and cia notifications
* This is registered globally as `'changegroup.notify_sync'` for both the `hg` user and mercurial-server
- * Note: an initial manual pull may be necessary for new repos
* [http://hg.pidgin.im/util/hg_hooks/file/tip/notify.py notify.py] slightly tweaked version of the built-in hg hook to facilitate using a separate repo for driving the notifications
* This is registered in the `/srv/mercurial-server/notification-repo/` (which isn't served anywhere)
* [http://hg.pidgin.im/util/hg_hooks/file/tip/hgcia.py hgcia.py] slightly tweaked version of the built-in hg hook for CIA bot notification
* The IP shown here might not mean anything if the user or the server is
behind a proxy.
This is an automated message. Someone at http://pidgin.im added your email
address to be notified of changes on UsingPidginMercurial. If it was not you, please
report to .
More information about the Wikiedit