# HG changeset patch # User Ludovic Chabant # Date 1497537044 25200 # Node ID 93ea115027fcf5b1a260851848b3ee95c6644481 # Parent 3004ab31bb46dcd0d13db2669952d10409c51f5e showrecord: Don't show empty records when filtering. diff -r 3004ab31bb46 -r 93ea115027fc piecrust/commands/builtin/baking.py --- a/piecrust/commands/builtin/baking.py Tue Jun 13 22:30:45 2017 -0700 +++ b/piecrust/commands/builtin/baking.py Thu Jun 15 07:30:44 2017 -0700 @@ -205,34 +205,36 @@ records._record_version)) logger.info("") - for rec in records.records: - if ctx.args.fails and rec.success: - continue + if not ctx.args.show_stats: + for rec in records.records: + if ctx.args.fails and rec.success: + continue - ppname = rec.name[rec.name.index('@') + 1:] - if ppname not in pipelines: - continue - - entries_to_show = [] - - for e in rec.getEntries(): - if ctx.args.fails and e.success: + ppname = rec.name[rec.name.index('@') + 1:] + if ppname not in pipelines: continue - if in_pattern and not fnmatch.fnmatch(e.item_spec, in_pattern): - continue - if out_pattern and not any( - [fnmatch.fnmatch(op, out_pattern) - for op in e.getAllOutputPaths()]): - continue - entries_to_show.append(e) + + entries_to_show = [] - if entries_to_show: - logger.info("Record: %s" % rec.name) - logger.info("Status: %s" % ('SUCCESS' if rec.success - else 'FAILURE')) - for e in entries_to_show: - _print_record_entry(e) - logger.info("") + for e in rec.getEntries(): + if ctx.args.fails and e.success: + continue + if in_pattern and not fnmatch.fnmatch(e.item_spec, + in_pattern): + continue + if out_pattern and not any( + [fnmatch.fnmatch(op, out_pattern) + for op in e.getAllOutputPaths()]): + continue + entries_to_show.append(e) + + if entries_to_show: + logger.info("Record: %s" % rec.name) + logger.info("Status: %s" % ('SUCCESS' if rec.success + else 'FAILURE')) + for e in entries_to_show: + _print_record_entry(e) + logger.info("") stats = records.stats if ctx.args.show_stats: