问题:
19/06/10 更新:更多的证据问题是服务器端的。在 Windows 7 命令行上收到此错误(完整回溯见下文):
URLError: <urlopen error [Errno 10054] An existing connection was forcibly closed by the remote host>
abort: error: An existing connection was forcibly closed by the remote host
尝试将包含 6 个大文件(.exe、.dmg 等)的变更集推送到我的远程服务器时,我的客户端 (MacHG) 报告错误:
“推送期间出错。Mercurial 报告错误号 255:中止:HTTP 错误 404:未找到”
错误甚至是什么意思?!关于此提交的唯一独特之处(我可以说)是文件的大小、类型和文件名。如何确定变更集中的哪个确切文件失败?如何从存储库中删除损坏的变更集?在另一篇文章中,有人报告说使用“mq”扩展来有效地从存储库中的历史记录中删除错误的变更集,但 mq 对于我要解决的问题来说看起来过于复杂。
背景:
我可以使用 MacHG 和 toirtoise HG 在服务器之间推送和拉取以下内容:源文件、目录、.class 文件和 .jar 文件。
我第一次成功地向我的本地存储库提交了 6 个大型 .exe、.dmg 等安装程序文件(总共约 130Mb)。
在对我的本地存储库的以下提交中,我删除(“未跟踪”/忘记)导致问题的 6 个文件,但是前一个(失败的)变更集仍然排队等待推送到服务器(即我的本地主机正在尝试推送“添加”然后“删除”到远程服务器 - 并与源代码控制系统的“保留历史记录”理念保持一致)。
我可以使用 Windows PC 上的 TortoiseHG 提交 .txt .java 文件等。我实际上并没有测试使用 TortoiseHG 提交或推送相同的大文件。
请帮忙!
设置:
客户端应用程序 = MacHG v0.9.7 (SCM 1.5.4) 和 TortoiseHG v1.0.4 (SCM 1.5.4)
服务器 = HTTPS、IIS7.5、Mercurial 1.5.4、Python 2.6.5,使用以下说明进行设置:
http://www.jeremyskinner.co.uk/mercurial-on-iis7/
在 IIS7.5 中,CGI 处理程序被配置为处理所有动词(不仅仅是 GET、POST 和 HEAD)。
我在服务器上的 hgweb.cgi 文件如下:
#!/usr/bin/env python
#
# An example hgweb CGI script, edit as necessary
# Path to repo or hgweb config to serve (see 'hg help hgweb')
#config = "/path/to/repo/or/config"
# Uncomment and adjust if Mercurial is not installed system-wide:
#import sys; sys.path.insert(0, "/path/to/python/lib")
# Uncomment to send python tracebacks to the browser if an error occurs:
#import cgitb; cgitb.enable()
from mercurial import demandimport; demandimport.enable()
from mercurial.hgweb import hgweb, wsgicgi
application = hgweb('C:\inetpub\wwwroot\hg\hgweb.config')
wsgicgi.launch(application)
我在服务器上的 hgweb.config 文件如下:
[collections]
C:\Mercurial Repositories = C:\Mercurial Repositories
[web]
baseurl = /hg
allow_push = usernamea
allow_push = usernameb
使用 -v 和 --trackback 标志从我的 macbook(安装了 Mercurial 和 MacHG)的命令行输出:
macbook15:hgrepos coderunner$ hg -v --traceback push
pushing to https://coderunner:***@hg.mydomain.com.au/hg/hgrepos
searching for changes
3 changesets found
Traceback (most recent call last):
File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 50, in _runcatch
return _dispatch(ui, args)
File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 471, in _dispatch
return runcommand(lui, repo, cmd, fullargs, ui, options, d)
File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 341, in runcommand
ret = _runcommand(ui, options, cmd, d)
File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 522, in _runcommand
return checkargs()
File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 476, in checkargs
return cmdfunc()
File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 470, in <lambda>
d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
File "/Library/Python/2.6/site-packages/mercurial/util.py", line 401, in check
return func(*args, **kwargs)
File "/Library/Python/2.6/site-packages/mercurial/commands.py", line 2462, in push
r = repo.push(other, opts.get('force'), revs=revs)
File "/Library/Python/2.6/site-packages/mercurial/localrepo.py", line 1491, in push
return self.push_unbundle(remote, force, revs)
File "/Library/Python/2.6/site-packages/mercurial/localrepo.py", line 1636, in push_unbundle
return remote.unbundle(cg, remote_heads, 'push')
File "/Library/Python/2.6/site-packages/mercurial/httprepo.py", line 235, in unbundle
heads=' '.join(map(hex, heads)))
File "/Library/Python/2.6/site-packages/mercurial/httprepo.py", line 134, in do_read
fp = self.do_cmd(cmd, **args)
File "/Library/Python/2.6/site-packages/mercurial/httprepo.py", line 85, in do_cmd
resp = self.urlopener.open(req)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py", line 389, in open
response = meth(req, response)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py", line 502, in http_response
'http', request, response, code, msg, hdrs)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py", line 427, in error
return self._call_chain(*args)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py", line 361, in _call_chain
result = func(*args)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py", line 510, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 404: Not Found
abort: HTTP Error 404: Not Found
macbook15:hgrepos coderunner$
来自 Windows 7 主机(仅安装 TortoiseHG)的输出尝试将相同的文件推送到服务器(不同的变更集,但包含与从 macbook 推送的变更集相同的 6 个文件添加)
c:\repositories\hgrepos>hg -v --traceback push
pushing to https://coderunner:***@hg.mydomain.com.au/hg/hgrepos
searching for changes
1 changesets found
Traceback (most recent call last):
File "mercurial\dispatch.pyo", line 50, in _runcatch
File "mercurial\dispatch.pyo", line 471, in _dispatch
File "mercurial\dispatch.pyo", line 341, in runcommand
File "mercurial\dispatch.pyo", line 522, in _runcommand
File "mercurial\dispatch.pyo", line 476, in checkargs
File "mercurial\dispatch.pyo", line 470, in <lambda>
File "mercurial\util.pyo", line 401, in check
File "mercurial\commands.pyo", line 2462, in push
File "mercurial\localrepo.pyo", line 1491, in push
File "mercurial\localrepo.pyo", line 1636, in push_unbundle
File "mercurial\httprepo.pyo", line 235, in unbundle
File "mercurial\httprepo.pyo", line 134, in do_read
File "mercurial\httprepo.pyo", line 85, in do_cmd
File "urllib2.pyo", line 389, in open
File "urllib2.pyo", line 407, in _open
File "urllib2.pyo", line 367, in _call_chain
File "mercurial\url.pyo", line 523, in https_open
File "mercurial\keepalive.pyo", line 259, in do_open
URLError: <urlopen error [Errno 10054] An existing connection was forcibly closed by the remote host>
abort: error: An existing connection was forcibly closed by the remote host
c:\repositories\hgrepos>
这是一个保持活力的问题吗?IIS7.5 有问题吗?Python 2.6.5 出错了?