From 9404b35cf7e52adfbee3c15ca121ca3b816e84f1 Mon Sep 17 00:00:00 2001 From: "r.jaepel" <ronald.jaepel@gmail.com> Date: Mon, 11 Mar 2024 13:23:37 +0100 Subject: [PATCH] Don't raise an issue if local study is ahead of remote --- cadetrdm/repositories.py | 9 +++--- examples/example_for_runner.py | 50 +++++++++++++++++----------------- 2 files changed, 29 insertions(+), 30 deletions(-) diff --git a/cadetrdm/repositories.py b/cadetrdm/repositories.py index c1551c6..6ae61b8 100644 --- a/cadetrdm/repositories.py +++ b/cadetrdm/repositories.py @@ -133,12 +133,11 @@ class BaseRepo: f"{[branch.name for branch in correct_remote_branches]}") remote_hash = str(correct_remote_branches[0].commit) - if self.current_commit_hash != remote_hash: - if remote_hash in self.log: - raise RuntimeError( - "Local repository is ahead of remote. This could be due to CADET-RDM version updates" - ) + if self.current_commit_hash != remote_hash and remote_hash not in self.log: return True + elif self.current_commit_hash != remote_hash and remote_hash in self.log: + print("Local repository is ahead of remote. This could be due to CADET-RDM version updates.") + return False else: return False diff --git a/examples/example_for_runner.py b/examples/example_for_runner.py index 63949a5..1e88511 100644 --- a/examples/example_for_runner.py +++ b/examples/example_for_runner.py @@ -13,36 +13,36 @@ if __name__ == '__main__': "git@jugit.fz-juelich.de:r.jaepel/puetmann2013.git", ) - clr = Study( - WORK_DIR / 'clr', - "git@jugit.fz-juelich.de:j.schmoelder/clr.git", - branch="adapt_to_cadetrdm_runner" - ) - - flip_flow = Study( - WORK_DIR / 'flip_flow', - "git@jugit.fz-juelich.de:j.schmoelder/flip_flow.git", - branch="adapt_to_cadetrdm_runner" - ) - - serial_columns = Study( - WORK_DIR / 'serial_columns', - "git@jugit.fz-juelich.de:j.schmoelder/serial_columns.git", - # branch="adapt_to_cadetrdm_runner" - ) - - smb = Study( - WORK_DIR / 'smb', - "git@jugit.fz-juelich.de:j.schmoelder/smb.git", - # branch="adapt_to_cadetrdm_runner" - ) + # clr = Study( + # WORK_DIR / 'clr', + # "git@jugit.fz-juelich.de:j.schmoelder/clr.git", + # branch="adapt_to_cadetrdm_runner" + # ) + # + # flip_flow = Study( + # WORK_DIR / 'flip_flow', + # "git@jugit.fz-juelich.de:j.schmoelder/flip_flow.git", + # branch="adapt_to_cadetrdm_runner" + # ) + # + # serial_columns = Study( + # WORK_DIR / 'serial_columns', + # "git@jugit.fz-juelich.de:j.schmoelder/serial_columns.git", + # # branch="adapt_to_cadetrdm_runner" + # ) + # + # smb = Study( + # WORK_DIR / 'smb', + # "git@jugit.fz-juelich.de:j.schmoelder/smb.git", + # # branch="adapt_to_cadetrdm_runner" + # ) studies = [ - # puetmann2013, + puetmann2013, # clr, # flip_flow, # serial_columns, - smb, + # smb, ] force = False -- GitLab