diff options
author | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2020-05-25 15:48:06 -0400 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2020-05-25 15:48:06 -0400 |
commit | 12a69d7c5018c0dc0188e8f79933f2f7cb257c57 (patch) | |
tree | 5a24176dc64834cef0d56fb668dd3fe9ab578ccb /b4/diff.py | |
parent | 59be08453137a3b9c6a25dc6787b5066a88a84cd (diff) | |
download | b4-12a69d7c5018c0dc0188e8f79933f2f7cb257c57.tar.gz |
Backfill series before diffing them
Make sure we a) attempt to backfill the series if they are incomplete,
b) error out if the series is incomplete anyway
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Diffstat (limited to 'b4/diff.py')
-rw-r--r-- | b4/diff.py | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -30,11 +30,12 @@ def diff_same_thread_series(cmdargs): savefile = mkstemp('b4-diff-to')[1] # Do we have a cache of this lookup? cachedir = b4.get_cache_dir() + cachebase = urllib.parse.quote_plus(msgid) if wantvers: - cachefile = os.path.join(cachedir, '%s-%s.diff.mbx' % (urllib.parse.quote_plus(msgid), - '-'.join([str(x) for x in wantvers]))) - else: - cachefile = os.path.join(cachedir, '%s-latest.diff.mbx' % urllib.parse.quote_plus(msgid)) + cachebase += '-' + '-'.join([str(x) for x in wantvers]) + if cmdargs.useproject: + cachebase += '-' + cmdargs.useproject + cachefile = os.path.join(cachedir, '%s.diff.mbx' % cachebase) if os.path.exists(cachefile) and not cmdargs.nocache: logger.info('Using cached copy of the lookup') shutil.copyfile(cachefile, savefile) @@ -79,6 +80,12 @@ def diff_same_thread_series(cmdargs): if lower not in lmbx.series: return None, None + if not lmbx.series[lower].complete: + lmbx.backfill(lower) + + if not lmbx.series[upper].complete: + lmbx.backfill(upper) + return lmbx.series[lower], lmbx.series[upper] |