diff options
author | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2020-03-27 12:12:47 -0400 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2020-03-27 12:12:47 -0400 |
commit | 6521e15f95bea9d580156b52df7bb855c6765e9e (patch) | |
tree | 93745c7bce1bbffb14b6376eaef30fbf0258f153 | |
parent | 088064c0b88966e5d3d7b488e27c4ea0092c9d73 (diff) | |
download | b4-6521e15f95bea9d580156b52df7bb855c6765e9e.tar.gz |
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 <konstantin@linuxfoundation.org>
-rw-r--r-- | b4/mbox.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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) |