summaryrefslogtreecommitdiff
path: root/b4/pr.py
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-03-30 18:30:04 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-03-30 18:30:04 -0400
commit4d1673ea2d845709f1fed3cd314c7a36e53a1c65 (patch)
tree391c9f1d4f33e97c5490cfa5ded0b246c1b3a4c6 /b4/pr.py
parent7e035d16a7c6903b6f4ffa6cd41834367647ece6 (diff)
downloadb4-4d1673ea2d845709f1fed3cd314c7a36e53a1c65.tar.gz
Escape From lines in git-format-patch output
We need a valid mboxo format for python, so make sure to escape all From lines not actually starting a new message, per mboxo requirements. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Diffstat (limited to 'b4/pr.py')
-rw-r--r--b4/pr.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/b4/pr.py b/b4/pr.py
index e97dbce..015375a 100644
--- a/b4/pr.py
+++ b/b4/pr.py
@@ -222,6 +222,10 @@ def explode(gitdir, lmsg, savefile):
logger.critical(out)
sys.exit(ecode)
+ # Fix From lines to make sure this is a valid mboxo
+ out = re.sub(r'^From (?![a-f0-9]+ \w+ \w+ \d+ \d+:\d+:\d+ \d+$)', '>From ', out, 0, re.M)
+ print(out)
+
# Save patches into a temporary file
patchmbx = mkstemp()[1]
with open(patchmbx, 'w') as fh: