mercurial/util.py
changeset 13200 6f011cf52f9a
parent 13197 684a977c2ae0
child 13205 18f0084a97c8
equal deleted inserted replaced
13199:a38df1250945 13200:6f011cf52f9a
  1097     except ValueError:
  1097     except ValueError:
  1098         # fill out defaults
  1098         # fill out defaults
  1099         if not defaults:
  1099         if not defaults:
  1100             defaults = {}
  1100             defaults = {}
  1101         now = makedate()
  1101         now = makedate()
  1102         for part in "d mb yY HI M S".split():
  1102         for part in ("d", "mb", "yY", "HI", "M", "S"):
  1103             if part not in defaults:
  1103             if part not in defaults:
  1104                 if part[0] in "HMS":
  1104                 if part[0] in "HMS":
  1105                     defaults[part] = "00"
  1105                     defaults[part] = "00"
  1106                 else:
  1106                 else:
  1107                     defaults[part] = datestr(now, "%" + part[0])
  1107                     defaults[part] = datestr(now, "%" + part[0])
  1144         d = dict(mb="1", d="1")
  1144         d = dict(mb="1", d="1")
  1145         return parsedate(date, extendeddateformats, d)[0]
  1145         return parsedate(date, extendeddateformats, d)[0]
  1146 
  1146 
  1147     def upper(date):
  1147     def upper(date):
  1148         d = dict(mb="12", HI="23", M="59", S="59")
  1148         d = dict(mb="12", HI="23", M="59", S="59")
  1149         for days in "31 30 29".split():
  1149         for days in ("31", "30", "29"):
  1150             try:
  1150             try:
  1151                 d["d"] = days
  1151                 d["d"] = days
  1152                 return parsedate(date, extendeddateformats, d)[0]
  1152                 return parsedate(date, extendeddateformats, d)[0]
  1153             except:
  1153             except:
  1154                 pass
  1154                 pass