• Home
  • Raw
  • Download

Lines Matching +full:- +full:- +full:workdir

3 # Use of this source code is governed by a BSD-style license that can be
10 $ get_patch.py -s HEAD p:74791
12 $ get_patch.py -s 82e851a407c5 p:74791 47413bb27
13 # Use another llvm-project dir.
14 $ get_patch.py -s HEAD -l ~/llvm-project 47413bb27
35 CHROMIUMOS_OVERLAY_PATH = Path("src/third_party/chromiumos-overlay")
36 LLVM_PKG_PATH = CHROMIUMOS_OVERLAY_PATH / "sys-devel/llvm"
37 COMPILER_RT_PKG_PATH = CHROMIUMOS_OVERLAY_PATH / "sys-libs/compiler-rt"
38 LIBCXX_PKG_PATH = CHROMIUMOS_OVERLAY_PATH / "sys-libs/libcxx"
39 LIBUNWIND_PKG_PATH = CHROMIUMOS_OVERLAY_PATH / "sys-libs/llvm-libunwind"
40 SCUDO_PKG_PATH = CHROMIUMOS_OVERLAY_PATH / "sys-libs/scudo"
41 LLDB_PKG_PATH = CHROMIUMOS_OVERLAY_PATH / "dev-util/lldb-server"
43 LLVM_PROJECT_PATH = Path("src/third_party/llvm-project")
48 """ValueError for a cherry-pick has been seen before."""
52 """ValueError that highlights the cherry-pick is before the start_ref."""
63 def from_rev(cls, llvm_dir: Path, rev: git_llvm_rev.Rev) -> "LLVMGitRef":
71 def to_rev(self, llvm_dir: Path) -> git_llvm_rev.Rev:
100 ) -> None:
105 the respective <pkg>/files/ workdir for each applicable
118 ) -> None:
122 workdir_mappings[pe.workdir] = workdir_mappings.get(
123 pe.workdir, []
125 for workdir, pes in workdir_mappings.items():
126 patches_json_file = workdir / PATCH_METADATA_FILENAME
127 with patches_json_file.open(encoding="utf-8") as f:
130 workdir, orig_contents
135 patches_json_file, encoding="utf-8"
146 ) -> List[patch_utils.PatchEntry]:
155 the respective <pkg>/files/ workdir for each applicable
175 ) -> List[patch_utils.PatchEntry]:
180 for workdir in self._workdirs_for_packages(packages):
182 if (workdir / "cherry").is_dir():
193 workdir=workdir,
225 ) -> List[patch_utils.PatchEntry]:
231 for workdir in self._workdirs_for_packages(packages):
233 workdir=workdir,
257 def _workdirs_for_packages(self, packages: Iterable[Path]) -> List[Path]:
260 def is_patch_applied(self, to_check: patch_utils.PatchEntry) -> bool:
262 patches_json_file = to_check.workdir / PATCH_METADATA_FILENAME
263 with patches_json_file.open(encoding="utf-8") as f:
265 to_check.workdir, f
273 ) -> bool:
280 def get_commit_subj(git_root_dir: Path, ref: str) -> str:
284 ["git", "show", "-s", "--format=%s", ref],
286 encoding="utf-8",
290 logging.debug(" -> %s", subj)
294 def git_format_patch(git_root_dir: Path, ref: str) -> str:
306 ["git", "format-patch", "--stdout", f"{ref}^..{ref}"],
308 encoding="utf-8",
319 def get_llvm_github_pull(pull_number: int) -> Dict[str, Any]:
330 f"https://api.github.com/repos/llvm/llvm-project/pulls/{pull_number}"
337 "X-GitHub-Api-Version": "2022-11-28",
346 response = f.read().decode("utf-8")
357 ) -> None:
363 llvm_project_dir: Path to llvm-project git directory.
379 def full_title(self) -> str:
383 def full_title_cleaned(self) -> str:
384 return re.sub(r"\W", "-", self.full_title)
386 def git_squash_chain_patch(self) -> Tuple[str, Set[Path]]:
399 tmpbranch_name = f"squash-branch-{idx}"
405 # dir will be non-empty.
407 with commit_message_file.open("w", encoding="utf-8") as f:
431 "-b",
440 ["git", "merge", "--squash", self.head_ref], worktree_dir
446 "-a",
447 "-F",
466 ["git", "branch", "-D", tmpbranch_name],
471 def _fetch(self) -> None:
489 ) -> subprocess.CompletedProcess:
496 encoding="utf-8",
503 ) -> Set[Path]:
507 llvm_project_dir: Path to llvm-project
524 ["git", "diff", "--name-only", f"{ref_from}..{ref_to}"],
526 encoding="utf-8",
536 if changed_path.startswith("compiler-rt"):
551 def _has_repo_child(path: Path) -> bool:
562 ) -> Optional[Path]:
563 """Find the root of the chromiumos source tree from the current workdir.
579 def _write_patch(title: str, contents: str, path: Path) -> None:
583 path.write_text(contents, encoding="utf-8")
588 ) -> List[Union[LLVMGitRef, LLVMPullRequest]]:
610 def parse_args() -> argparse.Namespace:
619 "-c",
620 "--chromiumos-root",
626 "-l",
627 "--llvm",
633 "-s",
634 "--start-ref",
640 "-p",
641 "--platform",
650 "--dry-run",
652 help="Run normally, but don't make any changes. Read-only mode.",
655 "-v",
656 "--verbose",
686 "Could not autodetect chromiumos root. Use '-c' to pass the "
695 "Could not autodetect llvm-project dir. Use '-l' to pass the "
696 "llvm-project directly"
701 def main() -> None: