##// END OF EJS Templates
tests: update test-notify to pass our import checker
Augie Fackler -
r33971:cefad71d default
parent child Browse files
Show More
@@ -1,609 +1,610
1 $ cat > $TESTTMP/filter.py <<EOF
1 $ cat > $TESTTMP/filter.py <<EOF
2 > from __future__ import print_function
2 > from __future__ import absolute_import, print_function
3 > import sys, re
3 > import re
4 > import sys
4 > print(re.sub("\n[ \t]", " ", sys.stdin.read()), end="")
5 > print(re.sub("\n[ \t]", " ", sys.stdin.read()), end="")
5 > EOF
6 > EOF
6
7
7 $ cat <<EOF >> $HGRCPATH
8 $ cat <<EOF >> $HGRCPATH
8 > [extensions]
9 > [extensions]
9 > notify=
10 > notify=
10 >
11 >
11 > [hooks]
12 > [hooks]
12 > incoming.notify = python:hgext.notify.hook
13 > incoming.notify = python:hgext.notify.hook
13 >
14 >
14 > [notify]
15 > [notify]
15 > sources = pull
16 > sources = pull
16 > diffstat = False
17 > diffstat = False
17 >
18 >
18 > [usersubs]
19 > [usersubs]
19 > foo@bar = *
20 > foo@bar = *
20 >
21 >
21 > [reposubs]
22 > [reposubs]
22 > * = baz
23 > * = baz
23 > EOF
24 > EOF
24 $ hg help notify
25 $ hg help notify
25 notify extension - hooks for sending email push notifications
26 notify extension - hooks for sending email push notifications
26
27
27 This extension implements hooks to send email notifications when changesets
28 This extension implements hooks to send email notifications when changesets
28 are sent from or received by the local repository.
29 are sent from or received by the local repository.
29
30
30 First, enable the extension as explained in 'hg help extensions', and register
31 First, enable the extension as explained in 'hg help extensions', and register
31 the hook you want to run. "incoming" and "changegroup" hooks are run when
32 the hook you want to run. "incoming" and "changegroup" hooks are run when
32 changesets are received, while "outgoing" hooks are for changesets sent to
33 changesets are received, while "outgoing" hooks are for changesets sent to
33 another repository:
34 another repository:
34
35
35 [hooks]
36 [hooks]
36 # one email for each incoming changeset
37 # one email for each incoming changeset
37 incoming.notify = python:hgext.notify.hook
38 incoming.notify = python:hgext.notify.hook
38 # one email for all incoming changesets
39 # one email for all incoming changesets
39 changegroup.notify = python:hgext.notify.hook
40 changegroup.notify = python:hgext.notify.hook
40
41
41 # one email for all outgoing changesets
42 # one email for all outgoing changesets
42 outgoing.notify = python:hgext.notify.hook
43 outgoing.notify = python:hgext.notify.hook
43
44
44 This registers the hooks. To enable notification, subscribers must be assigned
45 This registers the hooks. To enable notification, subscribers must be assigned
45 to repositories. The "[usersubs]" section maps multiple repositories to a
46 to repositories. The "[usersubs]" section maps multiple repositories to a
46 given recipient. The "[reposubs]" section maps multiple recipients to a single
47 given recipient. The "[reposubs]" section maps multiple recipients to a single
47 repository:
48 repository:
48
49
49 [usersubs]
50 [usersubs]
50 # key is subscriber email, value is a comma-separated list of repo patterns
51 # key is subscriber email, value is a comma-separated list of repo patterns
51 user@host = pattern
52 user@host = pattern
52
53
53 [reposubs]
54 [reposubs]
54 # key is repo pattern, value is a comma-separated list of subscriber emails
55 # key is repo pattern, value is a comma-separated list of subscriber emails
55 pattern = user@host
56 pattern = user@host
56
57
57 A "pattern" is a "glob" matching the absolute path to a repository, optionally
58 A "pattern" is a "glob" matching the absolute path to a repository, optionally
58 combined with a revset expression. A revset expression, if present, is
59 combined with a revset expression. A revset expression, if present, is
59 separated from the glob by a hash. Example:
60 separated from the glob by a hash. Example:
60
61
61 [reposubs]
62 [reposubs]
62 */widgets#branch(release) = qa-team@example.com
63 */widgets#branch(release) = qa-team@example.com
63
64
64 This sends to "qa-team@example.com" whenever a changeset on the "release"
65 This sends to "qa-team@example.com" whenever a changeset on the "release"
65 branch triggers a notification in any repository ending in "widgets".
66 branch triggers a notification in any repository ending in "widgets".
66
67
67 In order to place them under direct user management, "[usersubs]" and
68 In order to place them under direct user management, "[usersubs]" and
68 "[reposubs]" sections may be placed in a separate "hgrc" file and incorporated
69 "[reposubs]" sections may be placed in a separate "hgrc" file and incorporated
69 by reference:
70 by reference:
70
71
71 [notify]
72 [notify]
72 config = /path/to/subscriptionsfile
73 config = /path/to/subscriptionsfile
73
74
74 Notifications will not be sent until the "notify.test" value is set to
75 Notifications will not be sent until the "notify.test" value is set to
75 "False"; see below.
76 "False"; see below.
76
77
77 Notifications content can be tweaked with the following configuration entries:
78 Notifications content can be tweaked with the following configuration entries:
78
79
79 notify.test
80 notify.test
80 If "True", print messages to stdout instead of sending them. Default: True.
81 If "True", print messages to stdout instead of sending them. Default: True.
81
82
82 notify.sources
83 notify.sources
83 Space-separated list of change sources. Notifications are activated only
84 Space-separated list of change sources. Notifications are activated only
84 when a changeset's source is in this list. Sources may be:
85 when a changeset's source is in this list. Sources may be:
85
86
86 "serve" changesets received via http or ssh
87 "serve" changesets received via http or ssh
87 "pull" changesets received via "hg pull"
88 "pull" changesets received via "hg pull"
88 "unbundle" changesets received via "hg unbundle"
89 "unbundle" changesets received via "hg unbundle"
89 "push" changesets sent or received via "hg push"
90 "push" changesets sent or received via "hg push"
90 "bundle" changesets sent via "hg unbundle"
91 "bundle" changesets sent via "hg unbundle"
91
92
92 Default: serve.
93 Default: serve.
93
94
94 notify.strip
95 notify.strip
95 Number of leading slashes to strip from url paths. By default, notifications
96 Number of leading slashes to strip from url paths. By default, notifications
96 reference repositories with their absolute path. "notify.strip" lets you
97 reference repositories with their absolute path. "notify.strip" lets you
97 turn them into relative paths. For example, "notify.strip=3" will change
98 turn them into relative paths. For example, "notify.strip=3" will change
98 "/long/path/repository" into "repository". Default: 0.
99 "/long/path/repository" into "repository". Default: 0.
99
100
100 notify.domain
101 notify.domain
101 Default email domain for sender or recipients with no explicit domain.
102 Default email domain for sender or recipients with no explicit domain.
102
103
103 notify.style
104 notify.style
104 Style file to use when formatting emails.
105 Style file to use when formatting emails.
105
106
106 notify.template
107 notify.template
107 Template to use when formatting emails.
108 Template to use when formatting emails.
108
109
109 notify.incoming
110 notify.incoming
110 Template to use when run as an incoming hook, overriding "notify.template".
111 Template to use when run as an incoming hook, overriding "notify.template".
111
112
112 notify.outgoing
113 notify.outgoing
113 Template to use when run as an outgoing hook, overriding "notify.template".
114 Template to use when run as an outgoing hook, overriding "notify.template".
114
115
115 notify.changegroup
116 notify.changegroup
116 Template to use when running as a changegroup hook, overriding
117 Template to use when running as a changegroup hook, overriding
117 "notify.template".
118 "notify.template".
118
119
119 notify.maxdiff
120 notify.maxdiff
120 Maximum number of diff lines to include in notification email. Set to 0 to
121 Maximum number of diff lines to include in notification email. Set to 0 to
121 disable the diff, or -1 to include all of it. Default: 300.
122 disable the diff, or -1 to include all of it. Default: 300.
122
123
123 notify.maxsubject
124 notify.maxsubject
124 Maximum number of characters in email's subject line. Default: 67.
125 Maximum number of characters in email's subject line. Default: 67.
125
126
126 notify.diffstat
127 notify.diffstat
127 Set to True to include a diffstat before diff content. Default: True.
128 Set to True to include a diffstat before diff content. Default: True.
128
129
129 notify.merge
130 notify.merge
130 If True, send notifications for merge changesets. Default: True.
131 If True, send notifications for merge changesets. Default: True.
131
132
132 notify.mbox
133 notify.mbox
133 If set, append mails to this mbox file instead of sending. Default: None.
134 If set, append mails to this mbox file instead of sending. Default: None.
134
135
135 notify.fromauthor
136 notify.fromauthor
136 If set, use the committer of the first changeset in a changegroup for the
137 If set, use the committer of the first changeset in a changegroup for the
137 "From" field of the notification mail. If not set, take the user from the
138 "From" field of the notification mail. If not set, take the user from the
138 pushing repo. Default: False.
139 pushing repo. Default: False.
139
140
140 If set, the following entries will also be used to customize the
141 If set, the following entries will also be used to customize the
141 notifications:
142 notifications:
142
143
143 email.from
144 email.from
144 Email "From" address to use if none can be found in the generated email
145 Email "From" address to use if none can be found in the generated email
145 content.
146 content.
146
147
147 web.baseurl
148 web.baseurl
148 Root repository URL to combine with repository paths when making references.
149 Root repository URL to combine with repository paths when making references.
149 See also "notify.strip".
150 See also "notify.strip".
150
151
151 no commands defined
152 no commands defined
152 $ hg init a
153 $ hg init a
153 $ echo a > a/a
154 $ echo a > a/a
154
155
155 commit
156 commit
156
157
157 $ hg --cwd a commit -Ama -d '0 0'
158 $ hg --cwd a commit -Ama -d '0 0'
158 adding a
159 adding a
159
160
160
161
161 clone
162 clone
162
163
163 $ hg --traceback clone a b
164 $ hg --traceback clone a b
164 updating to branch default
165 updating to branch default
165 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
166 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
166 $ echo a >> a/a
167 $ echo a >> a/a
167
168
168 commit
169 commit
169
170
170 $ hg --traceback --cwd a commit -Amb -d '1 0'
171 $ hg --traceback --cwd a commit -Amb -d '1 0'
171
172
172 on Mac OS X 10.5 the tmp path is very long so would get stripped in the subject line
173 on Mac OS X 10.5 the tmp path is very long so would get stripped in the subject line
173
174
174 $ cat <<EOF >> $HGRCPATH
175 $ cat <<EOF >> $HGRCPATH
175 > [notify]
176 > [notify]
176 > maxsubject = 200
177 > maxsubject = 200
177 > EOF
178 > EOF
178
179
179 the python call below wraps continuation lines, which appear on Mac OS X 10.5 because
180 the python call below wraps continuation lines, which appear on Mac OS X 10.5 because
180 of the very long subject line
181 of the very long subject line
181 pull (minimal config)
182 pull (minimal config)
182
183
183 $ hg --traceback --cwd b pull ../a | $PYTHON $TESTTMP/filter.py
184 $ hg --traceback --cwd b pull ../a | $PYTHON $TESTTMP/filter.py
184 pulling from ../a
185 pulling from ../a
185 searching for changes
186 searching for changes
186 adding changesets
187 adding changesets
187 adding manifests
188 adding manifests
188 adding file changes
189 adding file changes
189 added 1 changesets with 1 changes to 1 files
190 added 1 changesets with 1 changes to 1 files
190 Content-Type: text/plain; charset="us-ascii"
191 Content-Type: text/plain; charset="us-ascii"
191 MIME-Version: 1.0
192 MIME-Version: 1.0
192 Content-Transfer-Encoding: 7bit
193 Content-Transfer-Encoding: 7bit
193 Date: * (glob)
194 Date: * (glob)
194 Subject: changeset in $TESTTMP/b: b
195 Subject: changeset in $TESTTMP/b: b
195 From: test
196 From: test
196 X-Hg-Notification: changeset 0647d048b600
197 X-Hg-Notification: changeset 0647d048b600
197 Message-Id: <*> (glob)
198 Message-Id: <*> (glob)
198 To: baz, foo@bar
199 To: baz, foo@bar
199
200
200 changeset 0647d048b600 in $TESTTMP/b (glob)
201 changeset 0647d048b600 in $TESTTMP/b (glob)
201 details: $TESTTMP/b?cmd=changeset;node=0647d048b600
202 details: $TESTTMP/b?cmd=changeset;node=0647d048b600
202 description: b
203 description: b
203
204
204 diffs (6 lines):
205 diffs (6 lines):
205
206
206 diff -r cb9a9f314b8b -r 0647d048b600 a
207 diff -r cb9a9f314b8b -r 0647d048b600 a
207 --- a/a Thu Jan 01 00:00:00 1970 +0000
208 --- a/a Thu Jan 01 00:00:00 1970 +0000
208 +++ b/a Thu Jan 01 00:00:01 1970 +0000
209 +++ b/a Thu Jan 01 00:00:01 1970 +0000
209 @@ -1,1 +1,2 @@ a
210 @@ -1,1 +1,2 @@ a
210 +a
211 +a
211 (run 'hg update' to get a working copy)
212 (run 'hg update' to get a working copy)
212
213
213 $ cat <<EOF >> $HGRCPATH
214 $ cat <<EOF >> $HGRCPATH
214 > [notify]
215 > [notify]
215 > config = `pwd`/.notify.conf
216 > config = `pwd`/.notify.conf
216 > domain = test.com
217 > domain = test.com
217 > strip = 42
218 > strip = 42
218 > template = Subject: {desc|firstline|strip}\nFrom: {author}\nX-Test: foo\n\nchangeset {node|short} in {webroot}\ndescription:\n\t{desc|tabindent|strip}
219 > template = Subject: {desc|firstline|strip}\nFrom: {author}\nX-Test: foo\n\nchangeset {node|short} in {webroot}\ndescription:\n\t{desc|tabindent|strip}
219 >
220 >
220 > [web]
221 > [web]
221 > baseurl = http://test/
222 > baseurl = http://test/
222 > EOF
223 > EOF
223
224
224 fail for config file is missing
225 fail for config file is missing
225
226
226 $ hg --cwd b rollback
227 $ hg --cwd b rollback
227 repository tip rolled back to revision 0 (undo pull)
228 repository tip rolled back to revision 0 (undo pull)
228 $ hg --cwd b pull ../a 2>&1 | grep 'error.*\.notify\.conf' > /dev/null && echo pull failed
229 $ hg --cwd b pull ../a 2>&1 | grep 'error.*\.notify\.conf' > /dev/null && echo pull failed
229 pull failed
230 pull failed
230 $ touch ".notify.conf"
231 $ touch ".notify.conf"
231
232
232 pull
233 pull
233
234
234 $ hg --cwd b rollback
235 $ hg --cwd b rollback
235 repository tip rolled back to revision 0 (undo pull)
236 repository tip rolled back to revision 0 (undo pull)
236 $ hg --traceback --cwd b pull ../a | $PYTHON $TESTTMP/filter.py
237 $ hg --traceback --cwd b pull ../a | $PYTHON $TESTTMP/filter.py
237 pulling from ../a
238 pulling from ../a
238 searching for changes
239 searching for changes
239 adding changesets
240 adding changesets
240 adding manifests
241 adding manifests
241 adding file changes
242 adding file changes
242 added 1 changesets with 1 changes to 1 files
243 added 1 changesets with 1 changes to 1 files
243 Content-Type: text/plain; charset="us-ascii"
244 Content-Type: text/plain; charset="us-ascii"
244 MIME-Version: 1.0
245 MIME-Version: 1.0
245 Content-Transfer-Encoding: 7bit
246 Content-Transfer-Encoding: 7bit
246 X-Test: foo
247 X-Test: foo
247 Date: * (glob)
248 Date: * (glob)
248 Subject: b
249 Subject: b
249 From: test@test.com
250 From: test@test.com
250 X-Hg-Notification: changeset 0647d048b600
251 X-Hg-Notification: changeset 0647d048b600
251 Message-Id: <*> (glob)
252 Message-Id: <*> (glob)
252 To: baz@test.com, foo@bar
253 To: baz@test.com, foo@bar
253
254
254 changeset 0647d048b600 in b
255 changeset 0647d048b600 in b
255 description: b
256 description: b
256 diffs (6 lines):
257 diffs (6 lines):
257
258
258 diff -r cb9a9f314b8b -r 0647d048b600 a
259 diff -r cb9a9f314b8b -r 0647d048b600 a
259 --- a/a Thu Jan 01 00:00:00 1970 +0000
260 --- a/a Thu Jan 01 00:00:00 1970 +0000
260 +++ b/a Thu Jan 01 00:00:01 1970 +0000
261 +++ b/a Thu Jan 01 00:00:01 1970 +0000
261 @@ -1,1 +1,2 @@ a
262 @@ -1,1 +1,2 @@ a
262 +a
263 +a
263 (run 'hg update' to get a working copy)
264 (run 'hg update' to get a working copy)
264
265
265 $ cat << EOF >> $HGRCPATH
266 $ cat << EOF >> $HGRCPATH
266 > [hooks]
267 > [hooks]
267 > incoming.notify = python:hgext.notify.hook
268 > incoming.notify = python:hgext.notify.hook
268 >
269 >
269 > [notify]
270 > [notify]
270 > sources = pull
271 > sources = pull
271 > diffstat = True
272 > diffstat = True
272 > EOF
273 > EOF
273
274
274 pull
275 pull
275
276
276 $ hg --cwd b rollback
277 $ hg --cwd b rollback
277 repository tip rolled back to revision 0 (undo pull)
278 repository tip rolled back to revision 0 (undo pull)
278 $ hg --traceback --cwd b pull ../a | $PYTHON $TESTTMP/filter.py
279 $ hg --traceback --cwd b pull ../a | $PYTHON $TESTTMP/filter.py
279 pulling from ../a
280 pulling from ../a
280 searching for changes
281 searching for changes
281 adding changesets
282 adding changesets
282 adding manifests
283 adding manifests
283 adding file changes
284 adding file changes
284 added 1 changesets with 1 changes to 1 files
285 added 1 changesets with 1 changes to 1 files
285 Content-Type: text/plain; charset="us-ascii"
286 Content-Type: text/plain; charset="us-ascii"
286 MIME-Version: 1.0
287 MIME-Version: 1.0
287 Content-Transfer-Encoding: 7bit
288 Content-Transfer-Encoding: 7bit
288 X-Test: foo
289 X-Test: foo
289 Date: * (glob)
290 Date: * (glob)
290 Subject: b
291 Subject: b
291 From: test@test.com
292 From: test@test.com
292 X-Hg-Notification: changeset 0647d048b600
293 X-Hg-Notification: changeset 0647d048b600
293 Message-Id: <*> (glob)
294 Message-Id: <*> (glob)
294 To: baz@test.com, foo@bar
295 To: baz@test.com, foo@bar
295
296
296 changeset 0647d048b600 in b
297 changeset 0647d048b600 in b
297 description: b
298 description: b
298 diffstat:
299 diffstat:
299 a | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
300 a | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
300
301
301 diffs (6 lines):
302 diffs (6 lines):
302
303
303 diff -r cb9a9f314b8b -r 0647d048b600 a
304 diff -r cb9a9f314b8b -r 0647d048b600 a
304 --- a/a Thu Jan 01 00:00:00 1970 +0000
305 --- a/a Thu Jan 01 00:00:00 1970 +0000
305 +++ b/a Thu Jan 01 00:00:01 1970 +0000
306 +++ b/a Thu Jan 01 00:00:01 1970 +0000
306 @@ -1,1 +1,2 @@ a
307 @@ -1,1 +1,2 @@ a
307 +a
308 +a
308 (run 'hg update' to get a working copy)
309 (run 'hg update' to get a working copy)
309
310
310 test merge
311 test merge
311
312
312 $ cd a
313 $ cd a
313 $ hg up -C 0
314 $ hg up -C 0
314 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
315 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
315 $ echo a >> a
316 $ echo a >> a
316 $ hg ci -Am adda2 -d '2 0'
317 $ hg ci -Am adda2 -d '2 0'
317 created new head
318 created new head
318 $ hg merge
319 $ hg merge
319 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
320 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
320 (branch merge, don't forget to commit)
321 (branch merge, don't forget to commit)
321 $ hg ci -m merge -d '3 0'
322 $ hg ci -m merge -d '3 0'
322 $ cd ..
323 $ cd ..
323 $ hg --traceback --cwd b pull ../a | $PYTHON $TESTTMP/filter.py
324 $ hg --traceback --cwd b pull ../a | $PYTHON $TESTTMP/filter.py
324 pulling from ../a
325 pulling from ../a
325 searching for changes
326 searching for changes
326 adding changesets
327 adding changesets
327 adding manifests
328 adding manifests
328 adding file changes
329 adding file changes
329 added 2 changesets with 0 changes to 0 files
330 added 2 changesets with 0 changes to 0 files
330 Content-Type: text/plain; charset="us-ascii"
331 Content-Type: text/plain; charset="us-ascii"
331 MIME-Version: 1.0
332 MIME-Version: 1.0
332 Content-Transfer-Encoding: 7bit
333 Content-Transfer-Encoding: 7bit
333 X-Test: foo
334 X-Test: foo
334 Date: * (glob)
335 Date: * (glob)
335 Subject: adda2
336 Subject: adda2
336 From: test@test.com
337 From: test@test.com
337 X-Hg-Notification: changeset 0a184ce6067f
338 X-Hg-Notification: changeset 0a184ce6067f
338 Message-Id: <*> (glob)
339 Message-Id: <*> (glob)
339 To: baz@test.com, foo@bar
340 To: baz@test.com, foo@bar
340
341
341 changeset 0a184ce6067f in b
342 changeset 0a184ce6067f in b
342 description: adda2
343 description: adda2
343 diffstat:
344 diffstat:
344 a | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
345 a | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
345
346
346 diffs (6 lines):
347 diffs (6 lines):
347
348
348 diff -r cb9a9f314b8b -r 0a184ce6067f a
349 diff -r cb9a9f314b8b -r 0a184ce6067f a
349 --- a/a Thu Jan 01 00:00:00 1970 +0000
350 --- a/a Thu Jan 01 00:00:00 1970 +0000
350 +++ b/a Thu Jan 01 00:00:02 1970 +0000
351 +++ b/a Thu Jan 01 00:00:02 1970 +0000
351 @@ -1,1 +1,2 @@ a
352 @@ -1,1 +1,2 @@ a
352 +a
353 +a
353 Content-Type: text/plain; charset="us-ascii"
354 Content-Type: text/plain; charset="us-ascii"
354 MIME-Version: 1.0
355 MIME-Version: 1.0
355 Content-Transfer-Encoding: 7bit
356 Content-Transfer-Encoding: 7bit
356 X-Test: foo
357 X-Test: foo
357 Date: * (glob)
358 Date: * (glob)
358 Subject: merge
359 Subject: merge
359 From: test@test.com
360 From: test@test.com
360 X-Hg-Notification: changeset 6a0cf76b2701
361 X-Hg-Notification: changeset 6a0cf76b2701
361 Message-Id: <*> (glob)
362 Message-Id: <*> (glob)
362 To: baz@test.com, foo@bar
363 To: baz@test.com, foo@bar
363
364
364 changeset 6a0cf76b2701 in b
365 changeset 6a0cf76b2701 in b
365 description: merge
366 description: merge
366 (run 'hg update' to get a working copy)
367 (run 'hg update' to get a working copy)
367
368
368 non-ascii content and truncation of multi-byte subject
369 non-ascii content and truncation of multi-byte subject
369
370
370 $ cat <<EOF >> $HGRCPATH
371 $ cat <<EOF >> $HGRCPATH
371 > [notify]
372 > [notify]
372 > maxsubject = 4
373 > maxsubject = 4
373 > EOF
374 > EOF
374 $ echo a >> a/a
375 $ echo a >> a/a
375 $ hg --cwd a --encoding utf-8 commit -A -d '0 0' \
376 $ hg --cwd a --encoding utf-8 commit -A -d '0 0' \
376 > -m `$PYTHON -c 'print "\xc3\xa0\xc3\xa1\xc3\xa2\xc3\xa3\xc3\xa4"'`
377 > -m `$PYTHON -c 'print "\xc3\xa0\xc3\xa1\xc3\xa2\xc3\xa3\xc3\xa4"'`
377 $ hg --traceback --cwd b --encoding utf-8 pull ../a | \
378 $ hg --traceback --cwd b --encoding utf-8 pull ../a | \
378 > $PYTHON $TESTTMP/filter.py
379 > $PYTHON $TESTTMP/filter.py
379 pulling from ../a
380 pulling from ../a
380 searching for changes
381 searching for changes
381 adding changesets
382 adding changesets
382 adding manifests
383 adding manifests
383 adding file changes
384 adding file changes
384 added 1 changesets with 1 changes to 1 files
385 added 1 changesets with 1 changes to 1 files
385 Content-Type: text/plain; charset="us-ascii"
386 Content-Type: text/plain; charset="us-ascii"
386 MIME-Version: 1.0
387 MIME-Version: 1.0
387 Content-Transfer-Encoding: 8bit
388 Content-Transfer-Encoding: 8bit
388 X-Test: foo
389 X-Test: foo
389 Date: * (glob)
390 Date: * (glob)
390 Subject: \xc3\xa0... (esc)
391 Subject: \xc3\xa0... (esc)
391 From: test@test.com
392 From: test@test.com
392 X-Hg-Notification: changeset 7ea05ad269dc
393 X-Hg-Notification: changeset 7ea05ad269dc
393 Message-Id: <*> (glob)
394 Message-Id: <*> (glob)
394 To: baz@test.com, foo@bar
395 To: baz@test.com, foo@bar
395
396
396 changeset 7ea05ad269dc in b
397 changeset 7ea05ad269dc in b
397 description: \xc3\xa0\xc3\xa1\xc3\xa2\xc3\xa3\xc3\xa4 (esc)
398 description: \xc3\xa0\xc3\xa1\xc3\xa2\xc3\xa3\xc3\xa4 (esc)
398 diffstat:
399 diffstat:
399 a | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
400 a | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
400
401
401 diffs (7 lines):
402 diffs (7 lines):
402
403
403 diff -r 6a0cf76b2701 -r 7ea05ad269dc a
404 diff -r 6a0cf76b2701 -r 7ea05ad269dc a
404 --- a/a Thu Jan 01 00:00:03 1970 +0000
405 --- a/a Thu Jan 01 00:00:03 1970 +0000
405 +++ b/a Thu Jan 01 00:00:00 1970 +0000
406 +++ b/a Thu Jan 01 00:00:00 1970 +0000
406 @@ -1,2 +1,3 @@ a a
407 @@ -1,2 +1,3 @@ a a
407 +a
408 +a
408 (run 'hg update' to get a working copy)
409 (run 'hg update' to get a working copy)
409
410
410 long lines
411 long lines
411
412
412 $ cat <<EOF >> $HGRCPATH
413 $ cat <<EOF >> $HGRCPATH
413 > [notify]
414 > [notify]
414 > maxsubject = 67
415 > maxsubject = 67
415 > test = False
416 > test = False
416 > mbox = mbox
417 > mbox = mbox
417 > EOF
418 > EOF
418 $ $PYTHON -c 'file("a/a", "ab").write("no" * 500 + "\n")'
419 $ $PYTHON -c 'file("a/a", "ab").write("no" * 500 + "\n")'
419 $ hg --cwd a commit -A -m "long line"
420 $ hg --cwd a commit -A -m "long line"
420 $ hg --traceback --cwd b pull ../a
421 $ hg --traceback --cwd b pull ../a
421 pulling from ../a
422 pulling from ../a
422 searching for changes
423 searching for changes
423 adding changesets
424 adding changesets
424 adding manifests
425 adding manifests
425 adding file changes
426 adding file changes
426 added 1 changesets with 1 changes to 1 files
427 added 1 changesets with 1 changes to 1 files
427 notify: sending 2 subscribers 1 changes
428 notify: sending 2 subscribers 1 changes
428 (run 'hg update' to get a working copy)
429 (run 'hg update' to get a working copy)
429 $ $PYTHON $TESTTMP/filter.py < b/mbox
430 $ $PYTHON $TESTTMP/filter.py < b/mbox
430 From test@test.com ... ... .. ..:..:.. .... (re)
431 From test@test.com ... ... .. ..:..:.. .... (re)
431 Content-Type: text/plain; charset="us-ascii"
432 Content-Type: text/plain; charset="us-ascii"
432 MIME-Version: 1.0
433 MIME-Version: 1.0
433 Content-Transfer-Encoding: quoted-printable
434 Content-Transfer-Encoding: quoted-printable
434 X-Test: foo
435 X-Test: foo
435 Date: * (glob)
436 Date: * (glob)
436 Subject: long line
437 Subject: long line
437 From: test@test.com
438 From: test@test.com
438 X-Hg-Notification: changeset e0be44cf638b
439 X-Hg-Notification: changeset e0be44cf638b
439 Message-Id: <hg.e0be44cf638b.*.*@*> (glob)
440 Message-Id: <hg.e0be44cf638b.*.*@*> (glob)
440 To: baz@test.com, foo@bar
441 To: baz@test.com, foo@bar
441
442
442 changeset e0be44cf638b in b
443 changeset e0be44cf638b in b
443 description: long line
444 description: long line
444 diffstat:
445 diffstat:
445 a | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
446 a | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
446
447
447 diffs (8 lines):
448 diffs (8 lines):
448
449
449 diff -r 7ea05ad269dc -r e0be44cf638b a
450 diff -r 7ea05ad269dc -r e0be44cf638b a
450 --- a/a Thu Jan 01 00:00:00 1970 +0000
451 --- a/a Thu Jan 01 00:00:00 1970 +0000
451 +++ b/a Thu Jan 01 00:00:00 1970 +0000
452 +++ b/a Thu Jan 01 00:00:00 1970 +0000
452 @@ -1,3 +1,4 @@ a a a
453 @@ -1,3 +1,4 @@ a a a
453 +nonononononononononononononononononononononononononononononononononononono=
454 +nonononononononononononononononononononononononononononononononononononono=
454 nononononononononononononononononononononononononononononononononononononon=
455 nononononononononononononononononononononononononononononononononononononon=
455 ononononononononononononononononononononononononononononononononononononono=
456 ononononononononononononononononononononononononononononononononononononono=
456 nononononononononononononononononononononononononononononononononononononon=
457 nononononononononononononononononononononononononononononononononononononon=
457 ononononononononononononononononononononononononononononononononononononono=
458 ononononononononononononononononononononononononononononononononononononono=
458 nononononononononononononononononononononononononononononononononononononon=
459 nononononononononononononononononononononononononononononononononononononon=
459 ononononononononononononononononononononononononononononononononononononono=
460 ononononononononononononononononononononononononononononononononononononono=
460 nononononononononononononononononononononononononononononononononononononon=
461 nononononononononononononononononononononononononononononononononononononon=
461 ononononononononononononononononononononononononononononononononononononono=
462 ononononononononononononononononononononononononononononononononononononono=
462 nononononononononononononononononononononononononononononononononononononon=
463 nononononononononononononononononononononononononononononononononononononon=
463 ononononononononononononononononononononononononononononononononononononono=
464 ononononononononononononononononononononononononononononononononononononono=
464 nononononononononononononononononononononononononononononononononononononon=
465 nononononononononononononononononononononononononononononononononononononon=
465 ononononononononononononononononononononononononononononononononononononono=
466 ononononononononononononononononononononononononononononononononononononono=
466 nonononononononononononono
467 nonononononononononononono
467
468
468 revset selection: send to address that matches branch and repo
469 revset selection: send to address that matches branch and repo
469
470
470 $ cat << EOF >> $HGRCPATH
471 $ cat << EOF >> $HGRCPATH
471 > [hooks]
472 > [hooks]
472 > incoming.notify = python:hgext.notify.hook
473 > incoming.notify = python:hgext.notify.hook
473 >
474 >
474 > [notify]
475 > [notify]
475 > sources = pull
476 > sources = pull
476 > test = True
477 > test = True
477 > diffstat = False
478 > diffstat = False
478 > maxdiff = 0
479 > maxdiff = 0
479 >
480 >
480 > [reposubs]
481 > [reposubs]
481 > */a#branch(test) = will_no_be_send@example.com
482 > */a#branch(test) = will_no_be_send@example.com
482 > */b#branch(test) = notify@example.com
483 > */b#branch(test) = notify@example.com
483 > EOF
484 > EOF
484 $ hg --cwd a branch test
485 $ hg --cwd a branch test
485 marked working directory as branch test
486 marked working directory as branch test
486 (branches are permanent and global, did you want a bookmark?)
487 (branches are permanent and global, did you want a bookmark?)
487 $ echo a >> a/a
488 $ echo a >> a/a
488 $ hg --cwd a ci -m test -d '1 0'
489 $ hg --cwd a ci -m test -d '1 0'
489 $ hg --traceback --cwd b pull ../a | $PYTHON $TESTTMP/filter.py
490 $ hg --traceback --cwd b pull ../a | $PYTHON $TESTTMP/filter.py
490 pulling from ../a
491 pulling from ../a
491 searching for changes
492 searching for changes
492 adding changesets
493 adding changesets
493 adding manifests
494 adding manifests
494 adding file changes
495 adding file changes
495 added 1 changesets with 1 changes to 1 files
496 added 1 changesets with 1 changes to 1 files
496 Content-Type: text/plain; charset="us-ascii"
497 Content-Type: text/plain; charset="us-ascii"
497 MIME-Version: 1.0
498 MIME-Version: 1.0
498 Content-Transfer-Encoding: 7bit
499 Content-Transfer-Encoding: 7bit
499 X-Test: foo
500 X-Test: foo
500 Date: * (glob)
501 Date: * (glob)
501 Subject: test
502 Subject: test
502 From: test@test.com
503 From: test@test.com
503 X-Hg-Notification: changeset fbbcbc516f2f
504 X-Hg-Notification: changeset fbbcbc516f2f
504 Message-Id: <hg.fbbcbc516f2f.*.*@*> (glob)
505 Message-Id: <hg.fbbcbc516f2f.*.*@*> (glob)
505 To: baz@test.com, foo@bar, notify@example.com
506 To: baz@test.com, foo@bar, notify@example.com
506
507
507 changeset fbbcbc516f2f in b
508 changeset fbbcbc516f2f in b
508 description: test
509 description: test
509 (run 'hg update' to get a working copy)
510 (run 'hg update' to get a working copy)
510
511
511 revset selection: don't send to address that waits for mails
512 revset selection: don't send to address that waits for mails
512 from different branch
513 from different branch
513
514
514 $ hg --cwd a update default
515 $ hg --cwd a update default
515 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
516 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
516 $ echo a >> a/a
517 $ echo a >> a/a
517 $ hg --cwd a ci -m test -d '1 0'
518 $ hg --cwd a ci -m test -d '1 0'
518 $ hg --traceback --cwd b pull ../a | $PYTHON $TESTTMP/filter.py
519 $ hg --traceback --cwd b pull ../a | $PYTHON $TESTTMP/filter.py
519 pulling from ../a
520 pulling from ../a
520 searching for changes
521 searching for changes
521 adding changesets
522 adding changesets
522 adding manifests
523 adding manifests
523 adding file changes
524 adding file changes
524 added 1 changesets with 0 changes to 0 files (+1 heads)
525 added 1 changesets with 0 changes to 0 files (+1 heads)
525 Content-Type: text/plain; charset="us-ascii"
526 Content-Type: text/plain; charset="us-ascii"
526 MIME-Version: 1.0
527 MIME-Version: 1.0
527 Content-Transfer-Encoding: 7bit
528 Content-Transfer-Encoding: 7bit
528 X-Test: foo
529 X-Test: foo
529 Date: * (glob)
530 Date: * (glob)
530 Subject: test
531 Subject: test
531 From: test@test.com
532 From: test@test.com
532 X-Hg-Notification: changeset 38b42fa092de
533 X-Hg-Notification: changeset 38b42fa092de
533 Message-Id: <hg.38b42fa092de.*.*@*> (glob)
534 Message-Id: <hg.38b42fa092de.*.*@*> (glob)
534 To: baz@test.com, foo@bar
535 To: baz@test.com, foo@bar
535
536
536 changeset 38b42fa092de in b
537 changeset 38b42fa092de in b
537 description: test
538 description: test
538 (run 'hg heads' to see heads)
539 (run 'hg heads' to see heads)
539
540
540 default template:
541 default template:
541
542
542 $ grep -v '^template =' $HGRCPATH > "$HGRCPATH.new"
543 $ grep -v '^template =' $HGRCPATH > "$HGRCPATH.new"
543 $ mv "$HGRCPATH.new" $HGRCPATH
544 $ mv "$HGRCPATH.new" $HGRCPATH
544 $ echo a >> a/a
545 $ echo a >> a/a
545 $ hg --cwd a commit -m 'default template'
546 $ hg --cwd a commit -m 'default template'
546 $ hg --cwd b pull ../a -q | $PYTHON $TESTTMP/filter.py
547 $ hg --cwd b pull ../a -q | $PYTHON $TESTTMP/filter.py
547 Content-Type: text/plain; charset="us-ascii"
548 Content-Type: text/plain; charset="us-ascii"
548 MIME-Version: 1.0
549 MIME-Version: 1.0
549 Content-Transfer-Encoding: 7bit
550 Content-Transfer-Encoding: 7bit
550 Date: * (glob)
551 Date: * (glob)
551 Subject: changeset in b: default template
552 Subject: changeset in b: default template
552 From: test@test.com
553 From: test@test.com
553 X-Hg-Notification: changeset 3548c9e294b6
554 X-Hg-Notification: changeset 3548c9e294b6
554 Message-Id: <hg.3548c9e294b6.*.*@*> (glob)
555 Message-Id: <hg.3548c9e294b6.*.*@*> (glob)
555 To: baz@test.com, foo@bar
556 To: baz@test.com, foo@bar
556
557
557 changeset 3548c9e294b6 in $TESTTMP/b (glob)
558 changeset 3548c9e294b6 in $TESTTMP/b (glob)
558 details: http://test/b?cmd=changeset;node=3548c9e294b6
559 details: http://test/b?cmd=changeset;node=3548c9e294b6
559 description: default template
560 description: default template
560
561
561 with style:
562 with style:
562
563
563 $ cat <<EOF > notifystyle.map
564 $ cat <<EOF > notifystyle.map
564 > changeset = "Subject: {desc|firstline|strip}
565 > changeset = "Subject: {desc|firstline|strip}
565 > From: {author}
566 > From: {author}
566 > {""}
567 > {""}
567 > changeset {node|short}"
568 > changeset {node|short}"
568 > EOF
569 > EOF
569 $ cat <<EOF >> $HGRCPATH
570 $ cat <<EOF >> $HGRCPATH
570 > [notify]
571 > [notify]
571 > style = $TESTTMP/notifystyle.map
572 > style = $TESTTMP/notifystyle.map
572 > EOF
573 > EOF
573 $ echo a >> a/a
574 $ echo a >> a/a
574 $ hg --cwd a commit -m 'with style'
575 $ hg --cwd a commit -m 'with style'
575 $ hg --cwd b pull ../a -q | $PYTHON $TESTTMP/filter.py
576 $ hg --cwd b pull ../a -q | $PYTHON $TESTTMP/filter.py
576 Content-Type: text/plain; charset="us-ascii"
577 Content-Type: text/plain; charset="us-ascii"
577 MIME-Version: 1.0
578 MIME-Version: 1.0
578 Content-Transfer-Encoding: 7bit
579 Content-Transfer-Encoding: 7bit
579 Date: * (glob)
580 Date: * (glob)
580 Subject: with style
581 Subject: with style
581 From: test@test.com
582 From: test@test.com
582 X-Hg-Notification: changeset e917dbd961d3
583 X-Hg-Notification: changeset e917dbd961d3
583 Message-Id: <hg.e917dbd961d3.*.*@*> (glob)
584 Message-Id: <hg.e917dbd961d3.*.*@*> (glob)
584 To: baz@test.com, foo@bar
585 To: baz@test.com, foo@bar
585
586
586 changeset e917dbd961d3
587 changeset e917dbd961d3
587
588
588 with template (overrides style):
589 with template (overrides style):
589
590
590 $ cat <<EOF >> $HGRCPATH
591 $ cat <<EOF >> $HGRCPATH
591 > template = Subject: {node|short}: {desc|firstline|strip}
592 > template = Subject: {node|short}: {desc|firstline|strip}
592 > From: {author}
593 > From: {author}
593 > {""}
594 > {""}
594 > {desc}
595 > {desc}
595 > EOF
596 > EOF
596 $ echo a >> a/a
597 $ echo a >> a/a
597 $ hg --cwd a commit -m 'with template'
598 $ hg --cwd a commit -m 'with template'
598 $ hg --cwd b pull ../a -q | $PYTHON $TESTTMP/filter.py
599 $ hg --cwd b pull ../a -q | $PYTHON $TESTTMP/filter.py
599 Content-Type: text/plain; charset="us-ascii"
600 Content-Type: text/plain; charset="us-ascii"
600 MIME-Version: 1.0
601 MIME-Version: 1.0
601 Content-Transfer-Encoding: 7bit
602 Content-Transfer-Encoding: 7bit
602 Date: * (glob)
603 Date: * (glob)
603 Subject: a09743fd3edd: with template
604 Subject: a09743fd3edd: with template
604 From: test@test.com
605 From: test@test.com
605 X-Hg-Notification: changeset a09743fd3edd
606 X-Hg-Notification: changeset a09743fd3edd
606 Message-Id: <hg.a09743fd3edd.*.*@*> (glob)
607 Message-Id: <hg.a09743fd3edd.*.*@*> (glob)
607 To: baz@test.com, foo@bar
608 To: baz@test.com, foo@bar
608
609
609 with template
610 with template
General Comments 0
You need to be logged in to leave comments. Login now