【问题标题】:Get a 404 Error when clone, pull mercurial repository克隆时出现 404 错误,拉 mercurial 存储库
【发布时间】:2011-06-25 14:04:44
【问题描述】:

我在这里有一个存储库http://repos.joomlaguruteam.com/

我使用 hgweb.cgi 这是我的 hgweb.config 文件

[web]
baseurl = 
#allowpull = true
allow_push = *
push_ssl = false
allow_archive = bz2 gz zip

[paths]
/ = /home/repos/*

我可以浏览它,但我不能克隆它。每次我克隆它时都会出现这个错误

hg clone http://repos.joomlaguruteam.com/hello
destination directory: hello
requesting all changes
abort: HTTP Error 404: Not Found

访问日志有这个

115.5.95.59 - - [10/Feb/2011:04:20:33 -0600] "GET /hello?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between HTTP/1.1" 200 1 "-" "mercurial/proto-1.0"
115.5.95.59 - - [10/Feb/2011:04:20:34 -0600] "GET /hello?cmd=heads HTTP/1.1" 200 41 "-" "mercurial/proto-1.0"
115.5.95.59 - - [10/Feb/2011:04:20:34 -0600] "GET /hello?cmd=changegroup&roots=0000000000000000000000000000000000000000 HTTP/1.1" 404 597 "-" "mercurial/proto-1.0"

但我可以使用未压缩传输克隆它

hg clone --uncompressed http://repos.joomlaguruteam.com/hello

但现在我不知道如何从存储库中拉取,因为当我从它拉取时。 它有与克隆相同的问题。也用于传入。

这是我的 .htaccess 文件

Options +ExecCGI
RewriteEngine On
#write base depending on where the base url lives
#RewriteBase /hg
RewriteRule ^$ hgweb.cgi  [L]
# Send requests for files that exist to those files.
RewriteCond %{REQUEST_FILENAME} !-f
# Send requests for directories that exist to those directories.
RewriteCond %{REQUEST_FILENAME} !-d
# Send requests to hgweb.cgi, appending the rest of url.
RewriteRule (.*) hgweb.cgi/$1  [QSA,L]

我可以将修订推送到存储库,但不能从中提取。

有没有办法配置它或让它工作。

非常感谢你帮助我。

谢谢, 元

【问题讨论】:

  • @Damiel 阅读常见问题解答(如“程序员常用的软件工具”)和关于 VCS 和 IDE 的大量非编程问题
  • 你的 .htaccess 是什么样的?
  • 嗨@TheLQ,我已经在问题上添加了我的 .htaccess 文件

标签: mercurial clone apache-config hgrc


【解决方案1】:

好的,我发现了问题。

注释掉 /home/my_username/.hgrc 中的以下行

#verbose = True

更多详情here

【讨论】:

  • 将链接的相关部分复制到答案会很棒,因为它现在已经死了......
【解决方案2】:

这听起来很明显,但您是否尝试过取消注释 hgweb.config 文件中的 #allowpull = true 行?

【讨论】:

  • 其实allowpull选项默认为true。
  • 嗨@splattne 和@TomFluff,问题出在/home/my_username/.hgrc 文件中。注释掉这一行#verbose = True。更多详情here
【解决方案3】:

问题:您是否正在运行 hgweb.cgi 并通过您的 Web 服务器对其进行别名处理?

如果是这样,http://url/hello 可能实际上指向http://url/hgweb.cgi/hello,这可能是它正在寻找的路径。通常,您有一个服务于 mercurial Web 界面的 cgi 脚本。

【讨论】:

  • 哦,另外,如果您的工作或您所在的位置与我的一样,他们可能会为外部位置阻止类似的内容 C:\hello>hg clone repos.joomlaguruteam.com/hello abort: error: No connection could be因为目标机器主动拒绝了它
  • 是的,我正在使用 hgweb.cgi 并使用 .htaccess 来执行此操作
  • 这不是真的,因为您可以使用未压缩的传输来克隆它。您也可以推送到存储库。
【解决方案4】:
  1. 将 mercurial 升级到最新版本

  2. 尝试将 [paths] 部分替换为

    [collections]
    / = /home/repos
    
    [web]
    baseurl =
    
  3. 为你所有的 repos 更新 hgrc

    [web]
    allow_read = YOUR_USER1, YOUR_USER2
    allow_push = YOUR_USER1
    push_ssl = false
    

【讨论】:

  • Windows 上 [collections] 的语法是什么?
【解决方案5】:

当您在 IIS 中托管 hgweb 并且拉取请求超过服务器上的最大查询字符串长度时,也会发生这种情况。可以通过配置system.webServer/security/requestFilters/requestLimits config 部分来增加默认的 2048 字节。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-06-09
    • 2019-02-01
    • 1970-01-01
    • 2011-11-16
    • 2012-02-05
    • 1970-01-01
    相关资源
    最近更新 更多