Mercurial-Bugzilla-Hook只能使用一次

时间:2013-02-20 08:52:07

标签: mercurial hook bugzilla

为了集成我们的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设置为此服务器,端口 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 将使其再次正常工作。

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

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

错误日志为空。

如何进一步诊断此问题?

1 个答案:

答案 0 :(得分:1)

hg serve调用不适合长期使用。它是“嘿,克隆这个我开始的东西”在局域网上的伙伴之间。来自the Mercurial wiki

  

除了需要发布存储库几分钟的临时情况之外,不建议使用它,例如从笔记本电脑中提取更改。

我怀疑如果你启动一个真正的wsgi容器,事情就会起作用。我没有使用过bugzilla钩子,但是我猜它不会自行清理,因为它需要在一个wsgi容器或命令行调用中被清除掉。