From 0a426549477b3ee19e31012526458e0ffd0b4141 Mon Sep 17 00:00:00 2001 From: Mihai Tabara Date: Fri, 10 Mar 2017 23:24:12 +0000 Subject: [PATCH] Bug 1344229 - alter version bumping to prevent race conditions. r=rail a=release DONTBUILD MozReview-Commit-ID: Fy38tKghu2M --HG-- extra : rebase_source : b6cd22a15bfe2dc874940089f1cd49b320cf18b3 --- .../scripts/release/postrelease_version_bump.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/testing/mozharness/scripts/release/postrelease_version_bump.py b/testing/mozharness/scripts/release/postrelease_version_bump.py index 771714c82c33..834355f26dd4 100644 --- a/testing/mozharness/scripts/release/postrelease_version_bump.py +++ b/testing/mozharness/scripts/release/postrelease_version_bump.py @@ -158,10 +158,17 @@ class PostReleaseVersionBump(MercurialScript, BuildbotMixin, """Bump version""" dirs = self.query_abs_dirs() for f in self.config["version_files"]: - curr_version = ".".join( - self.get_version(dirs['abs_gecko_dir'], f["file"])) - self.replace(os.path.join(dirs['abs_gecko_dir'], f["file"]), - curr_version, self.config["next_version"]) + curr_version = self.get_version(dirs['abs_gecko_dir'], f["file"]) + next_version = self.config['next_version'].split('.') + + if next_version <= curr_version: + self.warning("Version bumping skipped due to conflicting values") + continue + else: + curr_version = ".".join(curr_version) + next_version = ".".join(next_version) + self.replace(os.path.join(dirs['abs_gecko_dir'], f["file"]), + curr_version, self.config["next_version"]) def tag(self): dirs = self.query_abs_dirs()