Skip to content

Commit 60bb8bf

Browse files
author
Vladimir Kotal
authored
fail mirroring if incoming check raises exception (#2709)
1 parent 0439bf2 commit 60bb8bf

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

opengrok-tools/src/main/python/opengrok_tools/mirror.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,8 @@ def main():
368368
break
369369
except RepositoryException:
370370
logger.error('Cannot determine incoming changes for '
371-
'repository {}, driving on'.format(repo))
371+
'repository {}'.format(repo))
372+
sys.exit(1)
372373

373374
if not got_incoming:
374375
logger.info('No incoming changes for repositories in '

opengrok-tools/src/main/python/opengrok_tools/scm/mercurial.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,13 @@ def incoming(self):
108108
env_vars=self.env, logger=self.logger)
109109
cmd.execute()
110110
self.logger.debug(cmd.getoutputstr())
111-
if cmd.getstate() != Command.FINISHED:
111+
retcode = cmd.getretcode()
112+
if cmd.getstate() != Command.FINISHED or retcode not in [0, 1]:
112113
cmd.log_error("failed to perform incoming")
113114
raise RepositoryException('failed to perform incoming command '
114115
'for repository {}'.format(self))
115116

116-
if cmd.getretcode() == 0:
117+
if retcode == 0:
117118
return True
118119
else:
119120
return False

0 commit comments

Comments
 (0)