mercurial .hgrc notify hook

时间:2010-05-04 03:47:14

标签: mercurial push-notification hgrc

有人能告诉我 .hgrc 配置中的错误吗?我试图在每次推送和/或提交后使用 gmail 发送电子邮件。

.hgrc

[paths]
default = ssh://www.domain.com/repo/hg

[ui]
username = intern <user@domain.com>
ssh="C:\Program Files (x86)\Mercurial\plink.exe" -ssh -i "C:\Program Files (x86)\Mercurial\key.pub"

[extensions]
hgext.notify = 

[hooks]
changegroup.notify = python:hgext.notify.hook
incoming.notify = python:hgext.notify.hook

[email]
from = user@domain.com

[smtp]
host = smtp.gmail.com
username = user@gmail.com
password = sure
port = 587
tls = true

[web]
baseurl = http://dev/...

[notify]
sources = serve push pull bundle
test = False
config = /path/to/subscription/file
template = \ndetails:   {baseurl}{webroot}/rev/{node|short}\nchangeset: {rev}:{node|short}\nuser:      {author}\ndate:      {date|date}\ndescription:\n{desc}\n
maxdiff = 300

错误

Incoming comand failed for P/project. running ""C:\Program Files (x86)\Mercurial\plink.exe" -ssh -i "C:\Program Files (x86)\Mercurial\key.pub" user@domain.com "hg -R repo/hg serve --stdio""
sending hello command
sending between command
remote: FATAL ERROR: Server unexpectedly closed network connection
abort: no suitable response from remote hg!
, error code: -1
  running ""C:\Program Files (x86)\Mercurial\plink.exe" -ssh -i "C:\Program Files (x86)\Mercurial\key.pub" user@domain.com "hg -R repo/hg serve --stdio""
sending hello command
sending between command
remote: FATAL ERROR: Server unexpectedly closed network connection
abort: no suitable response from remote hg!

3 个答案:

答案 0 :(得分:2)

您是否按照"AccessingSshRepositoriesFromWindows"中详细说明的步骤进行了操作?

如果是,您仍然可以尝试:

  

Plink.exe也有一个-batch参数,告诉plink以非交互方式运行   通常需要用户交互的任何活动(例如,新的主机密钥)将导致plink立即退出而不是停止   ssh操作失败时,您可以使用--debug参数来找出出错的地方

答案 1 :(得分:1)

我相信您必须在本地拥有私钥,并且公钥会在目标计算机上运行。虽然它完全连接似乎很奇怪。

答案 2 :(得分:0)

问题可能在于推送没有使用通知扩展的发送电子邮件。

如果您按照说明正确操作,可能是公钥和私钥有问题。

您需要在服务器上编辑authorized_keys,在用户的.ssh文件夹中,并将密钥的公钥放在此文件中。

您将在客户端使用您的密钥的私钥与分页(添加密钥按钮)。

如果您发送大量自动电子邮件,我建议您使用其他电子邮件服务代替Gmail。 gmail可以将你的IP列入黑名单并阻止电子邮件。