##// END OF EJS Templates
tests: handle Message-Id email header possible wrapping...
Denis Laxalde -
r43642:4128ffba stable
parent child Browse files
Show More
@@ -0,0 +1,6 b''
1 from __future__ import absolute_import, print_function
2
3 import re
4 import sys
5
6 print(re.sub(r"(?<=Message-Id:) \n ", " ", sys.stdin.read()), end="")
@@ -256,7 +256,8 b' ie. if patch.diff wrapper acts as it sho'
256
256
257 Pull from bundle and trigger notify
257 Pull from bundle and trigger notify
258
258
259 $ hg pull -u ../kw.hg
259 $ hg pull -u ../kw.hg | \
260 > "$PYTHON" $TESTDIR/unwrap-message-id.py
260 pulling from ../kw.hg
261 pulling from ../kw.hg
261 requesting all changes
262 requesting all changes
262 adding changesets
263 adding changesets
@@ -196,7 +196,9 b' the python call below wraps continuation'
196 of the very long subject line
196 of the very long subject line
197 pull (minimal config)
197 pull (minimal config)
198
198
199 $ hg --traceback --cwd b --config notify.domain=example.com --config notify.messageidseed=example pull ../a | "$PYTHON" $TESTTMP/filter.py
199 $ hg --traceback --cwd b --config notify.domain=example.com --config notify.messageidseed=example pull ../a | \
200 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
201 > "$PYTHON" $TESTTMP/filter.py
200 pulling from ../a
202 pulling from ../a
201 searching for changes
203 searching for changes
202 adding changesets
204 adding changesets
@@ -211,8 +213,7 b' pull (minimal config)'
211 Subject: changeset in $TESTTMP/b: b
213 Subject: changeset in $TESTTMP/b: b
212 From: test@example.com
214 From: test@example.com
213 X-Hg-Notification: changeset 00a13f371396
215 X-Hg-Notification: changeset 00a13f371396
214 Message-Id: <hg.ba3098a36bd4c297288d16788623a841f81f618ea961a0f0fd65de7eb1191b66@example.com> (no-py3 !)
216 Message-Id: <hg.ba3098a36bd4c297288d16788623a841f81f618ea961a0f0fd65de7eb1191b66@example.com>
215 Message-Id: <hg.ba3098a36bd4c297288d16788623a841f81f618ea961a0f0fd65de7eb1191b66@example.com> (py3 !)
216 To: baz@example.com, foo@bar
217 To: baz@example.com, foo@bar
217
218
218 changeset 00a13f371396 in $TESTTMP/b
219 changeset 00a13f371396 in $TESTTMP/b
@@ -256,7 +257,9 b' pull'
256
257
257 $ hg --cwd b rollback
258 $ hg --cwd b rollback
258 repository tip rolled back to revision 0 (undo pull)
259 repository tip rolled back to revision 0 (undo pull)
259 $ hg --traceback --cwd b pull ../a | "$PYTHON" $TESTTMP/filter.py
260 $ hg --traceback --cwd b pull ../a | \
261 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
262 > "$PYTHON" $TESTTMP/filter.py
260 pulling from ../a
263 pulling from ../a
261 searching for changes
264 searching for changes
262 adding changesets
265 adding changesets
@@ -304,7 +307,9 b' pull'
304
307
305 $ hg --cwd b rollback
308 $ hg --cwd b rollback
306 repository tip rolled back to revision 0 (undo pull)
309 repository tip rolled back to revision 0 (undo pull)
307 $ hg --traceback --config notify.maxdiffstat=1 --cwd b pull ../a | "$PYTHON" $TESTTMP/filter.py
310 $ hg --traceback --config notify.maxdiffstat=1 --cwd b pull ../a | \
311 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
312 > "$PYTHON" $TESTTMP/filter.py
308 pulling from ../a
313 pulling from ../a
309 searching for changes
314 searching for changes
310 adding changesets
315 adding changesets
@@ -355,7 +360,9 b' test merge'
355 (branch merge, don't forget to commit)
360 (branch merge, don't forget to commit)
356 $ hg ci -m merge -d '3 0'
361 $ hg ci -m merge -d '3 0'
357 $ cd ..
362 $ cd ..
358 $ hg --traceback --cwd b pull ../a | "$PYTHON" $TESTTMP/filter.py
363 $ hg --traceback --cwd b pull ../a | \
364 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
365 > "$PYTHON" $TESTTMP/filter.py
359 pulling from ../a
366 pulling from ../a
360 searching for changes
367 searching for changes
361 adding changesets
368 adding changesets
@@ -421,6 +428,7 b' non-ascii content and truncation of mult'
421 $ hg --cwd a --encoding utf-8 commit -A -d '0 0' \
428 $ hg --cwd a --encoding utf-8 commit -A -d '0 0' \
422 > -m `"$PYTHON" -c 'import sys; getattr(sys.stdout, "buffer", sys.stdout).write(b"\xc3\xa0\xc3\xa1\xc3\xa2\xc3\xa3\xc3\xa4")'`
429 > -m `"$PYTHON" -c 'import sys; getattr(sys.stdout, "buffer", sys.stdout).write(b"\xc3\xa0\xc3\xa1\xc3\xa2\xc3\xa3\xc3\xa4")'`
423 $ hg --traceback --cwd b --encoding utf-8 pull ../a | \
430 $ hg --traceback --cwd b --encoding utf-8 pull ../a | \
431 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
424 > "$PYTHON" $TESTTMP/filter.py
432 > "$PYTHON" $TESTTMP/filter.py
425 pulling from ../a
433 pulling from ../a
426 searching for changes
434 searching for changes
@@ -475,7 +483,7 b' long lines'
475 new changesets a846b5f6ebb7
483 new changesets a846b5f6ebb7
476 notify: sending 2 subscribers 1 changes
484 notify: sending 2 subscribers 1 changes
477 (run 'hg update' to get a working copy)
485 (run 'hg update' to get a working copy)
478 $ "$PYTHON" $TESTTMP/filter.py < b/mbox
486 $ cat b/mbox | "$PYTHON" $TESTDIR/unwrap-message-id.py | "$PYTHON" $TESTTMP/filter.py
479 From test@test.com ... ... .. ..:..:.. .... (re)
487 From test@test.com ... ... .. ..:..:.. .... (re)
480 MIME-Version: 1.0
488 MIME-Version: 1.0
481 Content-Type: text/plain; charset="*" (glob)
489 Content-Type: text/plain; charset="*" (glob)
@@ -535,7 +543,9 b' long lines'
535 (branches are permanent and global, did you want a bookmark?)
543 (branches are permanent and global, did you want a bookmark?)
536 $ echo a >> a/a
544 $ echo a >> a/a
537 $ hg --cwd a ci -m test -d '1 0'
545 $ hg --cwd a ci -m test -d '1 0'
538 $ hg --traceback --cwd b pull ../a | "$PYTHON" $TESTTMP/filter.py
546 $ hg --traceback --cwd b pull ../a | \
547 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
548 > "$PYTHON" $TESTTMP/filter.py
539 pulling from ../a
549 pulling from ../a
540 searching for changes
550 searching for changes
541 adding changesets
551 adding changesets
@@ -565,7 +575,9 b' from different branch'
565 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
575 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
566 $ echo a >> a/a
576 $ echo a >> a/a
567 $ hg --cwd a ci -m test -d '1 0'
577 $ hg --cwd a ci -m test -d '1 0'
568 $ hg --traceback --cwd b pull ../a | "$PYTHON" $TESTTMP/filter.py
578 $ hg --traceback --cwd b pull ../a | \
579 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
580 > "$PYTHON" $TESTTMP/filter.py
569 pulling from ../a
581 pulling from ../a
570 searching for changes
582 searching for changes
571 adding changesets
583 adding changesets
@@ -594,7 +606,9 b' default template:'
594 $ mv "$HGRCPATH.new" $HGRCPATH
606 $ mv "$HGRCPATH.new" $HGRCPATH
595 $ echo a >> a/a
607 $ echo a >> a/a
596 $ hg --cwd a commit -m 'default template'
608 $ hg --cwd a commit -m 'default template'
597 $ hg --cwd b pull ../a -q | "$PYTHON" $TESTTMP/filter.py
609 $ hg --cwd b pull ../a -q | \
610 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
611 > "$PYTHON" $TESTTMP/filter.py
598 MIME-Version: 1.0
612 MIME-Version: 1.0
599 Content-Type: text/plain; charset="us-ascii"
613 Content-Type: text/plain; charset="us-ascii"
600 Content-Transfer-Encoding: 7bit
614 Content-Transfer-Encoding: 7bit
@@ -623,7 +637,9 b' with style:'
623 > EOF
637 > EOF
624 $ echo a >> a/a
638 $ echo a >> a/a
625 $ hg --cwd a commit -m 'with style'
639 $ hg --cwd a commit -m 'with style'
626 $ hg --cwd b pull ../a -q | "$PYTHON" $TESTTMP/filter.py
640 $ hg --cwd b pull ../a -q | \
641 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
642 > "$PYTHON" $TESTTMP/filter.py
627 MIME-Version: 1.0
643 MIME-Version: 1.0
628 Content-Type: text/plain; charset="us-ascii"
644 Content-Type: text/plain; charset="us-ascii"
629 Content-Transfer-Encoding: 7bit
645 Content-Transfer-Encoding: 7bit
@@ -646,7 +662,9 b' with template (overrides style):'
646 > EOF
662 > EOF
647 $ echo a >> a/a
663 $ echo a >> a/a
648 $ hg --cwd a commit -m 'with template'
664 $ hg --cwd a commit -m 'with template'
649 $ hg --cwd b pull ../a -q | "$PYTHON" $TESTTMP/filter.py
665 $ hg --cwd b pull ../a -q | \
666 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
667 > "$PYTHON" $TESTTMP/filter.py
650 MIME-Version: 1.0
668 MIME-Version: 1.0
651 Content-Type: text/plain; charset="us-ascii"
669 Content-Type: text/plain; charset="us-ascii"
652 Content-Transfer-Encoding: 7bit
670 Content-Transfer-Encoding: 7bit
@@ -677,7 +695,8 b' showfunc diff'
677 > EOF
695 > EOF
678 $ hg commit -Am addfunction
696 $ hg commit -Am addfunction
679 adding f1
697 adding f1
680 $ hg --cwd ../b pull ../a
698 $ hg --cwd ../b pull ../a | \
699 > "$PYTHON" $TESTDIR/unwrap-message-id.py
681 pulling from ../a
700 pulling from ../a
682 searching for changes
701 searching for changes
683 adding changesets
702 adding changesets
@@ -720,7 +739,8 b' showfunc diff'
720 > }
739 > }
721 > EOF
740 > EOF
722 $ hg commit -m changefunction
741 $ hg commit -m changefunction
723 $ hg --cwd ../b --config notify.showfunc=True pull ../a
742 $ hg --cwd ../b --config notify.showfunc=True pull ../a | \
743 > "$PYTHON" $TESTDIR/unwrap-message-id.py
724 pulling from ../a
744 pulling from ../a
725 searching for changes
745 searching for changes
726 adding changesets
746 adding changesets
General Comments 0
You need to be logged in to leave comments. Login now