0

为了集成我们的 Mercurial 存储库和我们的错误跟踪器(Bugzilla 4.0.1),我设置了服务器端hgrc文件,如下所示:

[extensions]
hgext.bugzilla=

[hooks]
incoming.bugzilla=python:hgext.bugzilla.hook

[bugzilla]
bzurl=http://localhost/bugzilla
user=some.user@this.domain
password=password
version=xmlrpc
hgweb=http://this-server:65432/
template=Changeset {node|short} in {root|basename}.\nDetails siehe {hgweb}{webroot}?cmd=changeset;node={node|short}\nBeschreibung:\n\t{desc|tabindent}

[usermap]
committer_email=bugzilla_user_name

[web]
push_ssl=False
allow_push=*
baseurl=http://this-server:65432

Mercurial 设置为在this-server的端口65432上提供服务。

现在,在开始之后hg serve,第一次推送将被处理得很好。在提交消息中发现的所有错误引用都将生成 Bugzilla 注释。但是在每次出现至少一个错误引用的后续推送中,都会向用户显示以下错误消息:

pushing to http://this-server:65432/
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 1 changesets with 1 changes to 1 files
remote: error: incoming.bugzilla hook failed: Bugzilla error:

曾多次观察到此消息:

remote: error: incoming.bugzilla hook failed: Bugzilla error: [Errno 54] Connection reset by peer

在 bugzilla 中不创建任何评论。重新启动hg将使其再次正常工作。

我还尝试使用参数启动 Mercurial 服务器,-A ... -E ...以使其创建访问和错误日​​志。访问日志显示每个请求的相同类型的交互,无论成功与否:

192.168.117.78 - - [20/Feb/2013 10:19:03] "GET /?cmd=capabilities HTTP/1.1" 200 -
192.168.117.78 - - [20/Feb/2013 10:19:03] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3Dc3ee38280c255a62c2742304622d8fcf29959863+b8cbc9948834a83b9a8f6dd9f1b96d5f39224324+54f5e40379910d6026b8656fe0982bb5b7e9e22b
192.168.117.78 - - [20/Feb/2013 10:19:03] "GET /?cmd=branchmap HTTP/1.1" 200 -
192.168.117.78 - - [20/Feb/2013 10:19:03] "GET /?cmd=branchmap HTTP/1.1" 200 -
192.168.117.78 - - [20/Feb/2013 10:19:04] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks
192.168.117.78 - - [20/Feb/2013 10:19:09] "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=686173686564+be8d19f7ab04e73ad36715ec876b4dd74384a920
192.168.117.78 - - [20/Feb/2013 10:19:09] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases
192.168.117.78 - - [20/Feb/2013 10:19:09] "POST /?cmd=pushkey HTTP/1.1" 200 - x-hgarg-1:key=54f5e40379910d6026b8656fe0982bb5b7e9e22b&namespace=phases&new=0&old=1
192.168.117.78 - - [20/Feb/2013 10:19:10] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks
192.168.117.78 - - [20/Feb/2013 10:20:04] "GET /?cmd=capabilities HTTP/1.1" 200 -
192.168.117.78 - - [20/Feb/2013 10:20:05] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3Dc3ee38280c255a62c2742304622d8fcf29959863+b8cbc9948834a83b9a8f6dd9f1b96d5f39224324+7fbb4c09e39db549ed01532785e80eda480e8862
192.168.117.78 - - [20/Feb/2013 10:20:05] "GET /?cmd=branchmap HTTP/1.1" 200 -
192.168.117.78 - - [20/Feb/2013 10:20:05] "GET /?cmd=branchmap HTTP/1.1" 200 -
192.168.117.78 - - [20/Feb/2013 10:20:05] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks
192.168.117.78 - - [20/Feb/2013 10:20:05] "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=686173686564+f71bb72e20c8f91b9d0ca3b5fbdef2aac667c265
192.168.117.78 - - [20/Feb/2013 10:20:05] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases
192.168.117.78 - - [20/Feb/2013 10:20:06] "POST /?cmd=pushkey HTTP/1.1" 200 - x-hgarg-1:key=7fbb4c09e39db549ed01532785e80eda480e8862&namespace=phases&new=0&old=1
192.168.117.78 - - [20/Feb/2013 10:20:06] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks

错误日志为空。

如何进一步诊断此问题?

4

1 回答 1

1

hg serve调用不适合长期使用。这是为了“嘿,克隆我开始的这个东西”在局域网上的好友之间。来自Mercurial 维基

除非您需要在几分钟内发布存储库的临时情况,例如从笔记本电脑中提取更改,否则不建议这样做。

我怀疑如果你启动一个真正的 wsgi 容器,一切都会奏效。我没有使用 bugzilla 钩子,但我猜它不会自行清理,因为它预计会在 wsgi 容器或命令行调用中被清除。

于 2013-02-21T04:05:15.787 回答