Fix timezone check.
authorAlexis S. L. Carvalho <alexis@cecm.usp.br>
Wed, 26 Apr 2006 22:15:01 -0700
changeset 2137 5fefab118f7e
parent 2136 3335564f2518
child 2138 f5046cab9e2e
Fix timezone check. According to http://en.wikipedia.org/wiki/List_of_time_zones timezones go from UTC-12 to UTC+14.
mercurial/changelog.py
--- a/mercurial/changelog.py	Wed Apr 26 12:06:21 2006 -0700
+++ b/mercurial/changelog.py	Wed Apr 26 22:15:01 2006 -0700
@@ -41,14 +41,15 @@
         if date:
             # validate explicit (probably user-specified) date and
             # time zone offset. values must fit in signed 32 bits for
-            # current 32-bit linux runtimes.
+            # current 32-bit linux runtimes. timezones go from UTC-12
+            # to UTC+14
             try:
                 when, offset = map(int, date.split(' '))
             except ValueError:
                 raise ValueError(_('invalid date: %r') % date)
             if abs(when) > 0x7fffffff:
                 raise ValueError(_('date exceeds 32 bits: %d') % when)
-            if abs(offset) >= 43200:
+            if offset < -50400 or offset > 43200:
                 raise ValueError(_('impossible time zone offset: %d') % offset)
         else:
             date = "%d %d" % util.makedate()