在Windows Server 2008上设置Mercurial时出错

5 投票
1 回答
4164 浏览
提问于 2025-04-15 18:22

我想搭建一个Mercurial SC服务器,一直在按照这里的说明进行操作:http//stackoverflow.com/questions/818571/how-to-setup-mercurial-and-hgwebdir-on-iis

我已经多次检查了我的设置,但在完成配置后,还是无法解决这个错误。如果有任何建议,我会很感激。谢谢。

Server Error in Application "DEFAULT WEB SITE/HG"Internet Information Services 7.5

Error Summary
HTTP Error 502.2 - Bad Gateway
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are "Traceback (most recent call last): File "C:\inetpub\hgcgi\hgwebdir.cgi", line 12, in <module> from mercurial import demandimport; demandimport.enable() ImportError: No module named mercurial ". Detailed Error InformationModule CgiModule
Notification ExecuteRequestHandler
Handler Python 2.5
**Error Code 0x00000001**
Requested URL http://localhost:80/hg/hgwebdir.cgi
Physical Path C:\inetpub\hgcgi\hgwebdir.cgi
Logon Method Anonymous
Logon User Anonymous
 Most likely causes:
The CGI process was shut down or terminated unexpectedly before it finished processing the request.
The CGI process has a flaw and does not return a complete set of HTTP headers.
 Things you can try:
Check the event logs on the system to see whether the CGI process is shutting down unexpectedly.
Troubleshoot the CGI application to determine why it is not sending a complete set of HTTP headers. 

1 个回答

6

错误信息的很长一行显示,找不到 mercurial 这个东西在你的 PYTHON_PATH 里。你可以试着按照 HgWebDirStopByStep 页面第 5.1 步的说明来编辑 hgwebdir.cgi。

# adjust python path if not a system-wide install:
import sys
sys.path.insert(0, "c:/dev/Mercurial/lib")

在这里,当然要插入的路径部分需要调整,以指向你 mercurial 库文件所在的位置。

撰写回答