Commit 51104fec authored by Marc-Antoine Ruel's avatar Marc-Antoine Ruel Committed by Commit Bot

Update roll-dep to skip trivial recipe roll

Otherwise it can make the log overwhelming when the number of rolls is higher
than the number of meaningful commits.

R=iannucci@chromium.org
BUG=620765

Change-Id: Iec0b41304d50091498d43abc4883e522b8cc9a2c
Reviewed-on: https://chromium-review.googlesource.com/448676
Commit-Queue: Marc-Antoine Ruel <maruel@chromium.org>
Reviewed-by: 's avatarRobbie Iannucci <iannucci@chromium.org>
parent 89f16a8d
......@@ -124,15 +124,23 @@ def roll(root, deps_dir, roll_to, key, reviewers, bug, no_log, log_limit,
]
logs = check_output(
cmd + ['--format=%ad %ae %s'], # Args with '=' are automatically quoted.
cwd=full_dir)
cwd=full_dir).rstrip()
logs = re.sub(r'(?m)^(\d\d\d\d-\d\d-\d\d [^@]+)@[^ ]+( .*)$', r'\1\2', logs)
nb_commits = logs.count('\n')
lines = logs.splitlines()
cleaned_lines = [
l for l in lines
if not l.endswith('recipe-roller Roll recipe dependencies (trivial).')
]
logs = '\n'.join(cleaned_lines) + '\n'
nb_commits = len(lines)
rolls = nb_commits - len(cleaned_lines)
header = 'Roll %s/ %s (%d commit%s).\n\n' % (
header = 'Roll %s/ %s (%d commit%s%s)\n\n' % (
deps_dir,
commit_range,
nb_commits,
's' if nb_commits > 1 else '')
's' if nb_commits > 1 else '',
('; %s trivial rolls' % rolls) if rolls else '')
log_section = ''
if log_url:
......@@ -140,7 +148,7 @@ def roll(root, deps_dir, roll_to, key, reviewers, bug, no_log, log_limit,
log_section += '$ %s ' % ' '.join(cmd)
log_section += '--format=\'%ad %ae %s\'\n'
if not no_log and should_show_log(upstream_url):
if logs.count('\n') > log_limit:
if len(cleaned_lines) > log_limit:
# Keep the first N log entries.
logs = ''.join(logs.splitlines(True)[:log_limit]) + '(...)\n'
log_section += logs
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment