GSoC/GCI Archive
Google Code-in 2014 Copyleft Games

HGBot: IRC Repo Config

completed by: Michal Proszek

mentors: Jon Neal, Arc Riley, Terri Oda, David Czech, AJ Williams, Amaury Medeiros

HGBot is a Python program that automates our Mercurial repository management, handles Mercurial authentication, and provides user interfaces such as IRC.

Currently, the channels each project posts changesets to is configured in its .hg/hgrc file on the server and the channels HGBot joins are coded in, such that adding a new channel requires restarting it. This is obviously less than ideal.

[hgbot]
channels = #CopyleftGames,#PySoy
module = pysoy

Add a database table for separate Mercurial repositories which associates a repository to "channels", a string containing comma separated channel names (as above), plus the registered nickname and timedate of the last modifier. On (re)connect, HGBot should scan this table for channels and join each one.

Add a new IRC command to HGBot which allows this to be managed, such as /msg _hg REPOSITORY for a list of repositories, /msg _hg REPOSITORY pysoy to receive a list of associated channels, and /msg _hg REPOSITORY pysoy #CopyleftGames,#PySoy to set them. When channels change _hg should ensure it joins/parts appropriately, notify all affected channels of the change in status (eg, "Added <repository> by the request of <nickname>"), and record who made the change (and the current time).

While working on this task you should join and remain in #CopyleftGames on Freenode to get help, feedback, and guidance from mentors and other developers. Code updates which may affect your work are also announced here as they happen.

When you've done, commit your work and post the resulting changeset url to this task.