Bug 1276298 - adjust bump version for esr r=jlund draft
authorRail Aliiev <rail@mozilla.com>
Fri, 27 May 2016 13:10:14 -0400
changeset 6916 8e93e62c7d81d8daf09664f06591f7af55113d37
parent 6914 9ffe0bea224a35861ed85531dd03ac683d0801b6
push id75
push userbmo:rail@mozilla.com
push dateFri, 27 May 2016 17:10:46 +0000
reviewersjlund
bugs1276298
Bug 1276298 - adjust bump version for esr r=jlund MozReview-Commit-ID: jzxcNSCFt6
lib/python/kickoff/__init__.py
--- a/lib/python/kickoff/__init__.py
+++ b/lib/python/kickoff/__init__.py
@@ -194,28 +194,46 @@ def get_en_US_config(index, product, bra
     return {
         "platforms": platform_configs,
     }
 
 
 # FIXME: the following function should be removed and we should use
 # next_version provided by ship-it
 def bump_version(version):
-    """Bump last digit"""
+    """Bump last digit
+
+    >>> bump_version("45.0")
+    '45.0.1'
+    >>> bump_version("45.0.1")
+    '45.0.2'
+    >>> bump_version("45.0b3")
+    '45.0b4'
+    >>> bump_version("45.0esr")
+    '45.0.1esr'
+    >>> bump_version("45.0.1esr")
+    '45.0.2esr'
+    >>> bump_version("45.2.1esr")
+    '45.2.2esr'
+    """
     split_by = "."
     digit_index = 2
+    suffix = ""
     if "b" in version:
         split_by = "b"
         digit_index = 1
+    if "esr" in version:
+        version = version.replace("esr", "")
+        suffix = "esr"
     v = version.split(split_by)
     if len(v) < digit_index + 1:
         # 45.0 is 45.0.0 actually
         v.append("0")
     v[-1] = str(int(v[-1]) + 1)
-    return split_by.join(v)
+    return split_by.join(v) + suffix
 
 
 def make_task_graph_strict_kwargs(appVersion, balrog_api_root, balrog_password, balrog_username,
                                   beetmover_aws_access_key_id, beetmover_aws_secret_access_key,
                                   beetmover_candidates_bucket, bouncer_enabled, branch, buildNumber,
                                   build_tools_repo_path, checksums_enabled, en_US_config,
                                   extra_balrog_submitter_params, final_verify_channels,
                                   final_verify_platforms, funsize_balrog_api_root, l10n_config,