changeset 1195:f92af8d53330

Validate user input of dates when adding a changelog entry.
author Bryan O'Sullivan <bos@serpentine.com>
date Sat, 03 Sep 2005 23:08:39 -0700
parents c165cbf56bb1
children 3738e85ead07
files mercurial/changelog.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/changelog.py	Thu Sep 01 12:13:56 2005 -0700
+++ b/mercurial/changelog.py	Sat Sep 03 23:08:39 2005 -0700
@@ -31,7 +31,10 @@
 
     def add(self, manifest, list, desc, transaction, p1=None, p2=None,
                   user=None, date=None):
-        if not date:
+        if date:
+            when, offset = map(int, date.split())
+            assert abs(offset) < 43200, 'bad time zone offset: %d' % offset
+        else:
             if time.daylight: offset = time.altzone
             else: offset = time.timezone
             date = "%d %d" % (time.time(), offset)