Skip to content

Commit fc25c17

Browse files
committed
patching: Rewriter: actually delete empty patch files on rewrite
- so patches-to-git filtering is actually useful
1 parent a61ff23 commit fc25c17

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

lib/tools/patching.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -375,9 +375,11 @@
375375
parent.rewrite_patch_file(patches)
376376
FAILED_PATCHES = [one_patch for one_patch in VALID_PATCHES if (not one_patch.applied_ok) or (one_patch.rewritten_patch is None)]
377377
for failed_patch in FAILED_PATCHES:
378-
log.info(
379-
f"Consider removing {failed_patch.parent.full_file_path()}(:{failed_patch.counter}); "
380-
f"it was not applied successfully.")
378+
log.warning(
379+
f"Removing {failed_patch.parent.full_file_path()}(:{failed_patch.counter}); "
380+
f" it failed to apply/was not rewritten.")
381+
os.remove(failed_patch.parent.full_file_path())
382+
381383

382384
# Create markdown about the patches
383385
readme_markdown: "str | None" = None

0 commit comments

Comments
 (0)