Submitter | Yuya Nishihara |
---|---|
Date | Oct. 30, 2019, 1:02 p.m. |
Message ID | <3b53b4da70668d5abd27.1572440543@mimosa> |
Download | mbox | patch |
Permalink | /patch/42616/ |
State | Accepted |
Headers | show |
Comments
Yuya Nishihara a écrit : > # HG changeset patch > # User Yuya Nishihara <yuya@tcha.org> > # Date 1572439788 -32400 > # Wed Oct 30 21:49:48 2019 +0900 > # Branch stable > # Node ID 3b53b4da70668d5abd27993778fe2da0606aca45 > # Parent e7add06518eeebeb236a97ab051bb55e95c591b8 > py3: fix patchbomb to accept non-ASCII header value for email preview Looks good to me, thanks! > Since mail.headencode() is disabled by -n/--test, non-ASCII header value > has to be allowed. > > Spotted by Denis Laxalde. > > diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py > --- a/hgext/patchbomb.py > +++ b/hgext/patchbomb.py > @@ -960,7 +960,10 @@ def email(ui, repo, *revs, **opts): > hdr = pycompat.strurl(hdr) > change = True > if isinstance(val, bytes): > - val = pycompat.strurl(val) > + # header value should be ASCII since it's encoded by > + # mail.headencode(), but -n/--test disables it and raw > + # value of platform encoding is stored. > + val = encoding.strfromlocal(val) > if not change: > # prevent duplicate headers > del m[hdr]
On Wed, Oct 30, 2019 at 10:02:23PM +0900, Yuya Nishihara wrote: > # HG changeset patch > # User Yuya Nishihara <yuya@tcha.org> > # Date 1572439788 -32400 > # Wed Oct 30 21:49:48 2019 +0900 > # Branch stable > # Node ID 3b53b4da70668d5abd27993778fe2da0606aca45 > # Parent e7add06518eeebeb236a97ab051bb55e95c591b8 > py3: fix patchbomb to accept non-ASCII header value for email preview queued for stable, thanks
Patch
diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py --- a/hgext/patchbomb.py +++ b/hgext/patchbomb.py @@ -960,7 +960,10 @@ def email(ui, repo, *revs, **opts): hdr = pycompat.strurl(hdr) change = True if isinstance(val, bytes): - val = pycompat.strurl(val) + # header value should be ASCII since it's encoded by + # mail.headencode(), but -n/--test disables it and raw + # value of platform encoding is stored. + val = encoding.strfromlocal(val) if not change: # prevent duplicate headers del m[hdr]