Fix timezone check.
According to http://en.wikipedia.org/wiki/List_of_time_zones
timezones go from UTC-12 to UTC+14.
--- 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()