Debian Codegraph @

tests/test-notify.t

raw
1 $ cat > $TESTTMP/filter.py <<EOF
2 > import io
3 > import re
4 > import sys
5 > sys.stdout = io.TextIOWrapper(
6 > sys.stdout.buffer,
7 > sys.stdout.encoding,
8 > sys.stdout.errors,
9 > newline="\n",
10 > line_buffering=sys.stdout.line_buffering,
11 > )
12 > print(re.sub("\n[ \t]", " ", sys.stdin.read()), end="")
13 > EOF
14
15 $ cat <<EOF >> $HGRCPATH
16 > [experimental]
17 > evolution = true
18 >
19 > [extensions]
20 > notify=
21 > strip=
22 >
23 > [phases]
24 > publish=False
25 >
26 > [hooks]
27 > incoming.notify = python:hgext.notify.hook
28 >
29 > [notify]
30 > sources = pull
31 > diffstat = False
32 > reply-to-predecessor = True
33 > messageidseed = notifyseed
34 >
35 > [usersubs]
36 > foo@bar = *
37 >
38 > [reposubs]
39 > * = baz
40 > EOF
41 $ hg help notify
42 notify extension - hooks for sending email push notifications
43
44 This extension implements hooks to send email notifications when changesets
45 are sent from or received by the local repository.
46
47 First, enable the extension as explained in 'hg help extensions', and register
48 the hook you want to run. "incoming" and "changegroup" hooks are run when
49 changesets are received, while "outgoing" hooks are for changesets sent to
50 another repository:
51
52 [hooks]
53 # one email for each incoming changeset
54 incoming.notify = python:hgext.notify.hook
55 # one email for all incoming changesets
56 changegroup.notify = python:hgext.notify.hook
57
58 # one email for all outgoing changesets
59 outgoing.notify = python:hgext.notify.hook
60
61 This registers the hooks. To enable notification, subscribers must be assigned
62 to repositories. The "[usersubs]" section maps multiple repositories to a
63 given recipient. The "[reposubs]" section maps multiple recipients to a single
64 repository:
65
66 [usersubs]
67 # key is subscriber email, value is a comma-separated list of repo patterns
68 user@host = pattern
69
70 [reposubs]
71 # key is repo pattern, value is a comma-separated list of subscriber emails
72 pattern = user@host
73
74 A "pattern" is a "glob" matching the absolute path to a repository, optionally
75 combined with a revset expression. A revset expression, if present, is
76 separated from the glob by a hash. Example:
77
78 [reposubs]
79 */widgets#branch(release) = [email protected]
80
81 This sends to "[email protected]" whenever a changeset on the "release"
82 branch triggers a notification in any repository ending in "widgets".
83
84 In order to place them under direct user management, "[usersubs]" and
85 "[reposubs]" sections may be placed in a separate "hgrc" file and incorporated
86 by reference:
87
88 [notify]
89 config = /path/to/subscriptionsfile
90
91 Notifications will not be sent until the "notify.test" value is set to
92 "False"; see below.
93
94 Notifications content can be tweaked with the following configuration entries:
95
96 notify.test
97 If "True", print messages to stdout instead of sending them. Default: True.
98
99 notify.sources
100 Space-separated list of change sources. Notifications are activated only
101 when a changeset's source is in this list. Sources may be:
102
103 "serve" changesets received via http or ssh
104 "pull" changesets received via "hg pull"
105 "unbundle" changesets received via "hg unbundle"
106 "push" changesets sent or received via "hg push"
107 "bundle" changesets sent via "hg unbundle"
108
109 Default: serve.
110
111 notify.strip
112 Number of leading slashes to strip from url paths. By default, notifications
113 reference repositories with their absolute path. "notify.strip" lets you
114 turn them into relative paths. For example, "notify.strip=3" will change
115 "/long/path/repository" into "repository". Default: 0.
116
117 notify.domain
118 Default email domain for sender or recipients with no explicit domain. It is
119 also used for the domain part of the "Message-Id" when using
120 "notify.messageidseed".
121
122 notify.messageidseed
123 Create deterministic "Message-Id" headers for the mails based on the seed
124 and the revision identifier of the first commit in the changeset.
125
126 notify.style
127 Style file to use when formatting emails.
128
129 notify.template
130 Template to use when formatting emails.
131
132 notify.incoming
133 Template to use when run as an incoming hook, overriding "notify.template".
134
135 notify.outgoing
136 Template to use when run as an outgoing hook, overriding "notify.template".
137
138 notify.changegroup
139 Template to use when running as a changegroup hook, overriding
140 "notify.template".
141
142 notify.maxdiff
143 Maximum number of diff lines to include in notification email. Set to 0 to
144 disable the diff, or -1 to include all of it. Default: 300.
145
146 notify.maxdiffstat
147 Maximum number of diffstat lines to include in notification email. Set to -1
148 to include all of it. Default: -1.
149
150 notify.maxsubject
151 Maximum number of characters in email's subject line. Default: 67.
152
153 notify.diffstat
154 Set to True to include a diffstat before diff content. Default: True.
155
156 notify.showfunc
157 If set, override "diff.showfunc" for the diff content. Default: None.
158
159 notify.merge
160 If True, send notifications for merge changesets. Default: True.
161
162 notify.mbox
163 If set, append mails to this mbox file instead of sending. Default: None.
164
165 notify.fromauthor
166 If set, use the committer of the first changeset in a changegroup for the
167 "From" field of the notification mail. If not set, take the user from the
168 pushing repo. Default: False.
169
170 notify.reply-to-predecessor (EXPERIMENTAL)
171 If set and the changeset has a predecessor in the repository, try to thread
172 the notification mail with the predecessor. This adds the "In-Reply-To"
173 header to the notification mail with a reference to the predecessor with the
174 smallest revision number. Mail threads can still be torn, especially when
175 changesets are folded.
176
177 This option must be used in combination with "notify.messageidseed".
178
179 If set, the following entries will also be used to customize the
180 notifications:
181
182 email.from
183 Email "From" address to use if none can be found in the generated email
184 content.
185
186 web.baseurl
187 Root repository URL to combine with repository paths when making references.
188 See also "notify.strip".
189
190 no commands defined
191 $ hg init a
192 $ echo a > a/a
193 $ echo b > a/b
194
195 commit
196
197 $ hg --cwd a commit -Ama -d '0 0'
198 adding a
199 adding b
200
201 clone
202
203 $ hg --traceback clone a b
204 updating to branch default
205 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
206 $ echo a >> a/a
207 $ echo b >> a/b
208
209 commit
210
211 $ hg --traceback --cwd a commit -Amb -d '1 0'
212
213 on Mac OS X 10.5 the tmp path is very long so would get stripped in the subject line
214
215 $ cat <<EOF >> $HGRCPATH
216 > [notify]
217 > maxsubject = 200
218 > EOF
219
220 the python call below wraps continuation lines, which appear on Mac OS X 10.5 because
221 of the very long subject line
222 pull (minimal config)
223
224 $ hg --traceback --cwd b --config notify.domain=example.com --config notify.messageidseed=example pull ../a | \
225 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
226 > "$PYTHON" $TESTTMP/filter.py
227 pulling from ../a
228 searching for changes
229 adding changesets
230 adding manifests
231 adding file changes
232 added 1 changesets with 2 changes to 2 files
233 new changesets 00a13f371396 (1 drafts)
234 MIME-Version: 1.0
235 Content-Type: text/plain; charset="us-ascii"
236 Content-Transfer-Encoding: 7bit
237 Date: * (glob)
238 Subject: changeset in $TESTTMP/b: b
239 From: [email protected]
240 X-Hg-Notification: changeset 00a13f371396
241 Message-Id: <hg.ba3098a36bd4c297288d16788623a841f81f618ea961a0f0fd65de7eb1191b66@example.com>
242 To: [email protected], foo@bar
243
244 changeset 00a13f371396 in $TESTTMP/b
245 details: $TESTTMP/b?cmd=changeset;node=00a13f371396
246 description: b
247
248 diffs (12 lines):
249
250 diff -r 0cd96de13884 -r 00a13f371396 a
251 --- a/a Thu Jan 01 00:00:00 1970 +0000
252 +++ b/a Thu Jan 01 00:00:01 1970 +0000
253 @@ -1,1 +1,2 @@ a
254 +a
255 diff -r 0cd96de13884 -r 00a13f371396 b
256 --- a/b Thu Jan 01 00:00:00 1970 +0000
257 +++ b/b Thu Jan 01 00:00:01 1970 +0000
258 @@ -1,1 +1,2 @@ b
259 +b
260 (run 'hg update' to get a working copy)
261
262 $ cat <<EOF >> $HGRCPATH
263 > [notify]
264 > config = `pwd`/.notify.conf
265 > domain = test.com
266 > strip = 42
267 > template = Subject: {desc|firstline|strip}\nFrom: {author}\nX-Test: foo\n\nchangeset {node|short} in {webroot}\ndescription:\n\t{desc|tabindent|strip}
268 >
269 > [web]
270 > baseurl = http://test/
271 > EOF
272
273 fail for config file is missing
274
275 $ hg --cwd b rollback
276 repository tip rolled back to revision 0 (undo pull)
277 $ hg --cwd b pull ../a 2>&1 | grep 'error.*\.notify\.conf' > /dev/null && echo pull failed
278 pull failed
279 $ touch ".notify.conf"
280
281 pull
282
283 $ hg --cwd b rollback
284 repository tip rolled back to revision 0 (undo pull)
285 $ hg --traceback --cwd b pull ../a | \
286 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
287 > "$PYTHON" $TESTTMP/filter.py
288 pulling from ../a
289 searching for changes
290 adding changesets
291 adding manifests
292 adding file changes
293 added 1 changesets with 2 changes to 2 files
294 new changesets 00a13f371396 (1 drafts)
295 MIME-Version: 1.0
296 Content-Type: text/plain; charset="us-ascii"
297 Content-Transfer-Encoding: 7bit
298 X-Test: foo
299 Date: * (glob)
300 Subject: b
301 From: [email protected]
302 X-Hg-Notification: changeset 00a13f371396
303 Message-Id: <*> (glob)
304 To: [email protected], foo@bar
305
306 changeset 00a13f371396 in b
307 description: b
308 diffs (12 lines):
309
310 diff -r 0cd96de13884 -r 00a13f371396 a
311 --- a/a Thu Jan 01 00:00:00 1970 +0000
312 +++ b/a Thu Jan 01 00:00:01 1970 +0000
313 @@ -1,1 +1,2 @@ a
314 +a
315 diff -r 0cd96de13884 -r 00a13f371396 b
316 --- a/b Thu Jan 01 00:00:00 1970 +0000
317 +++ b/b Thu Jan 01 00:00:01 1970 +0000
318 @@ -1,1 +1,2 @@ b
319 +b
320 (run 'hg update' to get a working copy)
321
322 $ cat << EOF >> $HGRCPATH
323 > [hooks]
324 > incoming.notify = python:hgext.notify.hook
325 >
326 > [notify]
327 > sources = pull
328 > diffstat = True
329 > EOF
330
331 pull
332
333 $ hg --cwd b rollback
334 repository tip rolled back to revision 0 (undo pull)
335 $ hg --traceback --config notify.maxdiffstat=1 --cwd b pull ../a | \
336 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
337 > "$PYTHON" $TESTTMP/filter.py
338 pulling from ../a
339 searching for changes
340 adding changesets
341 adding manifests
342 adding file changes
343 added 1 changesets with 2 changes to 2 files
344 new changesets 00a13f371396 (1 drafts)
345 MIME-Version: 1.0
346 Content-Type: text/plain; charset="us-ascii"
347 Content-Transfer-Encoding: 7bit
348 X-Test: foo
349 Date: * (glob)
350 Subject: b
351 From: [email protected]
352 X-Hg-Notification: changeset 00a13f371396
353 Message-Id: <*> (glob)
354 To: [email protected], foo@bar
355
356 changeset 00a13f371396 in b
357 description: b
358 diffstat (truncated from 2 to 1 lines):
359 a | 1 + 2 files changed, 2 insertions(+), 0 deletions(-)
360
361 diffs (12 lines):
362
363 diff -r 0cd96de13884 -r 00a13f371396 a
364 --- a/a Thu Jan 01 00:00:00 1970 +0000
365 +++ b/a Thu Jan 01 00:00:01 1970 +0000
366 @@ -1,1 +1,2 @@ a
367 +a
368 diff -r 0cd96de13884 -r 00a13f371396 b
369 --- a/b Thu Jan 01 00:00:00 1970 +0000
370 +++ b/b Thu Jan 01 00:00:01 1970 +0000
371 @@ -1,1 +1,2 @@ b
372 +b
373 (run 'hg update' to get a working copy)
374
375 test merge
376
377 $ cd a
378 $ hg up -C 0
379 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
380 $ echo a >> a
381 $ hg ci -Am adda2 -d '2 0'
382 created new head
383 $ hg merge
384 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
385 (branch merge, don't forget to commit)
386 $ hg ci -m merge -d '3 0'
387 $ cd ..
388 $ hg --traceback --cwd b pull ../a | \
389 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
390 > "$PYTHON" $TESTTMP/filter.py
391 pulling from ../a
392 searching for changes
393 adding changesets
394 adding manifests
395 adding file changes
396 added 2 changesets with 0 changes to 0 files
397 new changesets 3332653e1f3c:fccf66cd0c35 (2 drafts)
398 MIME-Version: 1.0
399 Content-Type: text/plain; charset="us-ascii"
400 Content-Transfer-Encoding: 7bit
401 X-Test: foo
402 Date: * (glob)
403 Subject: adda2
404 From: [email protected]
405 X-Hg-Notification: changeset 3332653e1f3c
406 Message-Id: <*> (glob)
407 To: [email protected], foo@bar
408
409 changeset 3332653e1f3c in b
410 description: adda2
411 diffstat:
412 a | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
413
414 diffs (6 lines):
415
416 diff -r 0cd96de13884 -r 3332653e1f3c a
417 --- a/a Thu Jan 01 00:00:00 1970 +0000
418 +++ b/a Thu Jan 01 00:00:02 1970 +0000
419 @@ -1,1 +1,2 @@ a
420 +a
421 MIME-Version: 1.0
422 Content-Type: text/plain; charset="us-ascii"
423 Content-Transfer-Encoding: 7bit
424 X-Test: foo
425 Date: * (glob)
426 Subject: merge
427 From: [email protected]
428 X-Hg-Notification: changeset fccf66cd0c35
429 Message-Id: <*> (glob)
430 To: [email protected], foo@bar
431
432 changeset fccf66cd0c35 in b
433 description: merge
434 diffstat:
435 b | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
436
437 diffs (6 lines):
438
439 diff -r 3332653e1f3c -r fccf66cd0c35 b
440 --- a/b Thu Jan 01 00:00:02 1970 +0000
441 +++ b/b Thu Jan 01 00:00:03 1970 +0000
442 @@ -1,1 +1,2 @@ b
443 +b
444 (run 'hg update' to get a working copy)
445
446 non-ascii content and truncation of multi-byte subject
447
448 $ cat <<EOF >> $HGRCPATH
449 > [notify]
450 > maxsubject = 4
451 > EOF
452 $ echo a >> a/a
453 $ hg --cwd a --encoding utf-8 commit -A -d '0 0' \
454 > -m `"$PYTHON" -c 'import sys; getattr(sys.stdout, "buffer", sys.stdout).write(b"\xc3\xa0\xc3\xa1\xc3\xa2\xc3\xa3\xc3\xa4")'`
455 $ hg --traceback --cwd b --encoding utf-8 pull ../a | \
456 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
457 > "$PYTHON" $TESTTMP/filter.py
458 pulling from ../a
459 searching for changes
460 adding changesets
461 adding manifests
462 adding file changes
463 added 1 changesets with 1 changes to 1 files
464 new changesets 0f25f9c22b4c (1 drafts)
465 MIME-Version: 1.0
466 Content-Type: text/plain; charset="us-ascii"
467 Content-Transfer-Encoding: 8bit
468 X-Test: foo
469 Date: * (glob)
470 Subject: =?utf-8?b?w6AuLi4=?=
471 From: [email protected]
472 X-Hg-Notification: changeset 0f25f9c22b4c
473 Message-Id: <*> (glob)
474 To: [email protected], foo@bar
475
476 changeset 0f25f9c22b4c in b
477 description: \xc3\xa0\xc3\xa1\xc3\xa2\xc3\xa3\xc3\xa4 (esc)
478 diffstat:
479 a | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
480
481 diffs (7 lines):
482
483 diff -r fccf66cd0c35 -r 0f25f9c22b4c a
484 --- a/a Thu Jan 01 00:00:03 1970 +0000
485 +++ b/a Thu Jan 01 00:00:00 1970 +0000
486 @@ -1,2 +1,3 @@ a a
487 +a
488 (run 'hg update' to get a working copy)
489
490 long lines
491
492 $ cat <<EOF >> $HGRCPATH
493 > [notify]
494 > maxsubject = 67
495 > test = False
496 > mbox = mbox
497 > EOF
498 $ "$PYTHON" -c 'open("a/a", "ab").write(b"no" * 500 + b"\xd1\x84" + b"\n")'
499 $ hg --cwd a commit -A -m "long line"
500 $ hg --traceback --cwd b pull ../a
501 pulling from ../a
502 searching for changes
503 adding changesets
504 adding manifests
505 adding file changes
506 added 1 changesets with 1 changes to 1 files
507 new changesets a846b5f6ebb7 (1 drafts)
508 notify: sending 2 subscribers 1 changes
509 (run 'hg update' to get a working copy)
510 $ cat b/mbox | "$PYTHON" $TESTDIR/unwrap-message-id.py | "$PYTHON" $TESTTMP/filter.py
511 From [email protected] ... ... .. ..:..:.. .... (re)
512 MIME-Version: 1.0
513 Content-Type: text/plain; charset="*" (glob)
514 Content-Transfer-Encoding: quoted-printable
515 X-Test: foo
516 Date: * (glob)
517 Subject: long line
518 From: [email protected]
519 X-Hg-Notification: changeset a846b5f6ebb7
520 Message-Id: <hg.e7dc7658565793ff33c797e72b7d1f3799347b042af3c40df6d17c8d5c3e560a@test.com>
521 To: [email protected], foo@bar
522
523 changeset a846b5f6ebb7 in b
524 description: long line
525 diffstat:
526 a | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
527
528 diffs (8 lines):
529
530 diff -r 0f25f9c22b4c -r a846b5f6ebb7 a
531 --- a/a Thu Jan 01 00:00:00 1970 +0000
532 +++ b/a Thu Jan 01 00:00:00 1970 +0000
533 @@ -1,3 +1,4 @@ a a a
534 +nonononononononononononononononononononononononononononononononononononono=
535 nononononononononononononononononononononononononononononononononononononon=
536 ononononononononononononononononononononononononononononononononononononono=
537 nononononononononononononononononononononononononononononononononononononon=
538 ononononononononononononononononononononononononononononononononononononono=
539 nononononononononononononononononononononononononononononononononononononon=
540 ononononononononononononononononononononononononononononononononononononono=
541 nononononononononononononononononononononononononononononononononononononon=
542 ononononononononononononononononononononononononononononononononononononono=
543 nononononononononononononononononononononononononononononononononononononon=
544 ononononononononononononononononononononononononononononononononononononono=
545 nononononononononononononononononononononononononononononononononononononon=
546 ononononononononononononononononononononononononononononononononononononono=
547 nonononononononononononono=D1=84
548
549 revset selection: send to address that matches branch and repo
550
551 $ cat << EOF >> $HGRCPATH
552 > [hooks]
553 > incoming.notify = python:hgext.notify.hook
554 >
555 > [notify]
556 > sources = pull
557 > test = True
558 > diffstat = False
559 > maxdiff = 0
560 >
561 > [reposubs]
562 > */a#branch(test) = [email protected]
563 > */b#branch(test) = [email protected]
564 > EOF
565 $ hg --cwd a branch test
566 marked working directory as branch test
567 (branches are permanent and global, did you want a bookmark?)
568 $ echo a >> a/a
569 $ hg --cwd a ci -m test -d '1 0'
570 $ echo a >> a/a
571 $ hg --cwd a ci -m test -d '1 0'
572 $ hg --traceback --cwd b pull ../a | \
573 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
574 > "$PYTHON" $TESTTMP/filter.py
575 pulling from ../a
576 searching for changes
577 adding changesets
578 adding manifests
579 adding file changes
580 added 2 changesets with 2 changes to 1 files
581 new changesets f7e5aaed4080:485bf79b9464 (2 drafts)
582 MIME-Version: 1.0
583 Content-Type: text/plain; charset="us-ascii"
584 Content-Transfer-Encoding: 7bit
585 X-Test: foo
586 Date: * (glob)
587 Subject: test
588 From: [email protected]
589 X-Hg-Notification: changeset f7e5aaed4080
590 Message-Id: <hg.12e9ae631e2529e9cfbe7a93be0dd8a401280700640f802a60f20d7be659251d@test.com>
591 To: [email protected], foo@bar, [email protected]
592
593 changeset f7e5aaed4080 in b
594 description: test
595 MIME-Version: 1.0
596 Content-Type: text/plain; charset="us-ascii"
597 Content-Transfer-Encoding: 7bit
598 X-Test: foo
599 Date: * (glob)
600 Subject: test
601 From: [email protected]
602 X-Hg-Notification: changeset 485bf79b9464
603 Message-Id: <hg.15281d60c27d9d5fb70435d33ebc24cb5aa580f2535988dcb9923c26e8bc5c47@test.com>
604 To: [email protected], foo@bar, [email protected]
605
606 changeset 485bf79b9464 in b
607 description: test
608 (run 'hg update' to get a working copy)
609
610 revset selection: don't send to address that waits for mails
611 from different branch
612
613 $ hg --cwd a update default
614 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
615 $ echo a >> a/a
616 $ hg --cwd a ci -m test -d '1 0'
617 $ hg --traceback --cwd b pull ../a | \
618 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
619 > "$PYTHON" $TESTTMP/filter.py
620 pulling from ../a
621 searching for changes
622 adding changesets
623 adding manifests
624 adding file changes
625 added 1 changesets with 0 changes to 0 files (+1 heads)
626 new changesets 645eb6690ecf (1 drafts)
627 MIME-Version: 1.0
628 Content-Type: text/plain; charset="us-ascii"
629 Content-Transfer-Encoding: 7bit
630 X-Test: foo
631 Date: * (glob)
632 Subject: test
633 From: [email protected]
634 X-Hg-Notification: changeset 645eb6690ecf
635 Message-Id: <hg.ba26b2c63e7deb44e86c934aeea147edde12a11b6ac94bda103dcab5028dc928@test.com>
636 To: [email protected], foo@bar
637
638 changeset 645eb6690ecf in b
639 description: test
640 (run 'hg heads' to see heads)
641
642 default template:
643
644 $ grep -v '^template =' $HGRCPATH > "$HGRCPATH.new"
645 $ mv "$HGRCPATH.new" $HGRCPATH
646 $ echo a >> a/a
647 $ hg --cwd a commit -m 'default template'
648 $ hg --cwd b pull ../a -q | \
649 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
650 > "$PYTHON" $TESTTMP/filter.py
651 MIME-Version: 1.0
652 Content-Type: text/plain; charset="us-ascii"
653 Content-Transfer-Encoding: 7bit
654 Date: * (glob)
655 Subject: changeset in b: default template
656 From: [email protected]
657 X-Hg-Notification: changeset 5cd4346eed47
658 Message-Id: <hg.8caa7941b24fc673d10910cb072e2d167362a3c5111cafefa47190d9b831f0a3@test.com>
659 To: [email protected], foo@bar
660
661 changeset 5cd4346eed47 in $TESTTMP/b
662 details: http://test/b?cmd=changeset;node=5cd4346eed47
663 description: default template
664
665 with style:
666
667 $ cat <<EOF > notifystyle.map
668 > changeset = "Subject: {desc|firstline|strip}
669 > From: {author}
670 > {""}
671 > changeset {node|short}"
672 > EOF
673 $ cat <<EOF >> $HGRCPATH
674 > [notify]
675 > style = $TESTTMP/notifystyle.map
676 > EOF
677 $ echo a >> a/a
678 $ hg --cwd a commit -m 'with style'
679 $ hg --cwd b pull ../a -q | \
680 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
681 > "$PYTHON" $TESTTMP/filter.py
682 MIME-Version: 1.0
683 Content-Type: text/plain; charset="us-ascii"
684 Content-Transfer-Encoding: 7bit
685 Date: * (glob)
686 Subject: with style
687 From: [email protected]
688 X-Hg-Notification: changeset ec8d9d852f56
689 Message-Id: <hg.ccd5049818a6a277251189ce1d6d0cca10723d58214199e7178894adb99ed918@test.com>
690 To: [email protected], foo@bar
691
692 changeset ec8d9d852f56
693
694 with template (overrides style):
695
696 $ cat <<EOF >> $HGRCPATH
697 > template = Subject: {node|short}: {desc|firstline|strip}
698 > From: {author}
699 > {""}
700 > {desc}
701 > EOF
702 $ echo a >> a/a
703 $ hg --cwd a commit -m 'with template'
704 $ hg --cwd b pull ../a -q | \
705 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
706 > "$PYTHON" $TESTTMP/filter.py
707 MIME-Version: 1.0
708 Content-Type: text/plain; charset="us-ascii"
709 Content-Transfer-Encoding: 7bit
710 Date: * (glob)
711 Subject: 14721b538ae3: with template
712 From: [email protected]
713 X-Hg-Notification: changeset 14721b538ae3
714 Message-Id: <hg.7edb9765307a5a24528f3964672e794e2d21f2479e96c099bf52e02abd17b3a2@test.com>
715 To: [email protected], foo@bar
716
717 with template
718
719 showfunc diff
720 $ cat <<EOF >> $HGRCPATH
721 > showfunc = True
722 > template =
723 > maxdiff = -1
724 > EOF
725 $ cd a
726 $ cat > f1 << EOF
727 > int main() {
728 > int a = 0;
729 > int b = 1;
730 > int c = 2;
731 > int d = 3;
732 > return a + b + c + d;
733 > }
734 > EOF
735 $ hg commit -Am addfunction
736 adding f1
737 $ hg debugobsolete eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee b86bc16ff894f057d023b306936f290954857187
738 1 new obsolescence markers
739 $ hg --cwd ../b pull ../a | \
740 > "$PYTHON" $TESTDIR/unwrap-message-id.py
741 pulling from ../a
742 searching for changes
743 adding changesets
744 adding manifests
745 adding file changes
746 added 1 changesets with 1 changes to 1 files
747 1 new obsolescence markers
748 new changesets b86bc16ff894 (1 drafts)
749 MIME-Version: 1.0
750 Content-Type: text/plain; charset="us-ascii"
751 Content-Transfer-Encoding: 7bit
752 Date: * (glob)
753 Subject: addfunction
754 From: [email protected]
755 X-Hg-Notification: changeset b86bc16ff894
756 Message-Id: <hg.4c7cacfbbd6ba170656be0c8fc0d7599bd925c0d545b836816be9983e6d08448@test.com>
757 To: [email protected], foo@bar
758
759 changeset b86bc16ff894
760 diffs (11 lines):
761
762 diff -r 14721b538ae3 -r b86bc16ff894 f1
763 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
764 +++ b/f1 Thu Jan 01 00:00:00 1970 +0000
765 @@ -0,0 +1,7 @@
766 +int main() {
767 + int a = 0;
768 + int b = 1;
769 + int c = 2;
770 + int d = 3;
771 + return a + b + c + d;
772 +}
773 (run 'hg update' to get a working copy)
774 $ cat > f1 << EOF
775 > int main() {
776 > int a = 0;
777 > int b = 1;
778 > int c = 2;
779 > int e = 3;
780 > return a + b + c + e;
781 > }
782 > EOF
783 $ hg commit -m changefunction
784 $ hg debugobsolete 485bf79b9464197b2ed2debd0b16252ad64ed458 e81040e9838c704d8bf17658cb11758f24e40b6b
785 1 new obsolescence markers
786 obsoleted 1 changesets
787 $ hg --cwd ../b --config notify.showfunc=True pull ../a | \
788 > "$PYTHON" $TESTDIR/unwrap-message-id.py
789 pulling from ../a
790 searching for changes
791 adding changesets
792 adding manifests
793 adding file changes
794 added 1 changesets with 1 changes to 1 files
795 1 new obsolescence markers
796 obsoleted 1 changesets
797 new changesets e81040e9838c (1 drafts)
798 MIME-Version: 1.0
799 Content-Type: text/plain; charset="us-ascii"
800 Content-Transfer-Encoding: 7bit
801 Date: * (glob)
802 Subject: changefunction
803 From: [email protected]
804 X-Hg-Notification: changeset e81040e9838c
805 Message-Id: <hg.99b80bf1c5d0bf8f8a7e60107c1aa1da367a5943b2a70a8b36517d701557edff@test.com>
806 In-Reply-To: <hg.15281d60c27d9d5fb70435d33ebc24cb5aa580f2535988dcb9923c26e8bc5c47@test.com>
807 To: [email protected], foo@bar
808
809 changeset e81040e9838c
810 diffs (12 lines):
811
812 diff -r b86bc16ff894 -r e81040e9838c f1
813 --- a/f1 Thu Jan 01 00:00:00 1970 +0000
814 +++ b/f1 Thu Jan 01 00:00:00 1970 +0000
815 @@ -2,6 +2,6 @@ int main() {
816 int a = 0;
817 int b = 1;
818 int c = 2;
819 - int d = 3;
820 - return a + b + c + d;
821 + int e = 3;
822 + return a + b + c + e;
823 }
824 (run 'hg update' to get a working copy)
825
826 Retry the In-Reply-To, but make sure the oldest known change is older.
827 This can happen when folding commits that have been rebased by another user.
828
829 $ hg --cwd ../b strip tip
830 saved backup bundle to $TESTTMP/b/.hg/strip-backup/e81040e9838c-10aad4de-backup.hg
831 $ hg debugobsolete f7e5aaed408029cfe9890318245e87ef44739fdd e81040e9838c704d8bf17658cb11758f24e40b6b
832 1 new obsolescence markers
833 obsoleted 1 changesets
834 $ hg --cwd ../b --config notify.showfunc=True pull ../a | \
835 > "$PYTHON" $TESTDIR/unwrap-message-id.py
836 pulling from ../a
837 searching for changes
838 adding changesets
839 adding manifests
840 adding file changes
841 added 1 changesets with 1 changes to 1 files
842 2 new obsolescence markers
843 obsoleted 2 changesets
844 new changesets e81040e9838c (1 drafts)
845 MIME-Version: 1.0
846 Content-Type: text/plain; charset="us-ascii"
847 Content-Transfer-Encoding: 7bit
848 Date: * (glob)
849 Subject: changefunction
850 From: [email protected]
851 X-Hg-Notification: changeset e81040e9838c
852 Message-Id: <hg.99b80bf1c5d0bf8f8a7e60107c1aa1da367a5943b2a70a8b36517d701557edff@test.com>
853 In-Reply-To: <hg.12e9ae631e2529e9cfbe7a93be0dd8a401280700640f802a60f20d7be659251d@test.com>
854 To: [email protected], foo@bar
855
856 changeset e81040e9838c
857 diffs (12 lines):
858
859 diff -r b86bc16ff894 -r e81040e9838c f1
860 --- a/f1 Thu Jan 01 00:00:00 1970 +0000
861 +++ b/f1 Thu Jan 01 00:00:00 1970 +0000
862 @@ -2,6 +2,6 @@ int main() {
863 int a = 0;
864 int b = 1;
865 int c = 2;
866 - int d = 3;
867 - return a + b + c + d;
868 + int e = 3;
869 + return a + b + c + e;
870 }
871 (run 'hg update' to get a working copy)