GSoC/GCI Archive
Google Code-in 2014 Copyleft Games

HGBot: IRC Repo Add

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, adding a repository involves manually editing the sqlite database and restarting HGBot after its been created. Creating a new repository involves "hg init" in the appropriate directory, creating a .hg/hgrc file within it, and then adding the new repo to the bot.

Extend the current REPOSITORY command to support ADD and INIT subcommands.

ADD should accept a path to a repository on the filesystem. This command should test to ensure the path provided is valid. You do not need to verify the contents of its .hgrc file, we can assume if a repository is added this way the repository's .hgrc file is already correct.

INIT should create a new repository and then add it to HGBot at a provided path. A new .hgrc file should be created for this with the "contact" equal to the username of the admin creating the repository and an empty description. The hooks necessary to work with hgbot should be provided here as well.

Both of these new subcommands set the channels to a default #CopyleftGames, a CHANNELS subcommand could be used to set other channels. Also, a CONTACT subcommand can be used to change the contact and a DESCRIPTION subcommand could be used to set the description, so none of these need to be provided with ADD or INIT.

Extend the help text for REPOSITORY to list these new subcommands.

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.