##// END OF EJS Templates
parsedate: abort on negative dates (issue2513)...
Adrian Buehlmann -
r13062:e1002cf9 stable
parent child Browse files
Show More
@@ -1116,6 +1116,8 b' def parsedate(date, formats=None, defaul'
1116 # to UTC+14
1116 # to UTC+14
1117 if abs(when) > 0x7fffffff:
1117 if abs(when) > 0x7fffffff:
1118 raise Abort(_('date exceeds 32 bits: %d') % when)
1118 raise Abort(_('date exceeds 32 bits: %d') % when)
1119 if when < 0:
1120 raise Abort(_('negative date value: %d') % when)
1119 if offset < -50400 or offset > 43200:
1121 if offset < -50400 or offset > 43200:
1120 raise Abort(_('impossible time zone offset: %d') % offset)
1122 raise Abort(_('impossible time zone offset: %d') % offset)
1121 return when, offset
1123 return when, offset
@@ -22,6 +22,9 b' commit date test'
22 $ hg commit -d '111111111111 0' -m commit-7
22 $ hg commit -d '111111111111 0' -m commit-7
23 abort: date exceeds 32 bits: 111111111111
23 abort: date exceeds 32 bits: 111111111111
24 [255]
24 [255]
25 $ hg commit -d '-7654321 3600' -m commit-7
26 abort: negative date value: -7654321
27 [255]
25
28
26 commit added file that has been deleted
29 commit added file that has been deleted
27
30
General Comments 0
You need to be logged in to leave comments. Login now