2010-05-19 87 views
10

请注意,这可能最适合于serverfault.com,但由于它是托管程序员源代码库,所以我不完全确定。我先在这里发帖,相信如果有必要,它会被迁移。在IIS7上托管Mercurial

我试图在我自己的服务器上托管我的Mercurial存储库的克隆(我在其他地方有主要的仓库),我试图在IIS下设置Mercurial。

我按照指南here ,但我收到一条错误消息

已解决:有关详细信息,请参阅此问题的底部。

的错误信息是:

mercurial.error.RepoError: repository /path/to/repo/or/config not found

这里就是我所做的。

  1. 我安装的Mercurial 1.5.2
  2. 我创建的C:\的Inetpub \汞柱
  3. 我下载了汞源按照网页的指示,并复制hgweb.cgi文件到C:\的Inetpub \汞柱(注意到,该网页说hgwebdir.cgi,但这个特殊的文件不存在,hgweb.cgi确实,但是,这会是问题的根源?
  4. 我加了一个hgweb.config,具有以下内容:

    [paths] 
    repo1 = C:/hg/** 
    [web] 
    style = monoblue 
    
  5. 我创建的C:\ HG,创建一个子目录测试,并创造里面

  6. 我Python安装2.6.5,最新的2.6版从网站存储库(网页提到我需要安装正确的版本,否则我会得到一个特定的错误信息,因为我没有看到类似上面提到的错误信息,我认为2.6.5不是问题)
  7. 我添加了一个新的虚拟主机hg.vkarlsen.no,将其指向c:\ inetpub \ hg
  8. 对于此主机,我在Handler Mappings部分下添加了一个脚本映射,将* .cgi映射到c:\python26\python.exe -u %s %s根据网站上的说明。

然后我通过导航到http://hg.vkarlsen.no/hgweb.cgi来测试它,但是我收到一条错误消息。

为了便于测试,我下降到一个命令,导航到c:\的Inetpub \ HG,并执行下面的命令(错误消息是下面的文本的一部分):

C:\inetpub\hg>c:\python26\python.exe -u hgweb.cgi 
Traceback (most recent call last): 
    File "hgweb.cgi", line 16, in <module> 
    application = hgweb(config) 
    File "mercurial\hgweb\__init__.pyc", line 12, in hgweb 

    File "mercurial\hgweb\hgweb_mod.pyc", line 30, in __init__ 

    File "mercurial\hg.pyc", line 82, in repository 

    File "mercurial\localrepo.pyc", line 2221, in instance 

    File "mercurial\localrepo.pyc", line 62, in __init__ 

mercurial.error.RepoError: repository /path/to/repo/or/config not found 

有谁知道我需要看看以解决这个问题吗?


编辑:好吧,我想我设法得到一个更接近的解决方案,但我还是难倒。

我意识到了。CGI文件是一个python脚本文件,而不是别的编译,所以我打开它进行编辑,而这些线路正坐在它:

# Path to repo or hgweb config to serve (see 'hg help hgweb') 
config = "/path/to/repo/or/config" 

所以这是我的具体错误消息源。

如果我改变行这样的:

config = "c:\\hg\\test" 

然后,我可以通过水银Web界面导航空库。

不过,我想举办多个仓库,看到作为行说,我还可以链接到一个hgweb配置文件,我尝试这样做:

config = "c:\\inetpub\\hg\\hgweb.config" 

但后来我收到以下错误信息:

mercurial.error.Abort: c:\inetpub\hg\hgweb.config: not a Mercurial bundle file 
Exception ImportError: 'No module named shutil' in <bound method bundlerepository.__del__ 
of <mercurial.bundlerepo.bundlerepository object at 0x0260A110>> ignored 

没有什么我已经试过了配置变量似乎工作:

config = "hgweb.config" 
config = "c:\\hg\\hgweb.config" 
  • 其他各种我不记得的变化。

那么,仍然难倒,指针任何人?

希望这个问题会给别人一些信息,如果他们像我一样难倒了。

+1

你可以自己回答并接受你的答案,所以这个问题不会显示为没有答案。 – tonfa 2010-09-01 12:00:40

+0

感谢您的提醒。 – 2010-09-01 21:16:27

回答

7

我最后不得不编辑hgweb.cgi文件:

from: from mercurial.hgweb import hgweb, wsgicgi 
     application = hgweb(config) 

to: from mercurial.hgweb import hgweb, hgwebdir, wsgicgi 
     application = hgwebdir(config) 

注意添加hgwebdir部分存在。这是我的hgweb.config文件,位于同一目录中hgweb.cgi文件:

[collections] 
C:/hg/ = C:/hg/ 

[web] 
style = gitweb 

这现任我的仓库成功。