From 8e654910e1b1fcf3afa903d9952539794eef0d1a Mon Sep 17 00:00:00 2001 From: Konstantin Ryabitsev Date: Thu, 28 May 2020 12:00:38 -0400 Subject: Add --no-cover and -o - to output to stdout By request, provide a way to output the results of b4 am to stdout. This way it can be piped straight to "git am". E.g.: b4 diff 20200526205322.23465-1-mic@digikod.net -o - | git am Requested-by: Rob Herring Signed-off-by: Konstantin Ryabitsev --- b4/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'b4/__init__.py') diff --git a/b4/__init__.py b/b4/__init__.py index 0d6fd4a..f5e77d0 100644 --- a/b4/__init__.py +++ b/b4/__init__.py @@ -200,7 +200,7 @@ class LoreMailbox: if reused: continue # Try to backfill from that project - tmp_mbox = mkstemp()[1] + tmp_mbox = mkstemp('b4-backfill-mbox')[1] get_pi_thread_by_msgid(patch.msgid, tmp_mbox, useproject=projmap[entry[1]]) mbx = mailbox.mbox(tmp_mbox) was = len(self.msgid_map) @@ -2003,7 +2003,9 @@ def get_pi_thread_by_msgid(msgid, savefile, useproject=None, nocache=False): logger.debug('t_mbx_url=%s', t_mbx_url) logger.critical('Grabbing thread from %s', projurl.split('://')[1]) - in_mbxf = get_pi_thread_by_url(t_mbx_url, '%s-loose' % savefile, nocache=nocache) + + tmp_mbox = mkstemp('b4-lookup-mbox')[1] + in_mbxf = get_pi_thread_by_url(t_mbx_url, tmp_mbox, nocache=nocache) if not in_mbxf: return None in_mbx = mailbox.mbox(in_mbxf) -- cgit v1.2.3