Copy the version list when creating new Version

This commit is contained in:
bom 2023-02-23 14:16:17 +01:00
parent 2fe05b0e06
commit 0df4db54d8
2 changed files with 3 additions and 5 deletions

View file

@ -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()

View file

@ -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