2022-02-02 15:09:37 -05:00
|
|
|
--- a/python/mozboot/mozboot/bootstrap.py
|
|
|
|
+++ b/python/mozboot/mozboot/bootstrap.py
|
2022-03-30 09:17:30 -05:00
|
|
|
@@ -548,11 +548,9 @@ def current_firefox_checkout(env, hg: Optional[Path] = None):
|
|
|
|
|
|
|
|
if not len(path.parents):
|
2022-02-02 15:09:37 -05:00
|
|
|
break
|
2022-03-30 09:17:30 -05:00
|
|
|
+ path = path.parent
|
2022-02-02 15:09:37 -05:00
|
|
|
|
|
|
|
- raise UserError(
|
|
|
|
- "Could not identify the root directory of your checkout! "
|
|
|
|
- "Are you running `mach bootstrap` in an hg or git clone?"
|
|
|
|
- )
|
2022-03-30 09:17:30 -05:00
|
|
|
+ return ("local", Path.cwd())
|
2022-02-02 15:09:37 -05:00
|
|
|
|
|
|
|
|
2022-03-30 09:17:30 -05:00
|
|
|
def update_git_tools(git: Optional[Path], root_state_dir: Path):
|
2022-02-02 15:09:37 -05:00
|
|
|
--- a/python/mozversioncontrol/mozversioncontrol/__init__.py
|
|
|
|
+++ b/python/mozversioncontrol/mozversioncontrol/__init__.py
|
2022-03-30 09:17:30 -05:00
|
|
|
@@ -684,6 +684,29 @@ class GitRepository(Repository):
|
2022-02-02 15:09:37 -05:00
|
|
|
self._run("config", name, value)
|
|
|
|
|
|
|
|
|
|
|
|
+class LocalRepository(Repository):
|
|
|
|
+
|
|
|
|
+ def __init__(self, path):
|
|
|
|
+ super(LocalRepository, self).__init__(path, tool="true")
|
|
|
|
+
|
|
|
|
+ @property
|
|
|
|
+ def head_ref(self):
|
|
|
|
+ return ""
|
|
|
|
+
|
2022-02-11 13:49:05 -05:00
|
|
|
+ def get_outgoing_files(self):
|
|
|
|
+ return []
|
|
|
|
+
|
|
|
|
+ def get_changed_files(self):
|
|
|
|
+ return []
|
|
|
|
+
|
2022-02-02 15:09:37 -05:00
|
|
|
+ def get_tracked_files_finder(self):
|
2022-02-11 13:49:05 -05:00
|
|
|
+ files = [os.path.relpath(os.path.join(dp, f), self.path).replace("\\","/") for dp, dn, fn in os.walk(self.path) for f in fn]
|
2022-02-02 15:09:37 -05:00
|
|
|
+ files.sort()
|
|
|
|
+ return FileListFinder(files)
|
|
|
|
+
|
|
|
|
+
|
2022-03-30 09:17:30 -05:00
|
|
|
+
|
|
|
|
+
|
|
|
|
def get_repository_object(path: Optional[Union[str, Path]], hg="hg", git="git"):
|
2022-02-02 15:09:37 -05:00
|
|
|
"""Get a repository object for the repository at `path`.
|
|
|
|
If `path` is not a known VCS repository, raise an exception.
|
2022-03-30 09:17:30 -05:00
|
|
|
@@ -697,7 +720,7 @@ def get_repository_object(path: Optional[Union[str, Path]], hg="hg", git="git"):
|
|
|
|
elif (path / ".git").exists():
|
2022-02-02 15:09:37 -05:00
|
|
|
return GitRepository(path, git=git)
|
|
|
|
else:
|
2022-03-30 09:17:30 -05:00
|
|
|
- raise InvalidRepoPath(f"Unknown VCS, or not a source checkout: {path}")
|
2022-02-02 15:09:37 -05:00
|
|
|
+ return LocalRepository(path)
|
|
|
|
|
|
|
|
|
|
|
|
def get_repository_from_build_config(config):
|
2022-03-30 09:17:30 -05:00
|
|
|
@@ -721,6 +744,8 @@ def get_repository_from_build_config(config):
|
|
|
|
return HgRepository(Path(config.topsrcdir), hg=config.substs["HG"])
|
2022-02-02 15:09:37 -05:00
|
|
|
elif flavor == "git":
|
2022-03-30 09:17:30 -05:00
|
|
|
return GitRepository(Path(config.topsrcdir), git=config.substs["GIT"])
|
2022-02-02 15:09:37 -05:00
|
|
|
+ elif flavor == "local":
|
|
|
|
+ return LocalRepository(config.topsrcdir)
|
|
|
|
else:
|
|
|
|
raise MissingVCSInfo("unknown VCS_CHECKOUT_TYPE value: %s" % flavor)
|
|
|
|
|