mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1853252 - Allow running mach bootstrap
from more subdirs r=ahochheiden
Differential Revision: https://phabricator.services.mozilla.com/D188302
This commit is contained in:
parent
220a4897ba
commit
422ae077bf
@ -600,7 +600,7 @@ def current_firefox_checkout(env, hg: Optional[Path] = None):
|
||||
while path:
|
||||
hg_dir = path / ".hg"
|
||||
git_dir = path / ".git"
|
||||
moz_configure = path / "moz.configure"
|
||||
known_file = path / "config" / "milestone.txt"
|
||||
if hg and hg_dir.exists():
|
||||
# Verify the hg repo is a Firefox repo by looking at rev 0.
|
||||
try:
|
||||
@ -622,11 +622,10 @@ def current_firefox_checkout(env, hg: Optional[Path] = None):
|
||||
# foot-shootings. Determining a canonical git checkout of mozilla-unified
|
||||
# is...complicated
|
||||
elif git_dir.exists() or hg_dir.exists():
|
||||
moz_configure = path / "moz.configure"
|
||||
if moz_configure.exists():
|
||||
if known_file.exists():
|
||||
_warn_if_risky_revision(path)
|
||||
return ("git" if git_dir.exists() else "hg"), path
|
||||
elif moz_configure.exists():
|
||||
elif known_file.exists():
|
||||
return "SOURCE", path
|
||||
|
||||
if not len(path.parents):
|
||||
|
@ -892,7 +892,7 @@ def get_repository_object(
|
||||
return HgRepository(path, hg=hg)
|
||||
elif (path / ".git").exists():
|
||||
return GitRepository(path, git=git)
|
||||
elif (path / "moz.configure").exists():
|
||||
elif (path / "config" / "milestone.txt").exists():
|
||||
return SrcRepository(path, src=src)
|
||||
else:
|
||||
raise InvalidRepoPath(f"Unknown VCS, or not a source checkout: {path}")
|
||||
|
Loading…
Reference in New Issue
Block a user