diff mercurial/util.py @ 15159:85322c19c831

merge with stable
author Matt Mackall <mpm@selenic.com>
date Tue, 27 Sep 2011 18:50:18 -0500
parents 76cd1964519c c208dcd0f709
children a347b3614bae
line wrap: on
line diff
--- a/mercurial/util.py	Thu Sep 22 01:51:36 2011 +0200
+++ b/mercurial/util.py	Tue Sep 27 18:50:18 2011 -0500
@@ -913,7 +913,12 @@
         minutes = abs(tz) // 60
         format = format.replace("%1", "%c%02d" % (sign, minutes // 60))
         format = format.replace("%2", "%02d" % (minutes % 60))
-    s = time.strftime(format, time.gmtime(float(t) - tz))
+    try:
+        t = time.gmtime(float(t) - tz)
+    except ValueError:
+        # time was out of range
+        t = time.gmtime(sys.maxint)
+    s = time.strftime(format, t)
     return s
 
 def shortdate(date=None):