mirror of
https://github.com/apache/impala.git
synced 2025-12-19 18:12:08 -05:00
IMPALA-6410: compare_branches: use looser expression
We've already got one use of "Cherry-pick:" instead of "Cherry-picks:" in master, so I'm loosening the regular expression a bit. (And converting the string search into a case-insensitive regexp search.) I tested this by running it manually and inspecting results. Change-Id: Ie3f75d9e01d2760571547b1a1a5f42bbc8455a05 Reviewed-on: http://gerrit.cloudera.org:8080/9135 Reviewed-by: Taras Bobrovytsky <tbobrovytsky@cloudera.com> Tested-by: Impala Public Jenkins
This commit is contained in:
committed by
Impala Public Jenkins
parent
2ee2c4fdb9
commit
5ca603a376
@@ -103,8 +103,9 @@ def create_parser():
|
||||
os.path.dirname(os.path.abspath(__file__)), 'ignored_commits.json')
|
||||
parser.add_argument('--ignored_commits_file', default=default_ignored_commits_path,
|
||||
help='JSON File that contains ignored commits as specified in the help')
|
||||
parser.add_argument('--skip_commits_matching', default="Cherry-picks: not for {branch}",
|
||||
help='String in commit messages that causes the commit to be ignored. ' +
|
||||
parser.add_argument('--skip_commits_matching',
|
||||
default="Cherry-pick.?:.?not (for|to) {branch}",
|
||||
help='Regex searched for in commit messages that causes the commit to be ignored.' +
|
||||
' {branch} is replaced with target branch; the search is case-insensitive')
|
||||
parser.add_argument('--verbose', '-v', action='store_true', default=False,
|
||||
help='Turn on DEBUG and INFO logging')
|
||||
@@ -232,14 +233,14 @@ def main():
|
||||
print '-' * 80
|
||||
jira_keys = []
|
||||
jira_key_pat = re.compile(r'(IMPALA-\d+)')
|
||||
skip_commits_matching = options.skip_commits_matching.replace(
|
||||
"{branch}", options.target_branch)
|
||||
skip_commits_matching = options.skip_commits_matching.format(
|
||||
branch=options.target_branch)
|
||||
for change_id, (commit_hash, msg, author, date, body) in source_commits.iteritems():
|
||||
change_in_target = change_id in target_commits
|
||||
ignore_by_config = commit_hash in ignored_commits[
|
||||
(options.source_branch, options.target_branch)]
|
||||
ignore_by_commit_message = skip_commits_matching.lower() in msg.lower() \
|
||||
or skip_commits_matching.lower() in body.lower()
|
||||
ignore_by_commit_message = re.search(skip_commits_matching, "\n".join([msg, body]),
|
||||
re.IGNORECASE)
|
||||
# This conditional block just for debug logging of ignored commits
|
||||
if ignore_by_config or ignore_by_commit_message:
|
||||
if change_in_target:
|
||||
|
||||
Reference in New Issue
Block a user