Mercurial > public > mercurial-scm > hg-stable
diff hgext/patchbomb.py @ 9046:1547126630e9
patchbomb: fix From_ in the message's envelope
Localized date in the From_ prevents MUAs like mutt from parsing mbox files
generated by patchbomb. Using a 24 characters date in asctime format instead.
author | C?dric Duval <cedricduval@free.fr> |
---|---|
date | Sun, 05 Jul 2009 16:42:10 +0200 |
parents | f4f0e902b750 |
children | 8263d98ffb1c |
line wrap: on
line diff
--- a/hgext/patchbomb.py Tue Jul 07 14:20:58 2009 +0200 +++ b/hgext/patchbomb.py Sun Jul 05 16:42:10 2009 +0200 @@ -70,7 +70,7 @@ directly from the commandline. See the [email] and [smtp] sections in hgrc(5) for details.''' -import os, errno, socket, tempfile, cStringIO +import os, errno, socket, tempfile, cStringIO, time import email.MIMEMultipart, email.MIMEBase import email.Utils, email.Encoders, email.Generator from mercurial import cmdutil, commands, hg, mail, patch, util @@ -446,7 +446,7 @@ ui.status(_('Writing '), subj, ' ...\n') fp = open(opts.get('mbox'), 'In-Reply-To' in m and 'ab+' or 'wb+') generator = email.Generator.Generator(fp, mangle_from_=True) - date = util.datestr(start_time, '%a %b %d %H:%M:%S %Y') + date = time.ctime(start_time[0]) fp.write('From %s %s\n' % (sender_addr, date)) generator.flatten(m, 0) fp.write('\n\n')