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
+++ b/mercurial/hg.py
@@ -280,7 +280,12 @@ class changelog(revlog):
 
     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)