Wednesday 13 January 2010

Mercurial - managing a repository

Last Autumn, I set up a repository server with Mercurial. While not particularly difficult, it took a while to get all the configuration exactly correct, in particular, to leave no security loopholes. With some assistance from Zuhlke's IT centre, this was satisfactorily completed and the server is in production use.

It takes a little while to get used to the idea that you can't just access files directly from the repository server, as you can with CVS and Subversion. Instead, anyone wishing to get hold of the repository contents has to install a copy of the Mercurial software on their own machine (on Windows PCs, my choice would be TortoiseHg) and "clone" the repository. While this makes it a bit tedious for someone who just needs one or two files out of a big repository, it's great for teams of developers who can each check files in and out of their local workspace before merging a consistent set of changes with the central development branch.

I was quite surprised, however, by the lack of web-based admin facilities. There ought to be a control panel to allow suitably authorised people to create and delete collections of repositories with specified access permissions, set up and delete repository user accounts etc. Currently you have to use the shell commands and in some cases, this involves superuser privileges (e.g. to change ownership of new repositories to www-data so that the Apache FCGI scripts can access them).

Because I was unable to find such a facility either natively or under Webmin, I have embarked on developing some scripts to provide these functions. I have adapted the Python scripts and modules, HTML templates and stylesheets of Mercurial itself for the purpose. Anyone keen to help or to get access to this code is invited to contact me - immo.huneke _a_ zuhlke.com.

1 comment:

Immo Hüneke said...

In the meantime, a couple of Mercurial repository administrator solutions have appeared. I would be interested to hear what experiences people have had with them.

* Josh Carrier's phpHgAdmin

* Vladimir Ermakov's django-hgadmin