diff mercurial/util.py @ 13062:e1002cf9fe54 stable

parsedate: abort on negative dates (issue2513) catches "hg commit -d '-7654321 3600'" (example)
author Adrian Buehlmann <adrian@cadifra.com>
date Wed, 24 Nov 2010 19:31:43 +0100
parents 2649be11ab0b
children e98581d44f0b
line wrap: on
line diff
--- a/mercurial/util.py	Wed Dec 01 17:50:49 2010 -0600
+++ b/mercurial/util.py	Wed Nov 24 19:31:43 2010 +0100
@@ -1116,6 +1116,8 @@
     # to UTC+14
     if abs(when) > 0x7fffffff:
         raise Abort(_('date exceeds 32 bits: %d') % when)
+    if when < 0:
+        raise Abort(_('negative date value: %d') % when)
     if offset < -50400 or offset > 43200:
         raise Abort(_('impossible time zone offset: %d') % offset)
     return when, offset