Lines Matching +full:stable +full:- +full:branch
3 # Use of this source code is governed by a BSD-style license that can be
28 "https://chromium.googlesource.com/external/github.com/llvm/llvm-project"
33 "google3-unstable",
35 "llvm-next",
40 def GetVersionFrom(src_dir: Union[Path, str], git_hash: str) -> int:
41 """Obtain an SVN-style version number based on the LLVM git hash passed in.
48 An SVN-style version number associated with the git hash.
55 assert version.branch == git_llvm_rev.MAIN_BRANCH, version.branch
59 def GetGitHashFrom(src_dir: Union[Path, str], version: int) -> str:
75 git_llvm_rev.Rev(branch=git_llvm_rev.MAIN_BRANCH, number=version),
79 def CheckoutBranch(src_dir: Union[Path, str], branch: str) -> None:
80 """Checks out and pulls from a branch in a git repo.
84 branch: The git branch to checkout in src_dir.
87 ValueError: Failed to checkout or pull branch version
89 subprocess_helpers.CheckCommand(["git", "-C", src_dir, "checkout", branch])
90 subprocess_helpers.CheckCommand(["git", "-C", src_dir, "pull"])
93 def ParseLLVMMajorVersion(cmakelist: str) -> Optional[str]:
111 def GetLLVMMajorVersion(git_hash: Optional[str] = None) -> str:
140 ["git", "-C", src_dir, "checkout", git_hash]
146 file_contents = path.read_text(encoding="utf-8")
160 def CreateTempLLVMRepo(temp_dir: str) -> Iterator[str]:
164 '../toolchain-utils/llvm_tools/llvm-project-copy' should not be modified.
167 modify the actual LLVM source tree in 'llvm-project-copy'.
185 "-C",
189 "--detach",
202 "-C",
206 "-f",
212 def GetAndUpdateLLVMProjectInLLVMTools() -> str:
213 """Gets the absolute path to 'llvm-project-copy' directory in 'llvm_tools'.
217 in '../toolchain-utils/llvm_tools' called 'llvm-project-copy' if this
219 LLVMHash() class to clone the LLVM repo into 'llvm-project-copy'.
222 absolute path to 'llvm-project-copy' directory.
225 Absolute path to 'llvm-project-copy' directory in 'llvm_tools'
228 ValueError: LLVM repo (in 'llvm-project-copy' dir.) has changes or
236 abs_path_to_llvm_tools_dir, "llvm-project-copy"
250 # `git status` has a '-s'/'--short' option that shortens the output.
251 # With the '-s' option, if no changes were made to the LLVM repo, then
254 ["git", "-C", abs_path_to_llvm_project_dir, "status", "-s"]
268 def GetGoogle3LLVMVersion(stable: bool) -> int:
272 stable: boolean, use the stable version or the unstable version
282 subdir = "stable" if stable else "llvm_unstable"
303 def IsSvnOption(svn_option: str) -> Union[int, str]:
338 ) -> Tuple[str, int]:
359 assert svn_option in ("google3", "google3-unstable")
360 version = GetGoogle3LLVMVersion(stable=svn_option == "google3")
367 def GetCrOSCurrentLLVMHash(chromeos_tree: Path) -> str:
387 def CreateTempDirectory() -> Iterator:
396 def CloneLLVMRepo(self, temp_dir: str) -> None:
415 def GetLLVMHash(self, version: int) -> str:
429 def GetCrOSCurrentLLVMHash(self, chromeos_tree: Path) -> str:
433 def GetCrOSLLVMNextHash(self) -> str:
434 """Retrieves the current ChromeOS llvm-next hash."""
437 def GetGoogle3LLVMHash(self) -> str:
439 return self.GetLLVMHash(GetGoogle3LLVMVersion(stable=True))
441 def GetGoogle3UnstableLLVMHash(self) -> str:
443 return self.GetLLVMHash(GetGoogle3LLVMVersion(stable=False))
445 def GetTopOfTrunkGitHash(self) -> str:
450 ["git", "ls-remote", _LLVM_GIT_URL, path_to_main_branch]
455 def main() -> None:
463 # Create parser and add optional command-line arguments.
466 "--llvm_version",
473 "--chromeos_tree",
482 # Parse command-line arguments.
500 elif cur_llvm_version == "llvm-next":
504 elif cur_llvm_version == "google3-unstable":