When working out what version prefix to use from a revision - if there are no dots (but there are numbers) default to 1.25000.0.

This commit is contained in:
Dan Hawkins 2018-10-29 16:24:16 +00:00
commit 34d5e771d7

View file

@ -76,6 +76,7 @@ def getVersionPrefix(sourcebranch):
defaultversionprefix = "1.30000.0."
mastertypeversionprefix = "1.20000.0."
thirdpartyversionprefix = "1.25000.0."
splits = sourcebranch.split('/')
if len(splits) < 1:
print("Source branch name is invalid. Defaulting to: {0}".format(defaultversionprefix))
@ -88,9 +89,16 @@ def getVersionPrefix(sourcebranch):
splits2 = re.split(r'(\d+)', sourcebranch)
splits = []
hasdot = False
for split in splits2:
if split.isdigit():
splits.append(split)
if split == ".":
hasdot = True
if not hasdot:
print("Source branch name has not dots in it (eg. 1.9.2). Defaulting to: {0}".format(thirdpartyversionprefix))
return thirdpartyversionprefix
versionprefix = ""
if len(splits) < 1: