Bug 1184594 - git 'repo' is not deployed correctly on build machines managed by buildbot. r=hwine
☠☠ backed out by 3ae81f4458ef ☠ ☠
authorRail Aliiev <rail@mozilla.com>
Thu, 30 Jul 2015 08:24:58 -0400 (2015-07-30)
changeset 4297 57dde819edcb3fa6293fad3d213f91cdc938da37
parent 4296 d72df953784c6b73eb1319089c49556f38f5c146
child 4298 3ae81f4458ef1e76cc86f8c4500f52fd3d46682c
push id3429
push userraliiev@mozilla.com
push dateThu, 30 Jul 2015 12:25:03 +0000 (2015-07-30)
reviewershwine
bugs1184594
Bug 1184594 - git 'repo' is not deployed correctly on build machines managed by buildbot. r=hwine
mozharness/mozilla/building/buildb2gbase.py
--- a/mozharness/mozilla/building/buildb2gbase.py
+++ b/mozharness/mozilla/building/buildb2gbase.py
@@ -342,16 +342,21 @@ class B2GBuildBaseScript(BuildbotMixin, 
 
         # self.vcs_checkout already retries, so no need to wrap it in
         # self.retry. We set the error_level to ERROR to prevent it going fatal
         # so we can do our own handling here.
         retval = self.vcs_checkout_repos(repos, error_level=ERROR)
         if not retval:
             self.rmtree(repo_dir)
             self.fatal("Automation Error: couldn't clone repo", exit_code=4)
+        # Repo self-updates if the checkout is on a detached head. Creating a
+        # branch works around the problem.
+        git = self.query_exe("git")
+        self.run_command([git, 'checkout', '-B', 'tmp_moz_branch', repo_rev],
+                         cwd=repo_dir, halt_on_failure=True)
         return retval
 
     def checkout_tools(self):
         dirs = self.query_abs_dirs()
 
         # We need hg.m.o/build/tools checked out
         self.info("Checking out tools")
         repos = [{