Mercurial > hg
comparison tests/test-notify.t @ 43331:90ee1f61504e stable
py3: fix generated non-ascii message in test-notify.t
The resulting "Subject:" header contains an encoded word in Python 3 so
we have to add distinct outputs for Python 3 but underlying values are
the same:
>>> from email.header import decode_header
>>> decode_header('=?utf-8?b?w6AuLi4=?=')
[(b'\xc3\xa0...', 'utf-8')]
author | Denis Laxalde <denis.laxalde@logilab.fr> |
---|---|
date | Thu, 24 Oct 2019 17:28:57 +0200 |
parents | 84c15836a2d7 |
children | 4128ffba4431 |
comparison
equal
deleted
inserted
replaced
43330:910827a2cb20 | 43331:90ee1f61504e |
---|---|
417 > [notify] | 417 > [notify] |
418 > maxsubject = 4 | 418 > maxsubject = 4 |
419 > EOF | 419 > EOF |
420 $ echo a >> a/a | 420 $ echo a >> a/a |
421 $ hg --cwd a --encoding utf-8 commit -A -d '0 0' \ | 421 $ hg --cwd a --encoding utf-8 commit -A -d '0 0' \ |
422 > -m `"$PYTHON" -c 'print("\xc3\xa0\xc3\xa1\xc3\xa2\xc3\xa3\xc3\xa4")'` | 422 > -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 | \ | 423 $ hg --traceback --cwd b --encoding utf-8 pull ../a | \ |
424 > "$PYTHON" $TESTTMP/filter.py | 424 > "$PYTHON" $TESTTMP/filter.py |
425 pulling from ../a | 425 pulling from ../a |
426 searching for changes | 426 searching for changes |
427 adding changesets | 427 adding changesets |
432 MIME-Version: 1.0 | 432 MIME-Version: 1.0 |
433 Content-Type: text/plain; charset="us-ascii" | 433 Content-Type: text/plain; charset="us-ascii" |
434 Content-Transfer-Encoding: 8bit | 434 Content-Transfer-Encoding: 8bit |
435 X-Test: foo | 435 X-Test: foo |
436 Date: * (glob) | 436 Date: * (glob) |
437 Subject: \xc3\xa0... (esc) | 437 Subject: \xc3\xa0... (esc) (no-py3 !) |
438 Subject: =?utf-8?b?w6AuLi4=?= (py3 !) | |
438 From: test@test.com | 439 From: test@test.com |
439 X-Hg-Notification: changeset 0f25f9c22b4c | 440 X-Hg-Notification: changeset 0f25f9c22b4c |
440 Message-Id: <*> (glob) | 441 Message-Id: <*> (glob) |
441 To: baz@test.com, foo@bar | 442 To: baz@test.com, foo@bar |
442 | 443 |