Hg WebServer 搭建

Win7系统 64位, 以下程序均为64位.

1. python-2.7.12.amd64.msi                        [必须]        本机测试安装目录  C:\\Python27\

2. mercurial-4.7.1.win-amd64-py2.7.msi      [必须]       本机测试安装后自动到  C:\\Python27\\Lib\\site-packages\

3. ttortoisehg-4.5.3-x64.msi                          [可选]       依赖 vc++2015

4. rewrite_amd64_zh-CN.msi                       [可选]       依赖 vc++2015

 

Traceback (most recent call last): File "thg", line 122, in <module> File "hgdemandimport\demandimportpy2.pyo", line 145, in __getattr__ File "hgdemandimport\demandimportpy2.pyo", line 90, in _load File "hgdemandimport\demandimportpy2.pyo", line 41, in _hgextimport File "tortoisehg\hgqt\run.pyo", line 391, in <module> File "hgdemandimport\demandimportpy2.pyo", line 145, in __getattr__ File "hgdemandimport\demandimportpy2.pyo", line 90, in _load File "hgdemandimport\demandimportpy2.pyo", line 41, in _hgextimport File "tortoisehg\hgqt\qtapp.pyo", line 18, in <module> File "hgdemandimport\demandimportpy2.pyo", line 167, in _demandimport File "hgdemandimport\demandimportpy2.pyo", line 41, in _hgextimport File "tortoisehg\hgqt\qtcore.pyo", line 53, in <module> File "hgdemandimport\demandimportpy2.pyo", line 167, in _demandimport File "hgdemandimport\demandimportpy2.pyo", line 41, in _hgextimport File "PyQt5\QtCore.pyo", line 12, in <module> File "PyQt5\QtCore.pyo", line 10, in __loadImportError: DLL load failed: The specified module could not be found.

 运行 TortoiseHg Workbench 出现如上错误请安装 Microsoft C++ 2015 Redistributable  https://www.microsoft.com/en-us/download/details.aspx?id=53587

 错误参照 -->  https://bitbucket.org/tortoisehg/thg/issues/4972/importerror-dll-load-failed

 

详细安装步骤请参照

http://www.cnblogs.com/gb2013/archive/2013/02/01/Mercurial_WebServer.html

 

hgweb.cgi 文件

#!C:/Python27/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 = "C:/SourceCode/hgweb.config"# Uncomment and adjust if Mercurial is not installed system-wide:import syssys.path.insert(0, "C:\\Python27\\Lib\\site-packages")# Uncomment to send python tracebacks to the browser if an error occurs:import cgitbcgitb.enable()from mercurial import demandimportdemandimport.enable() from mercurial.hgweb import hgweb, wsgicgiapplication = hgweb(config)wsgicgi.launch(application)

hgweb.config 文件

[paths] /Repositories/ = C:/SourceCode/* [web] encoding = UTF-8descend = Truepush_ssl = falsebaseurl = /allow_read = *allow_push = *

web.config 文件

<?xml version="1.0" encoding="UTF-8"?><configuration> <system.webServer> <handlers> <add name="CGIHandler" path="*.cgi" verb="*" modules="CgiModule" scriptProcessor="C:\Python27\python.exe -u &quot;%s&quot; &quot;%s&quot;" resourceType="Unspecified" /> </handlers> <defaultDocument> <files> <add value="hgweb.cgi" /> </files> </defaultDocument> <rewrite> <rules> <clear /> <rule name="hgweb.cgi" enabled="true" patternSyntax="Wildcard"> <match url="*" /> <conditions logicalGrouping="MatchAll" trackAllCaptures="false"> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> </conditions> <action type="Rewrite" url="hgweb.cgi/{R:1}" /> </rule> </rules> </rewrite> <security> <authorization> <remove users="*" roles="" verbs="" /> <add accessType="Allow" users="*" /> </authorization> </security> </system.webServer></configuration>

 

相关文章