D4231: mail: always fall back to iso-8859-1 if us-ascii won't work (BC)
durin42 (Augie Fackler)
phabricator at mercurial-scm.org
Thu Aug 9 23:29:59 EDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGede768cfe83e: mail: always fall back to iso-8859-1 if us-ascii won't work (BC) (authored by durin42, committed by ).
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D4231?vs=10225&id=10263
REVISION DETAIL
https://phab.mercurial-scm.org/D4231
AFFECTED FILES
mercurial/mail.py
tests/test-patchbomb.t
CHANGE DETAILS
diff --git a/tests/test-patchbomb.t b/tests/test-patchbomb.t
--- a/tests/test-patchbomb.t
+++ b/tests/test-patchbomb.t
@@ -454,8 +454,8 @@
displaying [PATCH] utf-8 content ...
MIME-Version: 1.0
- Content-Type: text/plain; charset="us-ascii"
- Content-Transfer-Encoding: 8bit
+ Content-Type: text/plain; charset="iso-8859-1"
+ Content-Transfer-Encoding: quoted-printable
Subject: [PATCH] utf-8 content
X-Mercurial-Node: 909a00e13e9d78b575aeee23dddbada46d5a143f
X-Mercurial-Series-Index: 1
@@ -487,7 +487,7 @@
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/utf Thu Jan 01 00:00:04 1970 +0000
@@ -0,0 +1,1 @@
- +h\xc3\xb6mma! (esc)
+ +h=C3=B6mma!
mime encoded mbox (base64):
@@ -2673,8 +2673,8 @@
displaying [PATCH 2 of 6] utf-8 content ...
MIME-Version: 1.0
- Content-Type: text/plain; charset="us-ascii"
- Content-Transfer-Encoding: 8bit
+ Content-Type: text/plain; charset="iso-8859-1"
+ Content-Transfer-Encoding: quoted-printable
Subject: [PATCH 2 of 6] utf-8 content
X-Mercurial-Node: 909a00e13e9d78b575aeee23dddbada46d5a143f
X-Mercurial-Series-Index: 2
@@ -2707,7 +2707,7 @@
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/utf Thu Jan 01 00:00:04 1970 +0000
@@ -0,0 +1,1 @@
- +h\xc3\xb6mma! (esc)
+ +h=C3=B6mma!
displaying [PATCH 3 of 6] long line ...
MIME-Version: 1.0
@@ -2758,8 +2758,8 @@
displaying [PATCH 4 of 6] isolatin 8-bit encoding ...
MIME-Version: 1.0
- Content-Type: text/plain; charset="us-ascii"
- Content-Transfer-Encoding: 8bit
+ Content-Type: text/plain; charset="iso-8859-1"
+ Content-Transfer-Encoding: quoted-printable
Subject: [PATCH 4 of 6] isolatin 8-bit encoding
X-Mercurial-Node: 240fb913fc1b7ff15ddb9f33e73d82bf5277c720
X-Mercurial-Series-Index: 4
@@ -2785,7 +2785,7 @@
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/isolatin Thu Jan 01 00:00:05 1970 +0000
@@ -0,0 +1,1 @@
- +h\xf6mma! (esc)
+ +h=F6mma!
displaying [PATCH 5 of 6] Added tag zero, zero.foo for changeset 8580ff50825a ...
MIME-Version: 1.0
diff --git a/mercurial/mail.py b/mercurial/mail.py
--- a/mercurial/mail.py
+++ b/mercurial/mail.py
@@ -220,7 +220,7 @@
cs = ['us-ascii', 'utf-8', encoding.encoding, encoding.fallbackencoding]
if display:
- return mimetextqp(s, subtype, 'us-ascii')
+ cs = ['us-ascii']
for charset in cs:
try:
s.decode(pycompat.sysstr(charset))
To: durin42, #hg-reviewers, indygreg
Cc: indygreg, mercurial-devel
More information about the Mercurial-devel
mailing list