Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/mercurial/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iis 7 在IIS7上托管Mercurial_Iis 7_Mercurial_Windows Server 2008 - Fatal编程技术网

Iis 7 在IIS7上托管Mercurial

Iis 7 在IIS7上托管Mercurial,iis-7,mercurial,windows-server-2008,Iis 7,Mercurial,Windows Server 2008,注意,这可能最适合serverfault.com,但因为它是关于托管程序员源代码存储库的,所以我不能完全确定。我先在这里发帖,相信它会在必要时被迁移 我正试图在我自己的服务器上托管Mercurial存储库的克隆(我在其他地方有主repo),并试图在IIS下设置Mercurial 我遵循了指南,但收到了一条错误消息 已解决:有关详细信息,请参阅此问题的底部 错误消息是: mercurial.error.RepoError:未找到存储库/path/to/repo/或/config 这就是我所做的 我

注意,这可能最适合serverfault.com,但因为它是关于托管程序员源代码存储库的,所以我不能完全确定。我先在这里发帖,相信它会在必要时被迁移

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

我遵循了指南,但收到了一条错误消息

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

错误消息是:

mercurial.error.RepoError:未找到存储库/path/to/repo/或/config

这就是我所做的

  • 我安装了Mercurial 1.5.2
  • 我创建了c:\inetpub\hg
  • 我按照网页的说明下载了hg源代码,并将hgweb.cgi文件复制到c:\inetpub\hg(注意,网页上说
    hgwebdir.cgi
    ,但这个特定的文件不存在,
    hgweb.cgi
    确实存在,但是,这可能是问题的根源吗?
  • 我添加了一个hgweb.config,包含以下内容:

    [paths]
    repo1 = C:/hg/**
    [web]
    style = monoblue
    
  • 我创建了c:\hg,创建了一个子目录测试,并在其中创建了一个存储库

  • 我在网站上安装了Python2.6.5,这是最新的2.6版本(该网页提到我需要安装正确的版本,否则我会收到一条特定的错误消息,因为我没有收到一条与上面提到的错误消息相去甚远的错误消息,我假设2.6.5不是问题所在)
  • 我添加了一个新的虚拟主机hg.vkarlsen.no,将其指向c:\inetpub\hg
  • 对于这个主机,我在Handler Mappings部分下添加了一个脚本映射,按照网站上的说明将*.cgi映射到
    c:\python26\python.exe-u%s%s
  • 然后,我通过导航到对其进行了测试,但收到一条错误消息

    为了便于测试,我跳转到命令提示符,导航到c:\inetpub\hg,并执行以下命令(错误消息是下面文本的一部分):

    这就是我的具体错误消息的来源

    如果我将行更改为:

    config = "c:\\hg\\test"
    
    然后我可以通过Mercurial 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
    
    • 我不记得还有其他各种变化
    所以,还是很难办,给谁指点


    希望这个问题能给其他人一些信息,如果他们像我一样被难倒。

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

    from:  from mercurial.hgweb import hgweb, wsgicgi
           application = hgweb(config)
    
    to:    from mercurial.hgweb import hgweb, hgwebdir, wsgicgi
           application = hgwebdir(config)
    
    [collections]
    C:/hg/ = C:/hg/
    
    [web]
    style = gitweb
    
    请注意此处添加的hgwebdir部分。这是我的hgweb.config文件,与hgweb.cgi文件位于同一目录中:

    from:  from mercurial.hgweb import hgweb, wsgicgi
           application = hgweb(config)
    
    to:    from mercurial.hgweb import hgweb, hgwebdir, wsgicgi
           application = hgwebdir(config)
    
    [collections]
    C:/hg/ = C:/hg/
    
    [web]
    style = gitweb
    

    现在,这已成功为我的存储库提供服务。

    您可以自己回答并接受您的答案,这样问题就不会显示为未回答。谢谢提醒。
    [collections]
    C:/hg/ = C:/hg/
    
    [web]
    style = gitweb