changeset 6230:c7253d1a774e

dates: Fix bare times to be relative to "today"
author Matt Mackall <mpm@selenic.com>
date Tue, 11 Mar 2008 17:42:51 -0500
parents c3182eeb70ea
children 14a4fdf9037f
files mercurial/util.py
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/util.py	Tue Mar 11 17:42:41 2008 -0500
+++ b/mercurial/util.py	Tue Mar 11 17:42:51 2008 -0500
@@ -1586,7 +1586,7 @@
     """
     if not date:
         return 0, 0
-    if type(date) is type((0, 0)) and len(date) == 2:
+    if isinstance(date, tuple) and len(date) == 2:
         return date
     if not formats:
         formats = defaultdateformats
@@ -1602,8 +1602,6 @@
             if part not in defaults:
                 if part[0] in "HMS":
                     defaults[part] = "00"
-                elif part[0] in "dm":
-                    defaults[part] = "1"
                 else:
                     defaults[part] = datestr(now, "%" + part[0])
 
@@ -1640,7 +1638,8 @@
     """
 
     def lower(date):
-        return parsedate(date, extendeddateformats)[0]
+        d = dict(mb="1", d="1")
+        return parsedate(date, extendeddateformats, d)[0]
 
     def upper(date):
         d = dict(mb="12", HI="23", M="59", S="59")