1

I'm trying to use the notify extension in a project to get notified when someone pushes or pulls from the repository but no notifications are sent ...

my hgrc file :

    [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

subscription.conf file :

[reposubs]
* = someone@abc.com

output log :

 % 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% 

thanks in advance

2 Answers2

1

I have seen a number of possible issues.

(A) Your config file path looks wrong.

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

if you want to use an absolute path use something like

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

Remember that when you dont specify the double forward slashes, you are referencing the location of the config file relative to your repository.

(B) Also - when all is said and done set test to False.

(C) Your smtp information is wrong. set to 'localhost' without the quotes or the correct value.

0

I think you need to set the value of test to False for the extension to actually send the notifications out

smooth reggae
  • 2,189
  • 13
  • 14
  • right now im just testing ... i've also tried with its value set to false but not working also – Mustafa Abdel-Khalik Sep 10 '12 at 15:12
  • Try adding `debug = True` under the `[ui]` section of the `hgrc` file under your source and target repositories. This will get Mercurial to print out some more information that might help you figure out what is going on. – smooth reggae Sep 10 '12 at 15:16
  • Also, I presume `host = smtp` is just an obfuscated version and the actual value of `host` in the `hgrc` file is the name or IP address of a working accessible SMTP server – smooth reggae Sep 10 '12 at 15:18
  • I've added debug=True, also host= a working STMP server ... still not working ... output: test.txt calling hook commit.lfiles: committed changeset 2:383a96872d17 [command completed successfully Tue Sep 11 12:10:30 2012] Test% – Mustafa Abdel-Khalik Sep 11 '12 at 10:14
  • What output do you get when you run `hg push` now? A `commit` will not trigger it; only pushes will work (hence the `changegroup.notify`); I presume you have the extension configured in `TestRepo1` – smooth reggae Sep 11 '12 at 12:51