From cef333a01c7e695d3e7fcfef8ec342da38196edc Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Sat, 30 Nov 2024 13:59:51 -0800 Subject: [PATCH] feat: extract history content up to end of base version section --- scripts/update-history.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/scripts/update-history.py b/scripts/update-history.py index c21867147..36579b64e 100755 --- a/scripts/update-history.py +++ b/scripts/update-history.py @@ -48,7 +48,19 @@ def main(): if start_idx == -1: raise ValueError("Could not find start of release history") - relevant_history = history_content[start_idx:] + # Find where this version's section ends + version_idx = history_content.find(version_header, start_idx) + if version_idx == -1: + raise ValueError(f"Could not find version header: {version_header}") + + # Find the next version header after this one + next_version_idx = history_content.find("\n### Aider v", version_idx + len(version_header)) + if next_version_idx == -1: + # No next version found, use the rest of the file + relevant_history = history_content[start_idx:] + else: + # Extract just up to the next version + relevant_history = history_content[start_idx:next_version_idx] # Save relevant portions to temporary files with tempfile.NamedTemporaryFile(mode="w", delete=False, suffix=".diff") as tmp_diff: