How do I get Mercurial's hgwebdir working on Windows?

前端 未结 5 1758
终归单人心
终归单人心 2021-01-02 09:20

These are the steps I took:

  • install apache 2.2.x
  • install TortoiseHg 0.7
  • copy hgwebdir.cgi, hgweb.config to cgi-bin
  • edit hgweb.config
5条回答
  •  情深已故
    2021-01-02 10:18

    My setup involves an apache 2.2.17, mod_wsgi 3.3, python 2.7.2, trac 0.12.2, mercurial 1.8.4. Two issues surfaced:

    1. mercurial demandimport initialization order
    2. mercurial unable to load DLLs in site-packages.

    I solved the problem as follows:

    1. change hgwebdir.wsgi to disable demandimport:

    from mercurial import demandimport; demandimport.disable()

    1. create a pure (.py only, no compiled .pyd) mercurial package and install. See also https://www.mercurial-scm.org/wiki/WindowsInstall

    E:\Dist\mercurial-1.8.4>setup.py --pure build
    E:\Dist\mercurial-1.8.4>setup.py --pure install

    The compiled versions (with Microsoft Visual Studio 2008) fail to load the DLL:

    [Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24] mod_wsgi (pid=6092): Exception occurred processing WSGI script 'D:/Home/web/apache/cgi-bin/hgwebdir.wsgi'.
    [Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24] Traceback (most recent call last):
    [Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24]   File "D:/Home/web/apache/cgi-bin/hgwebdir.wsgi", line 9, in 
    [Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24]     from mercurial.hgweb.hgwebdir_mod import hgwebdir
    [Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24]   File "C:\\Apps\\Python27\\lib\\site-packages\\mercurial\\hgweb\\__init__.py", line 10, in 
    [Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24]     import hgweb_mod, hgwebdir_mod
    [Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24]   File "C:\\Apps\\Python27\\lib\\site-packages\\mercurial\\hgweb\\hgweb_mod.py", line 10, in 
    [Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24]     from mercurial import ui, hg, hook, error, encoding, templater
    [Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24]   File "C:\\Apps\\Python27\\lib\\site-packages\\mercurial\\ui.py", line 10, in 
    [Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24]     import config, util, error
    [Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24]   File "C:\\Apps\\Python27\\lib\\site-packages\\mercurial\\config.py", line 9, in 
    [Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24]     import error, util
    [Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24]   File "C:\\Apps\\Python27\\lib\\site-packages\\mercurial\\util.py", line 17, in 
    [Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24]     import error, osutil, encoding
    [Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24] ImportError: DLL load failed: The specified module could not be found.
    

提交回复
热议问题