Prevent revision number going above 16 bits worth of integer

This commit is contained in:
Dan Hawkins 2018-10-29 16:52:36 +00:00
commit bc79cbfbee

View file

@ -25,6 +25,7 @@ __updated__ = '2017-11-29'
gitExecutable = os.getenv("GIT_EXECUTABLE", default="git")
slaveMachine = os.getenv("NODE_NAME", default="-")
MAXVERSIONNUMBER = 65535
def resetFolder(versionfolder):
print("Removing folders and contents of: {0}".format(versionfolder))
@ -48,7 +49,7 @@ def getGitRevision(gitrootpath, basenumber):
print("Command {0} returned: {1}".format(completed.args, completed.returncode))
changecount = completed.stdout.decode("utf-8").strip()
print("Change count: {0}".format(changecount))
adjustedchangecount = int(changecount) + int(basenumber)
adjustedchangecount = (int(changecount) + int(basenumber) % (MAXVERSIONNUMBER + 1))
print("Adjusted change count: {0}".format(adjustedchangecount))
print("Determining current revision info using git command: {0}".format(gitExecutable))