Read a project's language, title templates and branch template from its config

This commit is contained in:
2026-11-14 01:08:48 +01:00
parent 499d1772be
commit 82f4bbd91b
22 changed files with 316 additions and 43 deletions
+3 -2
View File
@@ -5,6 +5,7 @@ from release_plan.release_standing import chunk_item, Cut, dated_cut, LastCut, R
from failure import Failure
from chunk_preflight.gathered import Forge, NoItem, Plan
from release_plan.todo_table import item_details, items, NoItemsTable
from project_config import templates
from release_plan.release import version
# The command each forge's CLI lists pull requests with; pulls_command adds the flags that pick their rows and fields.
@@ -24,7 +25,7 @@ def plan_name(default: str, outside: pathlib.Path | None) -> str:
return str(outside) if outside else f"{default}'s todo.md"
def planned(todo: str | Failure, cut: LastCut, default: str, outside: pathlib.Path | None = None) -> Plan | NoItem:
def planned(todo: str | Failure, cut: LastCut, default: str, outside: pathlib.Path | None = None, branch: str = templates.BRANCH) -> Plan | NoItem:
"""The plan in todo, the text of the todo.md plan_name names, with the item the next chunk takes first, release_standing.chunk_item's pick; else why there is none."""
where = plan_name(default, outside)
if isinstance(todo, Failure):
@@ -55,7 +56,7 @@ def planned(todo: str | Failure, cut: LastCut, default: str, outside: pathlib.Pa
return NoItem(f"every item of release {version(pick.release)} in {where} waits." if pick.release is not None else f"{where}'s items table holds no item.")
details = item_details(todo)
detail = details.get(first.id, "") if isinstance(details, dict) else f"(todo.md's details cannot be read: {details.reason})"
return Plan(found, first, f"{first.tagline}\n\n{detail}".strip(), details)
return Plan(found, first, f"{first.tagline}\n\n{detail}".strip(), details, branch)
def worktree_on(porcelain: str, branch: str) -> pathlib.Path | None: