diff options
-rw-r--r-- | b4/__init__.py | 3 | ||||
-rw-r--r-- | b4/diff.py | 15 |
2 files changed, 14 insertions, 4 deletions
diff --git a/b4/__init__.py b/b4/__init__.py index 3cdad1c..ab8f034 100644 --- a/b4/__init__.py +++ b/b4/__init__.py @@ -680,6 +680,9 @@ class LoreSeries: # Logic largely borrowed from gj_tools seenfiles = set() for lmsg in self.patches[1:]: + if lmsg is None: + logger.critical('ERROR: v%s series incomplete; unable to create a fake-am range', self.revision) + return None, None logger.debug('Looking at %s', lmsg.full_subject) lmsg.load_hashes() if not len(lmsg.blob_indexes): @@ -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] |