From 6521e15f95bea9d580156b52df7bb855c6765e9e Mon Sep 17 00:00:00 2001 From: Konstantin Ryabitsev Date: Fri, 27 Mar 2020 12:12:47 -0400 Subject: Disambiguate cache when useproject is specified (Backported from master) When we are forcing a specific project, either via -p or via parsing the full lore URL, save and fetch from a distinct cache location. Signed-off-by: Konstantin Ryabitsev --- b4/mbox.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/b4/mbox.py b/b4/mbox.py index 7043fa1..e3bde22 100644 --- a/b4/mbox.py +++ b/b4/mbox.py @@ -62,7 +62,10 @@ def get_pi_thread_by_msgid(msgid, config, cmdargs): savefile = os.path.join(outdir, savefile) cachedir = b4.get_cache_dir() - cachefile = os.path.join(cachedir, '%s.pi.mbx' % urllib.parse.quote_plus(msgid)) + base = msgid + if cmdargs.useproject: + base = '%s-%s' % (cmdargs.useproject, msgid) + cachefile = os.path.join(cachedir, '%s.pi.mbx' % urllib.parse.quote_plus(base)) if os.path.exists(cachefile) and not cmdargs.nocache: logger.debug('Using cached copy: %s', cachefile) shutil.copyfile(cachefile, savefile) -- cgit v1.2.3