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