【问题标题】:mercurial .hgrc notify hookmercurial .hgrc 通知钩子
【发布时间】:2010-05-04 03:47:14
【问题描述】:

谁能告诉我我的 .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!

【问题讨论】:

    标签: mercurial push-notification hgrc


    【解决方案1】:

    您是否按照"AccessingSshRepositoriesFromWindows" 中详述的步骤操作?

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

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

    【讨论】:

    • 我厌倦了上述步骤......同样的结果。 “服务器意外关闭网络连接”
    【解决方案2】:

    我相信你必须在本地拥有私钥,而公钥在目标机器上。不过,它会连接起来似乎很奇怪。

    【讨论】:

      【解决方案3】:

      问题可能在于推送而不是使用通知扩展发送电子邮件。

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

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

      您将在客户端与选美比赛中使用的密钥的私钥(添加密钥按钮)。

      如果您发送大量自动电子邮件,我建议您使用其他电子邮件服务而不是 gmail。 gmail可以将你的ip加入黑名单并阻止电子邮件。

      【讨论】:

        猜你喜欢
        • 2012-04-11
        • 2016-09-16
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多