mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
makedate: abort on negative timestamps (issue2513)
catches weird clock settings
This commit is contained in:
parent
9817658bbd
commit
848dac9692
@ -1015,7 +1015,11 @@ def makedate():
|
||||
tz = time.altzone
|
||||
else:
|
||||
tz = time.timezone
|
||||
return time.mktime(lt), tz
|
||||
t = time.mktime(lt)
|
||||
if t < 0:
|
||||
hint = _("check your clock")
|
||||
raise Abort(_("negative timestamp: %d") % t, hint=hint)
|
||||
return t, tz
|
||||
|
||||
def datestr(date=None, format='%a %b %d %H:%M:%S %Y %1%2'):
|
||||
"""represent a (unixtime, offset) tuple as a localized time.
|
||||
|
Loading…
Reference in New Issue
Block a user