Files

12 lines
546 B
Python

from review_rules.comprehension_history import entries, HistoryChange
def measured_commit(changes: list[HistoryChange]) -> str | None:
"""The newest change, of changes given newest first, that adds a paired ruling or a scoring run to the history: the paired ruling's base, so each ruling measures the changes merged since the last one measured."""
for change in changes:
held = {entry.heading for entry in entries(change.before)}
if any(entry.heading not in held for entry in entries(change.after)):
return change.commit
return None