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
--- 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