Bug 1342959 - Update merge day scripts after esr52 meges r=jlund DONTBUILD
MozReview-Commit-ID: AD8VTO6C9mU
--- a/testing/mozharness/configs/merge_day/release_to_esr.py
+++ b/testing/mozharness/configs/merge_day/release_to_esr.py
@@ -1,14 +1,15 @@
import os
ABS_WORK_DIR = os.path.join(os.getcwd(), "build")
-NEW_ESR_REPO = "ssh://hg.mozilla.org/releases/mozilla-esr52"
-OLD_ESR_REPO = "https://hg.mozilla.org/releases/mozilla-esr45"
-OLD_ESR_CHANGESET = "d2d75f526882"
+NEW_ESR_REPO = "ssh://hg.mozilla.org/releases/mozilla-esr59"
+# ESR-specific branding (logo) lives in the old repo:
+OLD_ESR_REPO = "https://hg.mozilla.org/releases/mozilla-esr52"
+OLD_ESR_CHANGESET = "df0931ac8b02"
config = {
"log_name": "relese_to_esr",
"version_files": [
{"file": "browser/config/version.txt", "suffix": ""},
{"file": "browser/config/version_display.txt", "suffix": ""},
{"file": "config/milestone.txt", "suffix": ""},
],
@@ -36,19 +37,17 @@ config = {
"vcs_share_base": os.path.join(ABS_WORK_DIR, 'hg-shared'),
# "hg_share_base": None,
"tools_repo_url": "https://hg.mozilla.org/build/tools",
"tools_repo_branch": "default",
"from_repo_url": "ssh://hg.mozilla.org/releases/mozilla-release",
"to_repo_url": NEW_ESR_REPO,
"base_tag": "FIREFOX_ESR_%(major_version)s_BASE",
- "end_tag": "FIREFOX_ESR_%(major_version)s_END",
-
"migration_behavior": "release_to_esr",
"require_remove_locales": False,
- "transplant_patches": [
+ "graft_patches": [
{"repo": OLD_ESR_REPO,
"changeset": OLD_ESR_CHANGESET},
],
"requires_head_merge": False,
- "pull_all_branches": True,
+ "pull_all_branches": False,
}
rename from testing/mozharness/mozharness/mozilla/repo_manupulation.py
rename to testing/mozharness/mozharness/mozilla/repo_manipulation.py
--- a/testing/mozharness/scripts/merge_day/gecko_migration.py
+++ b/testing/mozharness/scripts/merge_day/gecko_migration.py
@@ -25,17 +25,17 @@ from getpass import getpass
sys.path.insert(1, os.path.dirname(os.path.dirname(sys.path[0])))
from mozharness.base.errors import HgErrorList
from mozharness.base.python import VirtualenvMixin, virtualenv_config_options
from mozharness.base.vcs.vcsbase import MercurialScript
from mozharness.mozilla.selfserve import SelfServeMixin
from mozharness.mozilla.updates.balrog import BalrogMixin
from mozharness.mozilla.buildbot import BuildbotMixin
-from mozharness.mozilla.repo_manupulation import MercurialRepoManipulationMixin
+from mozharness.mozilla.repo_manipulation import MercurialRepoManipulationMixin
VALID_MIGRATION_BEHAVIORS = (
"beta_to_release", "aurora_to_beta", "central_to_aurora", "release_to_esr",
"bump_second_digit",
)
# GeckoMigration {{{1
@@ -387,42 +387,48 @@ class GeckoMigration(MercurialScript, Ba
os.path.join(dirs['abs_to_dir'], "browser/locales/shipped-locales"),
self.config['remove_locales']
)
self.touch_clobber_file(dirs['abs_to_dir'])
def release_to_esr(self, *args, **kwargs):
""" mozilla-release -> mozilla-esrNN behavior. """
dirs = self.query_abs_dirs()
- for to_transplant in self.config.get("transplant_patches", []):
- self.transplant(repo=to_transplant["repo"],
- changeset=to_transplant["changeset"],
- cwd=dirs['abs_to_dir'])
+ for to_graft in self.config.get("graft_patches", []):
+ self.graft(repo=to_graft["repo"], changeset=to_graft["changeset"],
+ cwd=dirs['abs_to_dir'])
self.apply_replacements()
self.touch_clobber_file(dirs['abs_to_dir'])
def apply_replacements(self):
dirs = self.query_abs_dirs()
for f, from_, to in self.config["replacements"]:
self.replace(os.path.join(dirs['abs_to_dir'], f), from_, to)
- def transplant(self, repo, changeset, cwd):
- """Transplant a Mercurial changeset from a remote repository."""
+ def graft(self, repo, changeset, cwd):
+ """Graft a Mercurial changeset from a remote repository."""
hg = self.query_exe("hg", return_type="list")
- cmd = hg + ["--config", "extensions.transplant=", "transplant",
- "--source", repo, changeset]
- self.info("Transplanting %s from %s" % (changeset, repo))
+ self.info("Pulling %s from %s" % (changeset, repo))
+ pull_cmd = hg + ["pull", "-r", changeset, repo]
+ status = self.run_command(
+ pull_cmd,
+ cwd=cwd,
+ error_list=HgErrorList,
+ )
+ if status != 0:
+ self.fatal("Cannot pull %s from %s properly" % (changeset, repo))
+ cmd = hg + ["graft", changeset]
+ self.info("Grafting %s from %s" % (changeset, repo))
status = self.run_command(
cmd,
cwd=cwd,
error_list=HgErrorList,
)
if status != 0:
- self.fatal("Cannot transplant %s from %s properly" %
- (changeset, repo))
+ self.fatal("Cannot graft %s from %s properly" % (changeset, repo))
def pull_from_repo(self, from_dir, to_dir, revision=None, branch=None):
""" Pull from one repo to another. """
hg = self.query_exe("hg", return_type="list")
cmd = hg + ["pull"]
if revision:
cmd.extend(["-r", revision])
cmd.append(from_dir)
@@ -479,17 +485,16 @@ class GeckoMigration(MercurialScript, Ba
""" Perform the migration.
"""
dirs = self.query_abs_dirs()
from_fx_major_version = self.get_version(dirs['abs_from_dir'])[0]
to_fx_major_version = self.get_version(dirs['abs_to_dir'])[0]
base_from_rev = self.query_from_revision()
base_to_rev = self.query_to_revision()
base_tag = self.config['base_tag'] % {'major_version': from_fx_major_version}
- end_tag = self.config['end_tag'] % {'major_version': to_fx_major_version}
self.hg_tag(
dirs['abs_from_dir'], base_tag, user=self.config['hg_user'],
revision=base_from_rev,
)
new_from_rev = self.query_from_revision()
self.info("New revision %s" % new_from_rev)
pull_revision = None
if not self.config.get("pull_all_branches"):
@@ -499,20 +504,24 @@ class GeckoMigration(MercurialScript, Ba
revision=pull_revision,
branch="default",
)
if self.config.get("requires_head_merge") is not False:
self.hg_merge_via_debugsetparents(
dirs['abs_to_dir'], old_head=base_to_rev, new_head=new_from_rev,
user=self.config['hg_user'],
)
- self.hg_tag(
- dirs['abs_to_dir'], end_tag, user=self.config['hg_user'],
- revision=base_to_rev, force=True,
- )
+
+ end_tag = self.config.get('end_tag')
+ if end_tag:
+ end_tag = end_tag % {'major_version': to_fx_major_version}
+ self.hg_tag(
+ dirs['abs_to_dir'], end_tag, user=self.config['hg_user'],
+ revision=base_to_rev, force=True,
+ )
# Call beta_to_release etc.
if not hasattr(self, self.config['migration_behavior']):
self.fatal("Don't know how to proceed with migration_behavior %s !" % self.config['migration_behavior'])
getattr(self, self.config['migration_behavior'])(end_tag=end_tag)
self.info("Verify the diff, and apply any manual changes, such as disabling features, and --commit-changes")
def trigger_builders(self):
"""Triggers builders that should be run directly after a merge.
--- a/testing/mozharness/scripts/release/postrelease_version_bump.py
+++ b/testing/mozharness/scripts/release/postrelease_version_bump.py
@@ -11,17 +11,17 @@ A script to increase in-tree version num
"""
import os
import sys
sys.path.insert(1, os.path.dirname(os.path.dirname(sys.path[0])))
from mozharness.base.vcs.vcsbase import MercurialScript
from mozharness.mozilla.buildbot import BuildbotMixin
-from mozharness.mozilla.repo_manupulation import MercurialRepoManipulationMixin
+from mozharness.mozilla.repo_manipulation import MercurialRepoManipulationMixin
# PostReleaseVersionBump {{{1
class PostReleaseVersionBump(MercurialScript, BuildbotMixin,
MercurialRepoManipulationMixin):
config_options = [
[['--hg-user', ], {
"action": "store",
--- a/testing/mozharness/scripts/release/updates.py
+++ b/testing/mozharness/scripts/release/updates.py
@@ -19,17 +19,17 @@ information to Balrog.
import os
import re
import sys
sys.path.insert(1, os.path.dirname(os.path.dirname(sys.path[0])))
from mozharness.base.vcs.vcsbase import MercurialScript
from mozharness.mozilla.buildbot import BuildbotMixin
-from mozharness.mozilla.repo_manupulation import MercurialRepoManipulationMixin
+from mozharness.mozilla.repo_manipulation import MercurialRepoManipulationMixin
from mozharness.mozilla.release import get_previous_version
# UpdatesBumper {{{1
class UpdatesBumper(MercurialScript, BuildbotMixin,
MercurialRepoManipulationMixin):
config_options = [
[['--hg-user', ], {