comparison hgext/patchbomb.py @ 2443:bd9c39e8f38b

patchbomb does not handle email time stamp plattform independent
author Volker Kleinfeld <Volker.Kleinfeld@gmx.de>
date Fri, 16 Jun 2006 07:07:11 -0700
parents 903ab41ac7eb
children f1de91be1d87 99e7cf6bd2f7
comparison
equal deleted inserted replaced
2442:c660691fb45d 2443:bd9c39e8f38b
215 ui.write('\n') 215 ui.write('\n')
216 216
217 if not opts['test'] and not opts['mbox']: 217 if not opts['test'] and not opts['mbox']:
218 mail = ui.sendmail() 218 mail = ui.sendmail()
219 parent = None 219 parent = None
220 tz = time.strftime('%z') 220
221 # Calculate UTC offset
222 if time.daylight: offset = time.altzone
223 else: offset = time.timezone
224 if offset <= 0: sign, offset = '+', -offset
225 else: sign = '-'
226 offset = '%s%02d%02d' % (sign, offset / 3600, (offset % 3600) / 60)
227
221 sender_addr = email.Utils.parseaddr(sender)[1] 228 sender_addr = email.Utils.parseaddr(sender)[1]
222 for m in msgs: 229 for m in msgs:
223 try: 230 try:
224 m['Message-Id'] = genmsgid(m['X-Mercurial-Node']) 231 m['Message-Id'] = genmsgid(m['X-Mercurial-Node'])
225 except TypeError: 232 except TypeError:
226 m['Message-Id'] = genmsgid('patchbomb') 233 m['Message-Id'] = genmsgid('patchbomb')
227 if parent: 234 if parent:
228 m['In-Reply-To'] = parent 235 m['In-Reply-To'] = parent
229 else: 236 else:
230 parent = m['Message-Id'] 237 parent = m['Message-Id']
231 m['Date'] = time.strftime('%a, %e %b %Y %T ', time.localtime(start_time)) + tz 238 m['Date'] = time.strftime("%a, %d %b %Y %H:%M:%S", time.localtime(start_time)) + ' ' + offset
239
232 start_time += 1 240 start_time += 1
233 m['From'] = sender 241 m['From'] = sender
234 m['To'] = ', '.join(to) 242 m['To'] = ', '.join(to)
235 if cc: m['Cc'] = ', '.join(cc) 243 if cc: m['Cc'] = ', '.join(cc)
236 if opts['test']: 244 if opts['test']: