diff options
author | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2020-04-15 13:56:13 -0400 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2020-04-15 13:56:13 -0400 |
commit | c4469dc30c30f629b1d725b663d80e8a78956c61 (patch) | |
tree | 4072252e820c65256df8070f353a1d97c3bd5712 | |
parent | 7a1a978790036f35b8d3d83b80105be1ca15ccd6 (diff) | |
download | b4-c4469dc30c30f629b1d725b663d80e8a78956c61.tar.gz |
Keep track of how many messages we create
Don't tell us to run git send-email when there's nothing to send.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r-- | b4/ty.py | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -320,6 +320,7 @@ def send_messages(listing, gitdir, outdir, branch, since='1.week'): else: signature = '%s <%s>' % (usercfg['name'], usercfg['email']) + outgoing = 0 for jsondata in listing: slug_from = re.sub(r'\W', '_', jsondata['fromemail']) slug_subj = re.sub(r'\W', '_', jsondata['subject']) @@ -337,6 +338,8 @@ def send_messages(listing, gitdir, outdir, branch, since='1.week'): if msg is None: continue + + outgoing += 1 outfile = os.path.join(outdir, '%s.thanks' % slug) logger.info(' Writing: %s', outfile) bout = msg.as_string(policy=b4.emlpolicy) @@ -346,6 +349,11 @@ def send_messages(listing, gitdir, outdir, branch, since='1.week'): fullpath = os.path.join(datadir, jsondata['trackfile']) os.rename(fullpath, '%s.sent' % fullpath) logger.info('---') + if not outgoing: + logger.info('No thanks necessary.') + return + + logger.debug('Wrote %s thank-you letters', outgoing) logger.info('You can now run:') logger.info(' git send-email %s/*.thanks', outdir) |