##// 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 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 261 pulling from ../kw.hg
261 262 requesting all changes
262 263 adding changesets
@@ -196,7 +196,9 b' the python call below wraps continuation'
196 196 of the very long subject line
197 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 202 pulling from ../a
201 203 searching for changes
202 204 adding changesets
@@ -211,8 +213,7 b' pull (minimal config)'
211 213 Subject: changeset in $TESTTMP/b: b
212 214 From: test@example.com
213 215 X-Hg-Notification: changeset 00a13f371396
214 Message-Id: <hg.ba3098a36bd4c297288d16788623a841f81f618ea961a0f0fd65de7eb1191b66@example.com> (no-py3 !)
215 Message-Id: <hg.ba3098a36bd4c297288d16788623a841f81f618ea961a0f0fd65de7eb1191b66@example.com> (py3 !)
216 Message-Id: <hg.ba3098a36bd4c297288d16788623a841f81f618ea961a0f0fd65de7eb1191b66@example.com>
216 217 To: baz@example.com, foo@bar
217 218
218 219 changeset 00a13f371396 in $TESTTMP/b
@@ -256,7 +257,9 b' pull'
256 257
257 258 $ hg --cwd b rollback
258 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 263 pulling from ../a
261 264 searching for changes
262 265 adding changesets
@@ -304,7 +307,9 b' pull'
304 307
305 308 $ hg --cwd b rollback
306 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 313 pulling from ../a
309 314 searching for changes
310 315 adding changesets
@@ -355,7 +360,9 b' test merge'
355 360 (branch merge, don't forget to commit)
356 361 $ hg ci -m merge -d '3 0'
357 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 366 pulling from ../a
360 367 searching for changes
361 368 adding changesets
@@ -421,6 +428,7 b' non-ascii content and truncation of mult'
421 428 $ hg --cwd a --encoding utf-8 commit -A -d '0 0' \
422 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 430 $ hg --traceback --cwd b --encoding utf-8 pull ../a | \
431 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
424 432 > "$PYTHON" $TESTTMP/filter.py
425 433 pulling from ../a
426 434 searching for changes
@@ -475,7 +483,7 b' long lines'
475 483 new changesets a846b5f6ebb7
476 484 notify: sending 2 subscribers 1 changes
477 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 487 From test@test.com ... ... .. ..:..:.. .... (re)
480 488 MIME-Version: 1.0
481 489 Content-Type: text/plain; charset="*" (glob)
@@ -535,7 +543,9 b' long lines'
535 543 (branches are permanent and global, did you want a bookmark?)
536 544 $ echo a >> a/a
537 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 549 pulling from ../a
540 550 searching for changes
541 551 adding changesets
@@ -565,7 +575,9 b' from different branch'
565 575 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
566 576 $ echo a >> a/a
567 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 581 pulling from ../a
570 582 searching for changes
571 583 adding changesets
@@ -594,7 +606,9 b' default template:'
594 606 $ mv "$HGRCPATH.new" $HGRCPATH
595 607 $ echo a >> a/a
596 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 612 MIME-Version: 1.0
599 613 Content-Type: text/plain; charset="us-ascii"
600 614 Content-Transfer-Encoding: 7bit
@@ -623,7 +637,9 b' with style:'
623 637 > EOF
624 638 $ echo a >> a/a
625 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 643 MIME-Version: 1.0
628 644 Content-Type: text/plain; charset="us-ascii"
629 645 Content-Transfer-Encoding: 7bit
@@ -646,7 +662,9 b' with template (overrides style):'
646 662 > EOF
647 663 $ echo a >> a/a
648 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 668 MIME-Version: 1.0
651 669 Content-Type: text/plain; charset="us-ascii"
652 670 Content-Transfer-Encoding: 7bit
@@ -677,7 +695,8 b' showfunc diff'
677 695 > EOF
678 696 $ hg commit -Am addfunction
679 697 adding f1
680 $ hg --cwd ../b pull ../a
698 $ hg --cwd ../b pull ../a | \
699 > "$PYTHON" $TESTDIR/unwrap-message-id.py
681 700 pulling from ../a
682 701 searching for changes
683 702 adding changesets
@@ -720,7 +739,8 b' showfunc diff'
720 739 > }
721 740 > EOF
722 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 744 pulling from ../a
725 745 searching for changes
726 746 adding changesets
General Comments 0
You need to be logged in to leave comments. Login now