comparison mercurial/util.py @ 5356:b98c377b3c16

Merge with crew.
author Bryan O'Sullivan <bos@serpentine.com>
date Tue, 02 Oct 2007 13:49:36 -0700
parents efe7ef325737 c6adf2be6069
children 5105b119edd2
comparison
equal deleted inserted replaced
5351:efe7ef325737 5356:b98c377b3c16
1466 s = time.strftime(format, time.gmtime(float(t) - tz)) 1466 s = time.strftime(format, time.gmtime(float(t) - tz))
1467 if timezone: 1467 if timezone:
1468 s += timezone_format % (-tz / 3600, ((-tz % 3600) / 60)) 1468 s += timezone_format % (-tz / 3600, ((-tz % 3600) / 60))
1469 return s 1469 return s
1470 1470
1471 def strdate(string, format, defaults): 1471 def strdate(string, format, defaults=[]):
1472 """parse a localized time string and return a (unixtime, offset) tuple. 1472 """parse a localized time string and return a (unixtime, offset) tuple.
1473 if the string cannot be parsed, ValueError is raised.""" 1473 if the string cannot be parsed, ValueError is raised."""
1474 def timezone(string): 1474 def timezone(string):
1475 tz = string.split()[-1] 1475 tz = string.split()[-1]
1476 if tz[0] in "+-" and len(tz) == 5 and tz[1:].isdigit(): 1476 if tz[0] in "+-" and len(tz) == 5 and tz[1:].isdigit():