Bug 1853252 - Allow running mach bootstrap from more subdirs r=ahochheiden

Differential Revision: https://phabricator.services.mozilla.com/D188302
This commit is contained in:
Steve Fink 2023-09-18 19:13:38 +00:00
parent 220a4897ba
commit 422ae077bf
2 changed files with 4 additions and 5 deletions

View File

@ -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):

View File

@ -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}")