Installing Mercurial with Apache

If you’ve been following one of these guides explaining how to configure Mercurial with Apache you may have encountered the following error…

TypeError: 'hgwebdir' object is not callable

There may be a number of scenarios under which this error can happen but in my case it was because I was using an incompatible version hgwebdir.cgi. After installing Mercurial 0.9.4 I downloaded hgwebdir.cgi from here (which at the time of writing was for Mercurial 1.0). To fix the problem I had to use the version of hgwebdir.cgi that came with the Mercurial 0.9.4 install. On Ubuntu you’ll find it here /usr/share/doc/mercurial/examples/hgwebdir.cgi.