Show More
@@ -41,14 +41,15 b' class changelog(revlog):' | |||||
41 | if date: |
|
41 | if date: | |
42 | # validate explicit (probably user-specified) date and |
|
42 | # validate explicit (probably user-specified) date and | |
43 | # time zone offset. values must fit in signed 32 bits for |
|
43 | # time zone offset. values must fit in signed 32 bits for | |
44 | # current 32-bit linux runtimes. |
|
44 | # current 32-bit linux runtimes. timezones go from UTC-12 | |
|
45 | # to UTC+14 | |||
45 | try: |
|
46 | try: | |
46 | when, offset = map(int, date.split(' ')) |
|
47 | when, offset = map(int, date.split(' ')) | |
47 | except ValueError: |
|
48 | except ValueError: | |
48 | raise ValueError(_('invalid date: %r') % date) |
|
49 | raise ValueError(_('invalid date: %r') % date) | |
49 | if abs(when) > 0x7fffffff: |
|
50 | if abs(when) > 0x7fffffff: | |
50 | raise ValueError(_('date exceeds 32 bits: %d') % when) |
|
51 | raise ValueError(_('date exceeds 32 bits: %d') % when) | |
51 |
if |
|
52 | if offset < -50400 or offset > 43200: | |
52 | raise ValueError(_('impossible time zone offset: %d') % offset) |
|
53 | raise ValueError(_('impossible time zone offset: %d') % offset) | |
53 | else: |
|
54 | else: | |
54 | date = "%d %d" % util.makedate() |
|
55 | date = "%d %d" % util.makedate() |
General Comments 0
You need to be logged in to leave comments.
Login now