diff mercurial/hg.py @ 968:4a9a753e8232

[PATCH] Take DST into account Right now, mercurial doesn't take daylight saving time into account because it uses time.timezone inconditionally, instead of resorting to time.altzone if daylight saving time is on.
author Samuel Tardieu <sam@rfc1149.net>
date Fri, 19 Aug 2005 23:26:32 -0800
parents 3e11d5038649
children eac9c8efcd9b
line wrap: on
line diff
--- a/mercurial/hg.py	Fri Aug 19 23:23:42 2005 -0800
+++ b/mercurial/hg.py	Fri Aug 19 23:26:32 2005 -0800
@@ -280,7 +280,12 @@
 
     def add(self, manifest, list, desc, transaction, p1=None, p2=None,
                   user=None, date=None):
-        date = date or "%d %d" % (time.time(), time.timezone)
+        if date:
+            date = util.date_parser(date)
+        else:
+            if time.daylight: offset = time.altzone
+            else: offset = time.timezone
+            date = "%d %d" % (time.time(), offset)
         list.sort()
         l = [hex(manifest), user, date] + list + ["", desc]
         text = "\n".join(l)