hgext/patchbomb.py
changeset 39038 2161faf0d24b
parent 39035 cecb05c371f7
child 39104 2e578eced958
equal deleted inserted replaced
39037:ede768cfe83e 39038:2161faf0d24b
   276             elif total > 1:
   276             elif total > 1:
   277                 patchname = cmdutil.makefilename(repo[node], '%b-%n.patch',
   277                 patchname = cmdutil.makefilename(repo[node], '%b-%n.patch',
   278                                                  seqno=idx, total=total)
   278                                                  seqno=idx, total=total)
   279             else:
   279             else:
   280                 patchname = cmdutil.makefilename(repo[node], '%b.patch')
   280                 patchname = cmdutil.makefilename(repo[node], '%b.patch')
   281         disposition = 'inline'
   281         disposition = r'inline'
   282         if opts.get('attach'):
   282         if opts.get('attach'):
   283             disposition = 'attachment'
   283             disposition = r'attachment'
   284         p['Content-Disposition'] = disposition + '; filename=' + patchname
   284         p[r'Content-Disposition'] = (
       
   285             disposition + r'; filename=' + encoding.strfromlocal(patchname))
   285         msg.attach(p)
   286         msg.attach(p)
   286     else:
   287     else:
   287         msg = mail.mimetextpatch(body, display=opts.get('test'))
   288         msg = mail.mimetextpatch(body, display=opts.get('test'))
   288 
   289 
   289     prefix = _formatprefix(ui, repo, rev, opts.get('flag'), idx, total,
   290     prefix = _formatprefix(ui, repo, rev, opts.get('flag'), idx, total,