From e63bdd23c23178ab0b83cc17f688898fe1454047 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Fri, 23 Oct 2026 15:57:19 +0200 Subject: [PATCH] fix: name only the pin moves a bump keeps A bump rolled back for stale prose still printed the pins it would have set (yaps2: upstream_commit -> 7fe1e55 after "nothing was written"). --- scripts/profile_sync.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/scripts/profile_sync.py b/scripts/profile_sync.py index 11088f9e..1a2ce1a8 100644 --- a/scripts/profile_sync.py +++ b/scripts/profile_sync.py @@ -3862,15 +3862,16 @@ def _apply_writes( file=sys.stderr, ) return - for line in applied: - print(f"{name}: {recale}{line}") + messages = [f"{name}: {recale}{line}" for line in applied] if moved: # Each pin the write changes, as written: a bump that only moved # upstream_commit announced the source_commit it already held. after = yaml.safe_load(target.read_text(encoding="utf-8")) or {} before = yaml.safe_load(path.read_text(encoding="utf-8")) or {} - for pin in pins_changed(before, after): - print(f"{name}: {bumped}{pin} -> {str(after[pin])[:7]}") + messages += [ + f"{name}: {bumped}{pin} -> {str(after[pin])[:7]}" + for pin in pins_changed(before, after) + ] if not args.dry_run and (applied or moved): original = path.read_bytes() path.write_bytes(target.read_bytes()) @@ -3883,9 +3884,12 @@ def _apply_writes( path.write_bytes(original) print( f"{name}: the bump would leave {len(left)} prose citation(s) " - "under an older pin, nothing was written; read them first", + "under an older pin, nothing was written. Read them first.", file=sys.stderr, ) + return + for message in messages: + print(message) def _cited_paths(report: ProfileReport) -> list[str]: