Show More
@@ -137,11 +137,12 b' class notifier(object):' | |||
|
137 | 137 | '''try to clean up email addresses.''' |
|
138 | 138 | |
|
139 | 139 | addr = templater.email(addr.strip()) |
|
140 | a = addr.find('@localhost') | |
|
141 | if a != -1: | |
|
142 |
|
|
|
143 | if '@' not in addr: | |
|
144 | return addr + '@' + self.domain | |
|
140 | if self.domain: | |
|
141 | a = addr.find('@localhost') | |
|
142 | if a != -1: | |
|
143 | addr = addr[:a] | |
|
144 | if '@' not in addr: | |
|
145 | return addr + '@' + self.domain | |
|
145 | 146 | return addr |
|
146 | 147 | |
|
147 | 148 | def subscribers(self): |
@@ -8,18 +8,14 b' notify=' | |||
|
8 | 8 | incoming.notify = python:hgext.notify.hook |
|
9 | 9 | |
|
10 | 10 | [notify] |
|
11 | config = $HGTMP/.notify.conf | |
|
12 | 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 | 12 | diffstat = False |
|
17 | 13 | |
|
18 | [web] | |
|
19 | baseurl = http://test/ | |
|
20 | ||
|
21 | 14 | [usersubs] |
|
22 | 15 | foo@bar = * |
|
16 | ||
|
17 | [reposubs] | |
|
18 | * = baz | |
|
23 | 19 | EOF |
|
24 | 20 | |
|
25 | 21 | hg help notify |
@@ -35,6 +31,24 b' echo a >> a/a' | |||
|
35 | 31 | echo % commit |
|
36 | 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 | 50 | echo % pull |
|
51 | hg --cwd b rollback | |
|
39 | 52 | hg --traceback --cwd b pull ../a 2>&1 | sed -e 's/\(Message-Id:\).*/\1/' \ |
|
40 | 53 | -e 's/changeset \([0-9a-f]*\) in .*/changeset \1/' |
|
54 |
@@ -6,7 +6,35 b' adding a' | |||
|
6 | 6 | % clone |
|
7 | 7 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
8 | 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 | 36 | % pull |
|
37 | rolling back last transaction | |
|
10 | 38 | pulling from ../a |
|
11 | 39 | searching for changes |
|
12 | 40 | adding changesets |
@@ -17,7 +45,7 b' Subject: b' | |||
|
17 | 45 | From: test@test.com |
|
18 | 46 | X-Hg-Notification: changeset 0647d048b600 |
|
19 | 47 | Message-Id: |
|
20 | To: foo@bar | |
|
48 | To: baz@test.com, foo@bar | |
|
21 | 49 | |
|
22 | 50 | changeset 0647d048b600 |
|
23 | 51 | description: |
General Comments 0
You need to be logged in to leave comments.
Login now