From 6c19cf7d1946564d15d7a6b441ef0502009f5b21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malte=20J=C3=BCrgens?= Date: Sun, 10 Apr 2022 16:08:21 +0200 Subject: [PATCH] fix bootstrap patch (again :) ) --- patches/bootstrap-without-vcs.patch | 39 +++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/patches/bootstrap-without-vcs.patch b/patches/bootstrap-without-vcs.patch index f29ce0f..92bfa99 100644 --- a/patches/bootstrap-without-vcs.patch +++ b/patches/bootstrap-without-vcs.patch @@ -64,3 +64,42 @@ else: raise MissingVCSInfo("unknown VCS_CHECKOUT_TYPE value: %s" % flavor) +--- a/third_party/python/taskcluster_taskgraph/taskgraph/util/vcs.py ++++ b/third_party/python/taskcluster_taskgraph/taskgraph/util/vcs.py +@@ -168,6 +168,27 @@ class GitRepository(Repository): + self.run("checkout", ref) + + ++class LocalRepository(Repository): ++ ++ def __init__(self, path): ++ super(LocalRepository, self).__init__(path, tool="true") ++ ++ @property ++ def head_ref(self): ++ return "" ++ ++ def get_outgoing_files(self): ++ return [] ++ ++ def get_changed_files(self): ++ return [] ++ ++ def get_tracked_files_finder(self): ++ 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] ++ files.sort() ++ return FileListFinder(files) ++ ++ + def get_repository(path): + """Get a repository object for the repository at `path`. + If `path` is not a known VCS repository, raise an exception. +@@ -178,7 +199,7 @@ def get_repository(path): + elif os.path.exists(os.path.join(path, ".git")): + return GitRepository(path) + +- raise RuntimeError("Current directory is neither a git or hg repository") ++ return LocalRepository(path) + + + def find_hg_revision_push_info(repository, revision):