##// END OF EJS Templates
notify: don't try to fix addresses if notify.domain is not set
Alexis S. L. Carvalho -
r4094:fbf0e9ac default
parent child Browse files
Show More
@@ -137,11 +137,12 b' class notifier(object):'
137 '''try to clean up email addresses.'''
137 '''try to clean up email addresses.'''
138
138
139 addr = templater.email(addr.strip())
139 addr = templater.email(addr.strip())
140 a = addr.find('@localhost')
140 if self.domain:
141 if a != -1:
141 a = addr.find('@localhost')
142 addr = addr[:a]
142 if a != -1:
143 if '@' not in addr:
143 addr = addr[:a]
144 return addr + '@' + self.domain
144 if '@' not in addr:
145 return addr + '@' + self.domain
145 return addr
146 return addr
146
147
147 def subscribers(self):
148 def subscribers(self):
@@ -8,18 +8,14 b' notify='
8 incoming.notify = python:hgext.notify.hook
8 incoming.notify = python:hgext.notify.hook
9
9
10 [notify]
10 [notify]
11 config = $HGTMP/.notify.conf
12 sources = pull
11 sources = pull
13 domain = test.com
14 strip = 3
15 template = Subject: {desc|firstline|strip}\nFrom: {author}\n\nchangeset {node|short} in {webroot}\ndescription:\n\t{desc|tabindent|strip}
16 diffstat = False
12 diffstat = False
17
13
18 [web]
19 baseurl = http://test/
20
21 [usersubs]
14 [usersubs]
22 foo@bar = *
15 foo@bar = *
16
17 [reposubs]
18 * = baz
23 EOF
19 EOF
24
20
25 hg help notify
21 hg help notify
@@ -35,6 +31,24 b' echo a >> a/a'
35 echo % commit
31 echo % commit
36 hg --traceback --cwd a commit -Amb -d '1 0'
32 hg --traceback --cwd a commit -Amb -d '1 0'
37
33
34 echo '% pull (minimal config)'
35 hg --traceback --cwd b pull ../a 2>&1 | sed -e 's/\(Message-Id:\).*/\1/' \
36 -e 's/changeset \([0-9a-f]* \)\?in .*test-notif/changeset \1in test-notif/' \
37 -e 's/^details: .*test-notify/details: test-notify/'
38
39 cat <<EOF >> $HGRCPATH
40 [notify]
41 config = $HGTMP/.notify.conf
42 domain = test.com
43 strip = 3
44 template = Subject: {desc|firstline|strip}\nFrom: {author}\n\nchangeset {node|short} in {webroot}\ndescription:\n\t{desc|tabindent|strip}
45
46 [web]
47 baseurl = http://test/
48 EOF
49
38 echo % pull
50 echo % pull
51 hg --cwd b rollback
39 hg --traceback --cwd b pull ../a 2>&1 | sed -e 's/\(Message-Id:\).*/\1/' \
52 hg --traceback --cwd b pull ../a 2>&1 | sed -e 's/\(Message-Id:\).*/\1/' \
40 -e 's/changeset \([0-9a-f]*\) in .*/changeset \1/'
53 -e 's/changeset \([0-9a-f]*\) in .*/changeset \1/'
54
@@ -6,7 +6,35 b' adding a'
6 % clone
6 % clone
7 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
7 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
8 % commit
8 % commit
9 % pull (minimal config)
10 pulling from ../a
11 searching for changes
12 adding changesets
13 adding manifests
14 adding file changes
15 added 1 changesets with 1 changes to 1 files
16 Subject: changeset in test-notify/b: b
17 From: test
18 X-Hg-Notification: changeset 0647d048b600
19 Message-Id:
20 To: baz, foo@bar
21
22 changeset 0647d048b600 in test-notify/b
23 details: test-notify/b?cmd=changeset;node=0647d048b600
24 description:
25 b
26
27 diffs (6 lines):
28
29 diff -r cb9a9f314b8b -r 0647d048b600 a
30 --- a/a Thu Jan 01 00:00:00 1970 +0000
31 +++ b/a Thu Jan 01 00:00:01 1970 +0000
32 @@ -1,1 +1,2 @@ a
33 a
34 +a
35 (run 'hg update' to get a working copy)
9 % pull
36 % pull
37 rolling back last transaction
10 pulling from ../a
38 pulling from ../a
11 searching for changes
39 searching for changes
12 adding changesets
40 adding changesets
@@ -17,7 +45,7 b' Subject: b'
17 From: test@test.com
45 From: test@test.com
18 X-Hg-Notification: changeset 0647d048b600
46 X-Hg-Notification: changeset 0647d048b600
19 Message-Id:
47 Message-Id:
20 To: foo@bar
48 To: baz@test.com, foo@bar
21
49
22 changeset 0647d048b600
50 changeset 0647d048b600
23 description:
51 description:
General Comments 0
You need to be logged in to leave comments. Login now