Mercurial > hg
changeset 2137:5fefab118f7e
Fix timezone check.
According to http://en.wikipedia.org/wiki/List_of_time_zones
timezones go from UTC-12 to UTC+14.
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Wed, 26 Apr 2006 22:15:01 -0700 |
parents | 3335564f2518 |
children | f5046cab9e2e |
files | mercurial/changelog.py |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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()