[PATCH] Take DST into account
authorSamuel Tardieu <sam@rfc1149.net>
Fri, 19 Aug 2005 23:26:32 -0800
changeset 968 4a9a753e8232
parent 967 1f3710636b45
child 969 1d5b97537561
[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.
mercurial/hg.py
--- 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)