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

--HG--
extra : rebase_source : bc51087bcb9f2a723e27f240dd06a88540f6d8a8
This commit is contained in:
Gregory Szorc 2017-07-14 17:23:34 -07:00
Родитель 4ed711f732
Коммит ab7253fb0b
1 изменённых файлов: 2 добавлений и 10 удалений

Просмотреть файл

@ -1629,24 +1629,16 @@ class PackageFrontend(MachCommandBase):
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,