Bug 1415621: Refactor checking out vcs repos in taskcluster mozharness builds. r=dustin
authorTom Prince <mozilla@hocat.ca>
Thu, 26 Oct 2017 12:03:23 -0600
changeset 391034 0489e522ece134137434a449539228dad4849678
parent 391033 c60bbbbc53d3b798cec0b578ea3c4b7e41f720bd
child 391035 9dcac9671005e62e7cb6608cdeb39c7b611f1c09
push id32859
push userebalazs@mozilla.com
push dateFri, 10 Nov 2017 09:52:02 +0000
treeherdermozilla-central@e9814434b1a9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdustin
bugs1415621
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1415621: Refactor checking out vcs repos in taskcluster mozharness builds. r=dustin MozReview-Commit-ID: LyZ5bmEleoW
taskcluster/taskgraph/transforms/job/mozharness.py
--- a/taskcluster/taskgraph/transforms/job/mozharness.py
+++ b/taskcluster/taskgraph/transforms/job/mozharness.py
@@ -243,24 +243,35 @@ def mozharness_on_generic_worker(config,
 
     for option in run.get('options', []):
         assert ' ' not in option
         mh_command.append('--' + option)
     if run.get('custom-build-variant-cfg'):
         mh_command.append('--custom-build-variant')
         mh_command.append(run['custom-build-variant-cfg'])
 
-    hg_command = ['"c:\\Program Files\\Mercurial\\hg.exe"']
-    hg_command.append('robustcheckout')
-    hg_command.extend(['--sharebase', 'y:\\hg-shared'])
-    hg_command.append('--purge')
-    hg_command.extend(['--upstream', 'https://hg.mozilla.org/mozilla-unified'])
-    hg_command.extend(['--revision', env['GECKO_HEAD_REV']])
-    hg_command.append(env['GECKO_HEAD_REPOSITORY'])
-    hg_command.append('.\\build\\src')
+    def checkout_repo(base_repo, head_repo, head_rev, path):
+        hg_command = ['"c:\\Program Files\\Mercurial\\hg.exe"']
+        hg_command.append('robustcheckout')
+        hg_command.extend(['--sharebase', 'y:\\hg-shared'])
+        hg_command.append('--purge')
+        hg_command.extend(['--upstream', base_repo])
+        hg_command.extend(['--revision', head_rev])
+        hg_command.append(head_repo)
+        hg_command.append(path)
+
+        return [
+            ' '.join(hg_command),
+        ]
+
+    hg_commands = checkout_repo(
+        base_repo=env['GECKO_BASE_REPOSITORY'],
+        head_repo=env['GECKO_HEAD_REPOSITORY'],
+        head_rev=env['GECKO_HEAD_REV'],
+        path='.\\build\\src')
 
     worker['command'] = []
     if taskdesc.get('needs-sccache'):
         worker['command'].extend([
             # Make the comment part of the first command, as it will help users to
             # understand what is going on, and why these steps are implemented.
             dedent('''\
             :: sccache currently uses the full compiler commandline as input to the
@@ -268,18 +279,18 @@ def mozharness_on_generic_worker(config,
             :: the symlink dir to get consistent paths.
             if exist z:\\build rmdir z:\\build'''),
             r'mklink /d z:\build %cd%',
             # Grant delete permission on the link to everyone.
             r'icacls z:\build /grant *S-1-1-0:D /L',
             r'cd /d z:\build',
         ])
 
+    worker['command'].extend(hg_commands)
     worker['command'].extend([
-        ' '.join(hg_command),
         ' '.join(mh_command)
     ])
 
 
 @run_job_using('buildbot-bridge', 'mozharness', schema=mozharness_run_schema)
 def mozharness_on_buildbot_bridge(config, job, taskdesc):
     run = job['run']
     worker = taskdesc['worker']