Skip to content

Commit b0fe77b

Browse files
Vladimir Kotalahornace
authored andcommitted
allow override check_incoming on global config level
1 parent 941332a commit b0fe77b

File tree

1 file changed

+12
-5
lines changed
  • tools/src/main/python/opengrok_tools/utils

1 file changed

+12
-5
lines changed

tools/src/main/python/opengrok_tools/utils/mirror.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,8 @@ def run_command(cmd, project_name):
317317
cmd.getoutputstr()))
318318

319319

320-
def handle_disabled_project(config, project_name, disabled_msg, headers=None, timeout=None):
320+
def handle_disabled_project(config, project_name, disabled_msg, headers=None,
321+
timeout=None):
321322
disabled_command = config.get(DISABLED_CMD_PROPERTY)
322323
if disabled_command:
323324
logger = logging.getLogger(__name__)
@@ -381,14 +382,20 @@ def mirror_project(config, project_name, check_changes, uri,
381382
prehook, posthook, hook_timeout, command_timeout, use_proxy, \
382383
ignored_repos, \
383384
check_changes_proj = get_project_properties(project_config,
384-
project_name,
385-
config.get(HOOKDIR_PROPERTY))
385+
project_name,
386+
config.
387+
get(HOOKDIR_PROPERTY))
386388

387389
if not command_timeout:
388390
command_timeout = config.get(CMD_TIMEOUT_PROPERTY)
389391
if not hook_timeout:
390392
hook_timeout = config.get(HOOK_TIMEOUT_PROPERTY)
391393

394+
if check_changes_proj is None:
395+
check_changes_config = config.get(INCOMING_PROPERTY)
396+
else:
397+
check_changes_config = check_changes_proj
398+
392399
proxy = None
393400
if use_proxy:
394401
proxy = config.get(PROXY_PROPERTY)
@@ -423,8 +430,8 @@ def mirror_project(config, project_name, check_changes, uri,
423430
format(project_name))
424431
return CONTINUE_EXITVAL
425432

426-
if check_changes_proj is not None:
427-
check_changes = check_changes_proj
433+
if check_changes_config is not None:
434+
check_changes = check_changes_config
428435

429436
# Check if the project or any of its repositories have changed.
430437
if check_changes:

0 commit comments

Comments
 (0)