mercurial/changelog.py
changeset 1202 71111d796e40
parent 1197 8deb69818e4b
child 1321 b47f96a178a3
--- a/mercurial/changelog.py
+++ b/mercurial/changelog.py
@@ -35,7 +35,10 @@ class changelog(revlog):
             # validate explicit (probably user-specified) date and
             # time zone offset. values must fit in signed 32 bits for
             # current 32-bit linux runtimes.
-            when, offset = map(int, date.split(' '))
+            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: