mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
Make CQ_INCLUDE_TRYBOTS support review-specific
This CL wholly revamps the way presubmit_support adds CQ_INCLUDE_TRYBOTS lines in commit descriptions. In particular, when the CL is being uploaded to Gerrit, it uses our pre-existing support for manipulating git footers to make the whole process much simpler. R=tandrii@chromium.org Bug: 710547 Change-Id: I5858282a44c590f131021fa3820f1cb3f70ef620 Reviewed-on: https://chromium-review.googlesource.com/487831 Commit-Queue: Aaron Gable <agable@chromium.org> Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
This commit is contained in:
@@ -127,6 +127,17 @@ def add_footer(message, key, value, after_keys=None, before_keys=None):
|
||||
return '\n'.join(top_lines + footer_lines)
|
||||
|
||||
|
||||
def remove_footer(message, key):
|
||||
"""Returns a message with all instances of given footer removed."""
|
||||
key = normalize_name(key)
|
||||
top_lines, footer_lines, _ = split_footers(message)
|
||||
if not footer_lines:
|
||||
return message
|
||||
new_footer_lines = [
|
||||
l for l in footer_lines if normalize_name(parse_footer(l)[0]) != key]
|
||||
return '\n'.join(top_lines + new_footer_lines)
|
||||
|
||||
|
||||
def get_unique(footers, key):
|
||||
key = normalize_name(key)
|
||||
values = footers[key]
|
||||
|
||||
Reference in New Issue
Block a user