假设您已经安装并成功使用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"
创建 "C:\Program Files\VisualSVN Server\cgi-bin" 目录,并将
hgweb.cgi 文件放入其中。确保它看起来与以下内容类似:
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存储库。