码迷,mamicode.com
首页 > Web开发 > 详细

Hg WebServer 搭建

时间:2018-12-22 16:54:11      阅读:343      评论:0      收藏:0      [点我收藏+]

标签:details   rewrite   系统   ros   程序   测试   运行   文件   push   

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 __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=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 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>

 

Hg WebServer 搭建

标签:details   rewrite   系统   ros   程序   测试   运行   文件   push   

原文地址:https://www.cnblogs.com/wonderfuly/p/10160944.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!