mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 10:41:31 +00:00
Check for impossible date ranges
If you specify the wrong year to the -b flag then you may end up with an inverted time range that is entirely in the future, and this causes odd failures. Or at least that's what I've heard. This detects some of these error cases and halts. Also a one-line git cl format cleanup. Change-Id: Iede80faed00d4857443b3a1d853fa2ba69f47023 Reviewed-on: https://chromium-review.googlesource.com/c/1487744 Commit-Queue: Bruce Dawson <brucedawson@chromium.org> Auto-Submit: Bruce Dawson <brucedawson@chromium.org> Reviewed-by: Dirk Pranke <dpranke@chromium.org>
This commit is contained in:
@@ -700,7 +700,7 @@ class MyActivity(object):
|
||||
if self.changes:
|
||||
self.print_heading('Changes')
|
||||
for change in self.changes:
|
||||
self.print_change(change)
|
||||
self.print_change(change)
|
||||
|
||||
def print_access_errors(self):
|
||||
if self.access_errors:
|
||||
@@ -1039,6 +1039,12 @@ def main():
|
||||
else:
|
||||
end = datetime.today()
|
||||
options.begin, options.end = begin, end
|
||||
if begin >= end:
|
||||
# The queries fail in peculiar ways when the begin date is in the future.
|
||||
# Give a descriptive error message instead.
|
||||
logging.error('Start date (%s) is the same or later than end date (%s)' %
|
||||
(begin, end))
|
||||
return 1
|
||||
|
||||
if options.markdown:
|
||||
options.output_format_heading = '### {heading}\n'
|
||||
|
||||
Reference in New Issue
Block a user