# HG changeset patch # User Matthew Wild # Date 1323571777 0 # Node ID 6876a8966aaf7393ac36c958266766d9e119ad18 # Parent e6d20e578df397a63e936d0650dd7110c8578da9 README: Added. diff -r e6d20e578df3 -r 6876a8966aaf README --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/README Sun Dec 11 02:49:37 2011 +0000 @@ -0,0 +1,33 @@ +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. 'example.pubsub.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