Skip to content

Commit a34f89d

Browse files
Fix micro branch to avoid version and match three digit
1 parent c967118 commit a34f89d

3 files changed

Lines changed: 4 additions & 9 deletions

File tree

bert_e/exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ class ReleaseAlreadyExists(InternalException):
295295

296296
def __init__(self, branch, tag):
297297
msg = 'Branch %r must be deleted as %r has been created, ' \
298-
'you must use a hotfix branch if you really intend, ' \
298+
'you must use a hotfix branch if you really intend ' \
299299
'to target this version.' \
300300
% (branch, tag)
301301
super(ReleaseAlreadyExists, self).__init__(msg)

bert_e/tests/test_bert_e.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ def test_four_digit_fix_version(self):
489489
5: {'name': 'development/10.0', 'ignore': False}
490490
})
491491
tags = ['4.3.17.0', '4.3.18', '5.1.3', '5.1.7']
492-
fixver = ['4.3.17.1', '4.3.19', '5.1.8', '5.1.9', '10.0.0']
492+
fixver = ['4.3.17', '4.3.19', '5.1.8', '5.1.9', '10.0.0']
493493
with self.assertRaises(exns.ReleaseAlreadyExists):
494494
self.finalize_cascade(branches, tags, destination, fixver)
495495

bert_e/workflow/gitwaterflow/branches.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -966,10 +966,6 @@ def update_versions(self, tag):
966966
dev_branch: DevelopmentBranch = branches.get(DevelopmentBranch)
967967
major_branch: DevelopmentBranch = major_branches.get(DevelopmentBranch)
968968
micro_branch: DevelopmentBranch = micro_branches.get(DevelopmentBranch)
969-
if micro_branch:
970-
micro_branch.version = '%d.%d.%d' % (micro_branch.major,
971-
micro_branch.minor,
972-
micro_branch.micro)
973969

974970
if hf_branch:
975971
if hf_branch.micro == micro:
@@ -979,10 +975,9 @@ def update_versions(self, tag):
979975
hf_branch.micro,
980976
hf_branch.hfrev)
981977

982-
tag_version_str = f"{major}.{minor}.{micro}"
983-
984978
if micro_branch is not None and \
985-
(micro_branch.version == tag_version_str):
979+
([micro_branch.major, micro_branch.minor,
980+
micro_branch.micro] == [major, minor, micro]):
986981
raise errors.ReleaseAlreadyExists(micro_branch, tag)
987982

988983
if dev_branch:

0 commit comments

Comments
 (0)