Return version objects instead of mutating
This commit is contained in:
parent
167eec4620
commit
fea5720161
1 changed files with 9 additions and 5 deletions
14
version.py
14
version.py
|
@ -36,10 +36,14 @@ class Version():
|
||||||
return self.version_string
|
return self.version_string
|
||||||
|
|
||||||
def create_release_version(self):
|
def create_release_version(self):
|
||||||
if self.release_type == ReleaseType.PATCH:
|
release_version = Version(self.version_list, self.release_type)
|
||||||
self.is_snapshot = False
|
release_version.is_snapshot = self.is_snapshot
|
||||||
else:
|
release_version.increment()
|
||||||
self.increment()
|
return release_version
|
||||||
|
|
||||||
def create_bump_version(self):
|
def create_bump_version(self):
|
||||||
self.increment(ReleaseType.BUMP)
|
bump_version = Version(self.version_list, self.release_type)
|
||||||
|
bump_version.is_snapshot = self.is_snapshot
|
||||||
|
bump_version.release_type = ReleaseType.BUMP
|
||||||
|
bump_version.increment()
|
||||||
|
return bump_version
|
||||||
|
|
Loading…
Reference in a new issue