Changeset View
Changeset View
Standalone View
Standalone View
contrib/buildbot/server.py
Show First 20 Lines • Show All 262 Lines • ▼ Show 20 Lines | def build_diff(): | ||||
# Get the list of changed files | # Get the list of changed files | ||||
changedFiles = phab.get_revision_changed_files( | changedFiles = phab.get_revision_changed_files( | ||||
revision_id=revision_id) | revision_id=revision_id) | ||||
# Get a list of the builds that should run on diffs | # Get a list of the builds that should run on diffs | ||||
builds = [] | builds = [] | ||||
for build_name, v in config.get('builds', {}).items(): | for build_name, v in config.get('builds', {}).items(): | ||||
diffRegex = v.get('runOnDiffRegex', None) | diffRegexes = v.get('runOnDiffRegex', None) | ||||
if v.get('runOnDiff', False) or diffRegex is not None: | if v.get('runOnDiff', False) or diffRegexes is not None: | ||||
if diffRegex: | if diffRegexes: | ||||
# If the regex matches at least one changed file, add this | # If the regex matches at least one changed file, add this | ||||
# build to the list. | # build to the list. | ||||
for changedFile in changedFiles: | def regexesMatchAnyFile(regexes, files): | ||||
if re.match(diffRegex, changedFile): | for regex in regexes: | ||||
for filename in files: | |||||
if re.match(regex, filename): | |||||
return True | |||||
return False | |||||
if regexesMatchAnyFile(diffRegexes, changedFiles): | |||||
builds.append(build_name) | builds.append(build_name) | ||||
break | |||||
else: | else: | ||||
builds.append(build_name) | builds.append(build_name) | ||||
if target_phid in create_server.db['diff_targets']: | if target_phid in create_server.db['diff_targets']: | ||||
build_target = create_server.db['diff_targets'][target_phid] | build_target = create_server.db['diff_targets'][target_phid] | ||||
else: | else: | ||||
build_target = BuildTarget(target_phid) | build_target = BuildTarget(target_phid) | ||||
▲ Show 20 Lines • Show All 735 Lines • Show Last 20 Lines |