Count each finished chunk's later fixes in score-outcomes and the routing figures

This commit is contained in:
2026-10-28 19:27:09 +01:00
parent f2149adc46
commit 1a81b55925
15 changed files with 630 additions and 101 deletions
+7 -7
View File
@@ -109,18 +109,18 @@ def commits_since(tag: str | None, branch: str, cwd: str | None = None) -> int |
return count if isinstance(count, Failure) else int(count)
def commit_exists(commit: str, cwd: str | None = None) -> bool:
return not isinstance(git("rev-parse", "--quiet", "--verify", f"{commit}^{{commit}}", cwd=cwd), Failure)
def commit_exists(commit: str, cwd: str | None = None, timeout: float | None = None, guarded: bool = False) -> bool:
return not isinstance(git("rev-parse", "--quiet", "--verify", f"{commit}^{{commit}}", cwd=cwd, timeout=timeout, guarded=guarded), Failure)
def file_at(revision: str, path: str, cwd: str | None = None) -> str | Failure:
"""A file's text at a revision, read in cwd, else in the current directory; empty where the revision is not a commit, such as a root commit's parent, or holds no such file."""
if not commit_exists(revision, cwd):
def file_at(revision: str, path: str, cwd: str | None = None, timeout: float | None = None, guarded: bool = False) -> str | Failure:
"""A file's text at a revision, read in cwd, else in the current directory, each git call run as `git` runs it with timeout and guarded; empty where the revision is not a commit, such as a root commit's parent, or holds no such file."""
if not commit_exists(revision, cwd, timeout, guarded):
return ""
listed = git("ls-tree", "--name-only", revision, "--", path, cwd=cwd)
listed = git("ls-tree", "--name-only", revision, "--", path, cwd=cwd, timeout=timeout, guarded=guarded)
if isinstance(listed, Failure):
return listed
return git("show", f"{revision}:{path}", cwd=cwd) if listed.strip() else ""
return git("show", f"{revision}:{path}", cwd=cwd, timeout=timeout, guarded=guarded) if listed.strip() else ""
def full_history() -> Failure | None: