• Home
  • Raw
  • Download

Lines Matching +full:commits +full:-

2 # -*- coding: utf-8 -*-
4 # Use of this source code is governed by a BSD-style license that can be
29 def gentoo_sha_to_link(sha: str) -> str:
34 def send_email(subject: str, body: List[tiny_render.Piece]) -> None:
38 identifier="rust-watch",
39 well_known_recipients=["cros-team"],
53 def from_string(version_string: str) -> "RustReleaseVersion":
59 def __str__(self) -> str:
62 def to_json(self) -> str:
66 def from_json(s: str) -> "RustReleaseVersion":
80 def to_json(self) -> Dict[str, Any]:
87 def from_json(s: Dict[str, Any]) -> "State":
96 def parse_release_tags(lines: Iterable[str]) -> Iterable[RustReleaseVersion]:
97 """Parses `git ls-remote --tags` output into Rust stable release versions."""
112 if short_tag.startswith("0.") or short_tag.startswith("release-"):
117 def fetch_most_recent_release() -> RustReleaseVersion:
120 ["git", "ls-remote", "--tags", "https://github.com/rust-lang/rust"],
124 encoding="utf-8",
137 def update_git_repo(git_dir: pathlib.Path) -> None:
164 ) -> List[GitCommit]:
165 """Gets commits to dev-lang/rust since `most_recent_sha`.
167 Older commits come earlier in the returned list.
169 commits = subprocess.run(
173 "--format=%H %s",
175 "--",
176 "dev-lang/rust",
181 encoding="utf-8",
184 if commits.returncode:
186 "Error getting new gentoo commits; stderr:\n%s", commits.stderr
188 commits.check_returncode()
191 for line in commits.stdout.strip().splitlines():
195 # `git log` outputs things in newest -> oldest order.
200 def setup_gentoo_git_repo(git_dir: pathlib.Path) -> str:
214 ["git", "rev-parse", "HEAD"],
219 encoding="utf-8",
224 def read_state(state_file: pathlib.Path) -> State:
226 with state_file.open(encoding="utf-8") as f:
230 def atomically_write_state(state_file: pathlib.Path, state: State) -> None:
233 with temp_file.open("w", encoding="utf-8") as f:
238 def file_bug(title: str, body: str) -> None:
252 ) -> Optional[Tuple[str, str]]:
260 "Please see go/crostc-rust-rotation for who's turn it is."
267 ) -> Optional[Tuple[str, List[tiny_render.Piece]]]:
283 subject_pieces.append("new rust ebuild commits detected")
284 body_pieces.append("commits (newest first):")
300 subject = "[rust-watch] " + "; ".join(subject_pieces)
304 def main(argv: List[str]) -> None:
312 "--state_dir", required=True, help="Directory to store state in."
315 "--skip_side_effects",
320 "--skip_state_update",
328 gentoo_subdir = state_dir / "upstream-gentoo"
332 # Could be in a partially set-up state.
356 logging.info("Fetching new commits from Gentoo")
361 logging.info("New commits: %r", new_commits)
399 new_commits[-1].sha if new_commits else prior_state.last_gentoo_sha