2010-05-04 132 views
2

有人能告诉我什么是不正确的在我的.hgrc配置?我试图在每次推送和/或提交后使用gmail发送电子邮件。mercurial .hgrc通知钩子

.hgrc

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

[ui] 
username = intern <[email protected]> 
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 = [email protected] 

[smtp] 
host = smtp.gmail.com 
username = [email protected] 
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" [email protected] "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" [email protected] "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! 

回答

2

你按照"AccessingSshRepositoriesFromWindows"的相关详细步骤?

如果是的话,你仍然可以尝试:

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

+0

我厌倦了上述的一步一步...相同的结果。 “服务器意外关闭网络连接” – Eeyore 2010-05-05 03:04:29

1

我相信你必须在本地拥有私钥,并且公钥在目标机器上。尽管如此,它看起来很奇怪。

0

问题可能出在推送不通过使用通知扩展的发送电子邮件。

如果您正确地按照说明进行操作,可能是因为公钥和私钥存在问题。

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

您将在客户端使用选美器(添加按键)的密钥的私钥。

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

相关问题