summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-05-21 18:02:37 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-05-21 18:02:37 -0400
commit6ab6ed4dacb2c238ab35087cae9dd8c72feb2304 (patch)
tree3cb14bf0f0498c62c9e2e700d5e0817b88604010
parent6ca672ed87a6f8812fa408ea0b3161e68ce2351e (diff)
downloadb4-6ab6ed4dacb2c238ab35087cae9dd8c72feb2304.tar.gz
Do not crash when versions are specified
Also, make sure we display which versions we are diffing. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r--b4/diff.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/b4/diff.py b/b4/diff.py
index 36bdfd6..d2f467d 100644
--- a/b4/diff.py
+++ b/b4/diff.py
@@ -134,8 +134,8 @@ def main(cmdargs):
# Do we have a cache of this lookup?
cachedir = b4.get_cache_dir()
if cmdargs.wantvers:
- cachefile = os.path.join(cachedir,
- '%s-%s.diff.mbx' % (urllib.parse.quote_plus(msgid), '-'.join(cmdargs.wantvers)))
+ cachefile = os.path.join(cachedir, '%s-%s.diff.mbx' % (urllib.parse.quote_plus(msgid),
+ '-'.join([str(x) for x in cmdargs.wantvers])))
else:
cachefile = os.path.join(cachedir, '%s-latest.diff.mbx' % urllib.parse.quote_plus(msgid))
if os.path.exists(cachefile) and not cmdargs.nocache:
@@ -202,7 +202,8 @@ def main(cmdargs):
logger.info('Success, to compare v%s and v%s:', lower, upper)
logger.info(f' {grdcmd}')
sys.exit(0)
- logger.info('Running: %s', grdcmd)
+ logger.info('Diffing v%s and v%s', lower, upper)
+ logger.info(' Running: %s', grdcmd)
gitargs = ['range-diff', f'{lsc}..{lec}', f'{usc}..{uec}']
if cmdargs.outdiff is None or cmdargs.color:
gitargs.append('--color')
@@ -216,5 +217,6 @@ def main(cmdargs):
logger.info('Writing %s', cmdargs.outdiff)
fh = open(cmdargs.outdiff, 'w')
else:
+ logger.info('---')
fh = sys.stdout
fh.write(rdiff)