开发者

mercurial .hgrc notify hook

Could someone tell me what is incorrect in my .hgrc configuration? I am trying to use gmail to send a e-mail after each push and/or commit.

.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

Error

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!


Did you follow the steps detailled in "AccessingSshRepositoriesFromWindows"?

If yes, you still can try:

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.


I believe you have to have the private key locally, and the public key goes on the target machine. It does seem strange that it would connect at all though.


The problem can be with the push not with the send email using notify extension.

If you followed the instructions correctly, maybe you have a problem if the public key and private key.

You need to edit the authorized_keys, at your server, inside .ssh folder of your user, and put your public key of your key inside this file.

The private key of your key you will use at client with pageant (Add Key button).

I recommend to use another email service instead gmail, maybe, if you send a lot of automatic email. gmail can put your ip to black list and block the emails.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜