Hg WebServer 搭建

Win7系統 64位, 如下程序均爲64位.html

1. python-2.7.12.amd64.msi                        [必須]        本機測試安裝目錄  C:\\Python27\python

2. mercurial-4.7.1.win-amd64-py2.7.msi      [必須]       本機測試安裝後自動到  C:\\Python27\\Lib\\site-packages\c++

3. ttortoisehg-4.5.3-x64.msi                          [可選]       依賴 vc++2015git

4. rewrite_amd64_zh-CN.msi                       [可選]       依賴 vc++2015web

 

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 __load
ImportError: 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=53587app

 錯誤參照 -->  https://bitbucket.org/tortoisehg/thg/issues/4972/importerror-dll-load-failedide

 

詳細安裝步驟請參照測試

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

 

hgweb.cgi 文件spa

#!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 sys
sys.path.insert(0, "C:\\Python27\\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)

hgweb.config 文件

[paths] 
/Repositories/ = C:/SourceCode/* 
[web] 
encoding = UTF-8
descend = True
push_ssl = false
baseurl = /
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>
相關文章
相關標籤/搜索