From 0df4db54d818c65cc496174a07d308be71b8fef6 Mon Sep 17 00:00:00 2001 From: bom Date: Thu, 23 Feb 2023 14:16:17 +0100 Subject: [PATCH] Copy the version list when creating new Version --- release_mixin.py | 3 +-- version.py | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/release_mixin.py b/release_mixin.py index 48afeaf..fbf5756 100644 --- a/release_mixin.py +++ b/release_mixin.py @@ -37,8 +37,7 @@ class ReleaseMixin(DevopsBuild): def init(self): init_service = InitReleaseService(self.version_repo) self.release_version = init_service.create_release_version(self.commit_string) - release_version_copy = copy.deepcopy(self.release_version) # otherwise we'll modify the release_version again - self.bump_version = release_version_copy.create_bump_version() + self.bump_version = self.release_version.create_bump_version() def prepare(self, version): git_repository = GitRepository() diff --git a/version.py b/version.py index 61d92f5..7dea4f7 100644 --- a/version.py +++ b/version.py @@ -36,14 +36,13 @@ class Version(): return self.version_string def create_release_version(self): - release_version = Version(self.version_list, self.release_type) + release_version = Version(self.version_list.copy(), self.release_type) release_version.is_snapshot = self.is_snapshot release_version.increment() return release_version def create_bump_version(self): - bump_version = Version(self.version_list, self.release_type) + bump_version = Version(self.version_list.copy(), ReleaseType.BUMP) bump_version.is_snapshot = self.is_snapshot - bump_version.release_type = ReleaseType.BUMP bump_version.increment() return bump_version