Bug 1377216 - Use substs for resolving path to Mercurial and Git; r?glandium draft
authorGregory Szorc <gps@mozilla.com>
Fri, 14 Jul 2017 17:23:34 -0700
changeset 610967 8807cfeb4b965e96b17c8e0cff6891c8128df83d
parent 610966 f8f2b26d11f0c6f5058620adc8b3f2633a8448fd
child 610968 aaa698f9e58441d2a718732e7a97535f72f26a36
push id69070
push userbmo:gps@mozilla.com
push dateWed, 19 Jul 2017 01:11:03 +0000
reviewersglandium
bugs1377216
milestone56.0a1
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
@@ -1623,34 +1623,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