1

我正在尝试在项目中使用通知扩展来在有人从存储库中推送或拉取但未发送通知时获得通知......

我的 hgrc 文件:

    [paths]
default = // repo URL
[extensions]
hgext.notify= 

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

[email]
from = my email 

[smtp]
host = smtp

username = my username
password = password
port = 26
tls = true
local_hostname = example.com

[web]

    baseurl = http://hgserver/...

[notify]
sources = serve push pull bundle

test = True

config = ../../../Repos/subscription.conf

template = 
  details:   {baseurl}{webroot}/rev/{node|short}
  branches:  {branches}
  changeset: {rev}:{node|short}
  user:      {author}
  date:      {date|date}
  description:
  {desc}\n

maxdiff = 300

订阅.conf 文件:

[reposubs]
* = someone@abc.com

输出日志:

 % hg commit --repository D:\Repos\Test Repo --verbose --user mabdelkh@TATTIA_DSKTP1.mgc.mentorg.com --message=vhghg D:\Repos\Test Repo\src/test1.c
src/test1.c
calling hook commit.lfiles: <function checkrequireslfiles at 0x000000000845C2E8>
committed changeset 34:cbecf228369e
[command completed successfully Mon Sep 10 14:53:50 2012]

    % hg --repository D:\Repos\Test Repo push http://svr-hub-rnd-02:8000/Hg/TestRepo1/
    pushing to http://svr-hub-rnd-02:8000/Hg/TestRepo1/

searching for changes
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 1 changesets with 1 changes to 1 files
[command completed successfully Mon Sep 10 14:54:02 2012]
Test Repo% 

提前致谢

4

2 回答 2

1

我已经看到了许多可能的问题。

(A) 您的配置文件路径看起来错误。

../../../Repos/subscription.conf

如果您想使用绝对路径,请使用类似

//etc/path/to/file/subscription.conf

请记住,当您不指定双正斜杠时,您将引用配置文件相对于您的存储库的位置。

(B) 另外 - 当一切都说完后,将 test 设置为 False。

(C) 你的 smtp 信息有误。设置为不带引号或正确值的 'localhost'。

于 2012-11-14T16:07:39.640 回答
0

我认为您需要为扩展设置值testFalse实际发送通知

于 2012-09-10T14:25:36.193 回答