Mercurial > public > mercurial-scm > hg-stable
diff mercurial/changelog.py @ 1196:3738e85ead07
Make date/timezone validation in changelog.add more robust. Add test.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Sat, 03 Sep 2005 23:28:15 -0700 |
parents | f92af8d53330 |
children | 8deb69818e4b |
line wrap: on
line diff
--- a/mercurial/changelog.py Sat Sep 03 23:08:39 2005 -0700 +++ b/mercurial/changelog.py Sat Sep 03 23:28:15 2005 -0700 @@ -32,7 +32,10 @@ def add(self, manifest, list, desc, transaction, p1=None, p2=None, user=None, date=None): if date: - when, offset = map(int, date.split()) + # validate explicit (probably user-specified) date and + # time zone offset + when, offset = map(int, date.split(' ')) + time.localtime(when) assert abs(offset) < 43200, 'bad time zone offset: %d' % offset else: if time.daylight: offset = time.altzone