Bug 1377216 - Use substs for resolving path to Mercurial and Git; r=glandium
authorGregory Szorc <gps@mozilla.com>
Fri, 14 Jul 2017 17:23:34 -0700
changeset 418769 63aee8db6c85d42fe562f0434f85d16691482803
parent 418768 c47a2cb229daabdfe5cfdc8ab6e7c0fec6be6a60
child 418770 fe76c2e3e5e69ba89c4440794bed8627defa609b
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1377216
milestone56.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 1377216 - Use substs for resolving path to Mercurial and Git; r=glandium We now store HG or GIT in substs. We don't need to search for binary paths. MozReview-Commit-ID: 8sSgPNLok9M
python/mozbuild/mozbuild/mach_commands.py
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -1624,34 +1624,26 @@ class PackageFrontend(MachCommandBase):
 
         '''
         pass
 
     def _make_artifacts(self, tree=None, job=None, skip_cache=False):
         state_dir = self._mach_context.state_dir
         cache_dir = os.path.join(state_dir, 'package-frontend')
 
-        import which
-
         here = os.path.abspath(os.path.dirname(__file__))
         build_obj = MozbuildObject.from_environment(cwd=here)
 
         hg = None
         if conditions.is_hg(build_obj):
-            if self._is_windows():
-                hg = which.which('hg.exe')
-            else:
-                hg = which.which('hg')
+            hg = build_obj.substs['HG']
 
         git = None
         if conditions.is_git(build_obj):
-            if self._is_windows():
-                git = which.which('git.exe')
-            else:
-                git = which.which('git')
+            git = build_obj.substs['GIT']
 
         from mozbuild.artifacts import Artifacts
         artifacts = Artifacts(tree, self.substs, self.defines, job,
                               log=self.log, cache_dir=cache_dir,
                               skip_cache=skip_cache, hg=hg, git=git,
                               topsrcdir=self.topsrcdir)
         return artifacts