Bug 1292407 - Make artifact install call git with cwd equal to topsrcdir, r=nalexander
MozReview-Commit-ID: 9clWaG40qSL
--- a/python/mozbuild/mozbuild/artifacts.py
+++ b/python/mozbuild/mozbuild/artifacts.py
@@ -829,21 +829,21 @@ class Artifacts(object):
return candidate_pushheads
def _get_hg_revisions_from_git(self):
rev_list = subprocess.check_output([
self._git, 'rev-list', '--topo-order',
'--max-count={num}'.format(num=NUM_REVISIONS_TO_QUERY),
'HEAD',
- ])
+ ], cwd=self._topsrcdir)
hg_hash_list = subprocess.check_output([
self._git, 'cinnabar', 'git2hg'
- ] + rev_list.splitlines())
+ ] + rev_list.splitlines(), cwd=self._topsrcdir)
zeroes = "0" * 40
hashes = []
for hg_hash in hg_hash_list.splitlines():
hg_hash = hg_hash.strip()
if not hg_hash or hg_hash == zeroes:
continue
@@ -997,22 +997,22 @@ class Artifacts(object):
def install_from_recent(self, distdir):
hg_pushheads = self._find_pushheads()
return self._install_from_hg_pushheads(hg_pushheads, distdir)
def install_from_revset(self, revset, distdir):
if self._hg:
revision = subprocess.check_output([self._hg, 'log', '--template', '{node}\n',
- '-r', revset]).strip()
+ '-r', revset], cwd=self._topsrcdir).strip()
if len(revision.split('\n')) != 1:
raise ValueError('hg revision specification must resolve to exactly one commit')
else:
- revision = subprocess.check_output([self._git, 'rev-parse', revset]).strip()
- revision = subprocess.check_output([self._git, 'cinnabar', 'git2hg', revision]).strip()
+ revision = subprocess.check_output([self._git, 'rev-parse', revset], cwd=self._topsrcdir).strip()
+ revision = subprocess.check_output([self._git, 'cinnabar', 'git2hg', revision], cwd=self._topsrcdir).strip()
if len(revision.split('\n')) != 1:
raise ValueError('hg revision specification must resolve to exactly one commit')
if revision == "0" * 40:
raise ValueError('git revision specification must resolve to a commit known to hg')
self.log(logging.INFO, 'artifact',
{'revset': revset,
'revision': revision},