windows下mercurial 服务器安装与配置

来源:互联网 发布:希特勒回来了 知乎 编辑:程序博客网 时间:2024/06/05 22:44

1、安装mercurial、python包及相应的python

*下载Mercurial 2.0.1 Python 2.6 package - x86 Windows

*下载Mercurial 2.0.1 Inno Setup installer - x86 Windows - does not require admin rights

*下载TortoiseHg 2.2.1 with Mercurial 2.0.1 - x86 Windows

*下载Mercurial 2.0.1 source release

*安装python-2.6到D:\Python-2.6

*安装TortoiseHg到F:\Program Files\TortoiseHg,并将路径加入到环境变量中的path

*安装Mercurial 2.0.1 Python 2.6 package - x86 Windows到D:\Python-2.6\Lib\site-packages


2、修改hgweb.cgi

*新建本地目录D:\HgRepoes

*解压Mercurial 2.0.1 source release,拷贝hgweb.cgi到D:\HgRepoes

*拷贝源代码目录下的templates到D:\HgRepoes

*修改hgweb.cgi

#!D:/Python-2.6/python.exe
## An example hgweb CGI script, edit as necessary
# See also http://mercurial.selenic.com/wiki/PublishingRepositories
# Path to repo or hgweb config to serve (see 'hg help hgweb')
config = "D:/HgRepoes/hgweb.config"
# Uncomment and adjust if Mercurial is not installed system-wide
# (consult "installed modules" path from 'hg debuginstall'):
import sys; sys.path.insert(0,"D:/Python-2.6/Lib/site-packages")
# Uncomment to send python tracebacks to the browser if an error occurs:
import cgitb; cgitb.enable()
from mercurial import demandimport; demandimport.enable()
from mercurial.hgweb import hgweb, wsgicgi
application = hgweb(config)
wsgicgi.launch(application)


3、配置hgweb.config

在这里配置mercurial库路径,如

[paths]
Project1 = D:/HgRepoes/Project1
Project2 = D:/HgRepoes/sony/Project2
Project3 = D:/HgRepoes/Project3


3、配置iis使访问mercurial web目录

新建网站,指向D:/HgRepoes,设置域访问权限,这样可以限制匿名用户的访问权限



4、配置mercurial权限

*利用windows安全设置目录的读权限

*利用.hg下的hgrc控制写权限


可能出现的问题:

1、python版本与mercurial版本不一致

2、python源代码中解压出来的mercurial库与python版本不一致


原创粉丝点击