假设您已安装并运行 Python 2.6,以下是我采取的步骤。
获取为Apache 2.2 Win32构建的“mod_cgi.so”并将其放置在“C:\Program Files\VisualSVN Server\bin”中。
将以下内容粘贴到“C:\Program Files\VisualSVN Server\conf\httpd-custom.conf”
LoadModule cgi_module bin/mod_cgi.so
ScriptAliasMatch ^/hg(.*) "cgi-bin/hgweb.cgi$1"
创建 cgi-bin 目录,“C:\Program Files\VisualSVN Server\cgi-bin”。并将hgweb.cgi放入其中。确保它看起来类似于以下内容:
#!c:/Python26/python.exe -u
import sys
sys.path.insert(0, "C:\Program Files\Mercurial\library")
import cgitb
cgitb.enable()
from mercurial.hgweb.hgwebdir_mod import hgwebdir
import mercurial.hgweb.wsgicgi as wsgicgi
application = hgwebdir('hgweb.config')
wsgicgi.launch(application)
在 cgi-bin 目录中创建一个名为 hgweb.config 的文件。
[paths]
/ = c:/HgRepositories/*
将“C:\Program Files\Mercurial\templates”复制到“C:\Program Files\Mercurial\library\templates”。
创建“C:\HgRepositories”文件夹和“hg init c:\HgRepositories\test”。
重新启动 VisualSVN 服务器,打开浏览器,享受 Mercurial 存储库。