mercurial/util.py
changeset 3809 e43b48f0f718
parent 3808 92a3532a01d9
child 3810 d6529582942a
equal deleted inserted replaced
3808:92a3532a01d9 3809:e43b48f0f718
  1064 
  1064 
  1065 def parsedate(string, formats=None):
  1065 def parsedate(string, formats=None):
  1066     """parse a localized time string and return a (unixtime, offset) tuple.
  1066     """parse a localized time string and return a (unixtime, offset) tuple.
  1067     The date may be a "unixtime offset" string or in one of the specified
  1067     The date may be a "unixtime offset" string or in one of the specified
  1068     formats."""
  1068     formats."""
       
  1069     if not string:
       
  1070         return 0, 0
  1069     if not formats:
  1071     if not formats:
  1070         formats = defaultdateformats
  1072         formats = defaultdateformats
  1071     try:
  1073     try:
  1072         when, offset = map(int, string.split(' '))
  1074         when, offset = map(int, string.split(' '))
  1073     except ValueError:
  1075     except ValueError: