[PATCH] patchbomb: fix timezone in message date header

Christian Ebert blacktrash at gmx.net
Fri Jan 12 09:39:31 CST 2007


# HG changeset patch
# User Christian Ebert <blacktrash at gmx.net>
# Date 1168616002 -3600
# Node ID 7fff9912cc33b0964b2e8d00f91724643294294e
# Parent  de081fbb27feed82bdaa61a584ca9989b64936c0
patchbomb: fix timezone in message date header

diff -r de081fbb27fe -r 7fff9912cc33 hgext/patchbomb.py
--- a/hgext/patchbomb.py	Fri Jan 12 14:27:59 2007 +0100
+++ b/hgext/patchbomb.py	Fri Jan 12 16:33:22 2007 +0100
@@ -244,7 +244,8 @@ def patchbomb(ui, repo, *revs, **opts):
     parent = None
 
     # Calculate UTC offset
-    if time.daylight: offset = time.altzone
+    lstart_time = time.localtime(start_time)
+    if lstart_time[8] == 1 and time.daylight: offset = time.altzone
     else: offset = time.timezone
     if offset <= 0: sign, offset = '+', -offset
     else: sign = '-'
@@ -260,7 +261,7 @@ def patchbomb(ui, repo, *revs, **opts):
             m['In-Reply-To'] = parent
         else:
             parent = m['Message-Id']
-        m['Date'] = time.strftime("%a, %d %b %Y %H:%M:%S", time.localtime(start_time)) + ' ' + offset
+        m['Date'] = time.strftime("%a, %d %b %Y %H:%M:%S", lstart_time) + ' ' + offset
 
         start_time += 1
         m['From'] = sender


More information about the Mercurial-devel mailing list