From 7ebbf758fcee3a32a64435f549c853c91335300c Mon Sep 17 00:00:00 2001 From: Vladimir Kotal Date: Thu, 2 Jan 2025 13:59:53 +0100 Subject: [PATCH] address other SCMs --- tools/src/main/python/opengrok_tools/scm/cvs.py | 4 ++-- tools/src/main/python/opengrok_tools/scm/git.py | 4 ++-- tools/src/main/python/opengrok_tools/scm/repository.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/src/main/python/opengrok_tools/scm/cvs.py b/tools/src/main/python/opengrok_tools/scm/cvs.py index de382981090..9631a4f4fb9 100644 --- a/tools/src/main/python/opengrok_tools/scm/cvs.py +++ b/tools/src/main/python/opengrok_tools/scm/cvs.py @@ -18,7 +18,7 @@ # # -# Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. # Portions Copyright (c) 2020, Krystof Tulinger # @@ -44,7 +44,7 @@ def reposync(self): cmd.execute() self.logger.info("output of {}:".format(cmd)) self.logger.info(cmd.getoutputstr()) - if cmd.getretcode() != 0 or cmd.getstate() != Command.FINISHED: + if cmd.getstate() != Command.FINISHED or cmd.getretcode() != 0: self.logger.error("failed to perform update: command {}" "in directory {} exited with {}". format(hg_command, self.path, cmd.getretcode())) diff --git a/tools/src/main/python/opengrok_tools/scm/git.py b/tools/src/main/python/opengrok_tools/scm/git.py index 709855cc600..5e2a5b4477a 100644 --- a/tools/src/main/python/opengrok_tools/scm/git.py +++ b/tools/src/main/python/opengrok_tools/scm/git.py @@ -18,7 +18,7 @@ # # -# Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. # Portions Copyright (c) 2020, Krystof Tulinger # @@ -44,7 +44,7 @@ def _configure_git_pull(self): cmd = self.get_command(git_command, work_dir=self.path, env_vars=self.env, logger=self.logger) cmd.execute() - if cmd.getretcode() != 0 or cmd.getstate() != Command.FINISHED: + if cmd.getstate() != Command.FINISHED or cmd.getretcode() != 0: cmd.log_error("failed to configure git pull.ff") def reposync(self): diff --git a/tools/src/main/python/opengrok_tools/scm/repository.py b/tools/src/main/python/opengrok_tools/scm/repository.py index cb7578d042e..25c2e0b1fb4 100644 --- a/tools/src/main/python/opengrok_tools/scm/repository.py +++ b/tools/src/main/python/opengrok_tools/scm/repository.py @@ -18,7 +18,7 @@ # # -# Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. # Portions Copyright (c) 2020, Krystof Tulinger # @@ -161,7 +161,7 @@ def _run_command(self, command): cmd = self.get_command(command, work_dir=self.path, env_vars=self.env, logger=self.logger) cmd.execute() - if cmd.getretcode() != 0 or cmd.getstate() != Command.FINISHED: + if cmd.getstate() != Command.FINISHED or cmd.getretcode() != 0: cmd.log_error("failed to perform command {}".format(command)) status = cmd.getretcode() if status == 0 and cmd.getstate() != Command.FINISHED: