This is a quick run-through of how I installed Mercurial 2.2.1 on Windows Server 2003 64-bit edition and used IIS 6.0 to serve the repositories.
Install Mercurial 2.2.1 with Mercurial 2.2.1 Python 2.6 package – x64 Windows and Mercurial 2.2.1 MSI installer – x64 Windows, both found here. The former of these installs Mercurial native for Python which we need for the web. The other one installs the command line tools necessary for managing repositories.
Create a directory to hold the repositories. I chose C:\Repositories. Create another directory to hold the files IIS will use to serve the repositories. This should be separate from the repositories themselves. I chose C:\Mercurial\Website. Create a new file in that directory named hgweb.cgi with the following content:
#!python config = "C:\\Mercurial\\Website\\hgweb.config" import cgitb; cgitb.enable() from mercurial import demandimport; demandimport.enable() from mercurial.hgweb import hgweb, wsgicgi application = hgweb(config) wsgicgi.launch(application)
Create another file in the same directory called hgweb.config with the following content:
[paths] Test = C:\Repositories\Test Main = C:\Repositories\Main [web] style = monoblue
Now that all files are in place it is time to set up IIS with the help of the IIS Manager. Create a new virtual directory under the default web site. Call it hg and point it to the directory with the hgweb files (C:\Mercurial\Website in my case).
Executable: "C:\Program Files\Python\python.exe" -u "%s %s" Extension: .cgi
C:\Program Files\Python\python.exe C:\Program Files\Python\python.exe -u "%s %s"