关于推送通知:Mercurial .hgrc通知钩子

mercurial .hgrc notify hook

有人可以告诉我我的.hgrc配置不正确吗?我试图在每次推送和/或提交后使用gmail发送电子邮件。

.hgrc

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
[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 = \
details:   {baseurl}{webroot}/rev/{node|short}\
changeset: {rev}:{node|short}\
user:      {author}\
date:      {date|date}\
description:\
{desc}\

maxdiff = 300

错误

1
2
3
4
5
6
7
8
9
10
11
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!

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

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

Plink.exe also has a -batch argument which tells plink to run non-interactively.
Any activity that would normally require user interaction (a new host key, for instance) will cause plink to exit immediately rather than stall.
When an ssh operation fails, you can use the --debug argument to figure out what went wrong.


我相信您必须在本地拥有私钥,并且公钥必须位于目标计算机上。它确实可以连接似乎确实很奇怪。


问题可能出在推送上,而不是使用使用notify扩展名发送电子邮件。

如果您正确地遵循了说明,那么公用密钥和专用密钥可能会出现问题。

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

您将在具有选美功能的客户端上使用密钥的私钥("添加密钥"按钮)。

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