# HG changeset patch # User Alexis S. L. Carvalho # Date 1146114901 25200 # Node ID 5fefab118f7ec4b45e2d35d001471f2083ea2c9c # Parent 3335564f2518135acb9e97525e96c8f3417f6a0a Fix timezone check. According to http://en.wikipedia.org/wiki/List_of_time_zones timezones go from UTC-12 to UTC+14. diff --git a/mercurial/changelog.py b/mercurial/changelog.py --- a/mercurial/changelog.py +++ b/mercurial/changelog.py @@ -41,14 +41,15 @@ class changelog(revlog): 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()