Presenting HgStatusNet

This semester, I had to do a project totalizing about 300 man-hours. I chose to do VeHO, a distribution platform including a server and a client. The project was under revision control (mercurial, for that matter) and every part of the platform in its own sub-repository. Anyway, to help me keep track of what was being pushed to the main repository, I coded a little mercurial hook in python that, every time someone pushed a revision, it updated a StatusNet account. I present you hgstatusnet.

The configuration is pretty straight forward and can be set up to update a private account on your private StatusNet instance. In your .hgrc file, just add this section:

[statusnet]
username = hgstatusnet
password = secret
server = http://localhost
path = /statusnet
;preprend =

The server and path settings are used to locate the StatusNet instance. In my example, my instance lives at http://localhost/statusnet. I’m also updating hgstatusnet’s account. If I wanted, I could preprend a little bit of text to every message to differentiate repositories, for example.

You also need to configure the hook, like so:

[hooks]
incoming.hgstatusnet = python:hgstatusnet.statusnetutils.post_statusnet_hook

Be sure that the hgstatusnet module is in your python path. Otherwise, it won’t work. Also, be aware that this is an early version and I may want/need to implement more features in the future and that this code comes without warranty.

update (jan. 5th):
If you have any questions, comments or just want to share your experience, please don’t hesitate.