README

Fri, 16 Dec 2011 23:42:24 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Fri, 16 Dec 2011 23:42:24 +0000
changeset 6
f54217e38365
parent 4
6876a8966aaf
permissions
-rw-r--r--

README: Fix example service name (thanks Florob)

hg2pubsub is a small script to make it easy to post Mercurial commits to an XMPP pubsub (XEP-0060) service.

It posts the commits in the standard ATOM format, so they can be easily consumed by existing tools,
clients (for example, Gajim) and bots (for example, Riddim).

Installation:

  - Requires Verse: http://code.matthewwild.co.uk/verse
  - Run 'make install' to install to /usr/local/bin

Usage:

   hg2pubsub CONFIG SERVICE NODE ID URL

Where the parameters are as follows:

  - CONFIG: The filename of the config file containing the XMPP server credentials. The file
    is a simple text file, with the first line as the JID and the second line as the password.
    Ensure the permissions on this file prevent other users on the system from reading it.
  - SERVICE: The pubsub service to publish to, e.g. 'pubsub.example.com'.
  - NODE: The pubsub node to publish to, e.g. 'commits'
  - ID: The item id. Use the project name or branch - e.g. 'trunk'.
  - URL: If your repository is accessible via the web, set this to the root of your project,
    e.g. 'http://code.example.com/'.

You need to pipe to hg2pubsub the commits you want it to announce as XML. Mercurial supports XML output natively
using '--style xml'.

Here is an example commit hook that would go in ~/.hgrc (system-wide) or project/.hg/hgrc (project only) to
publish commits:

  [hooks]
  changegroup.pubsub = hg log -r $HG_NODE: --style xml | hg2pubsub ~/.hg2pubsub pubsub.example.com commits $(basename $PWD) http://code.example.com/ >/dev/null

mercurial