changeset 39075:2161faf0d24b

patchbomb: use native strings when determining attachment disposition Differential Revision: https://phab.mercurial-scm.org/D4232
author Augie Fackler <augie@google.com>
date Thu, 09 Aug 2018 21:57:46 -0400
parents ede768cfe83e
children 952bf3c948f0
files hgext/patchbomb.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/patchbomb.py	Thu Aug 09 21:04:15 2018 -0400
+++ b/hgext/patchbomb.py	Thu Aug 09 21:57:46 2018 -0400
@@ -278,10 +278,11 @@
                                                  seqno=idx, total=total)
             else:
                 patchname = cmdutil.makefilename(repo[node], '%b.patch')
-        disposition = 'inline'
+        disposition = r'inline'
         if opts.get('attach'):
-            disposition = 'attachment'
-        p['Content-Disposition'] = disposition + '; filename=' + patchname
+            disposition = r'attachment'
+        p[r'Content-Disposition'] = (
+            disposition + r'; filename=' + encoding.strfromlocal(patchname))
         msg.attach(p)
     else:
         msg = mail.mimetextpatch(body, display=opts.get('test'))