Mercurial > piecrust2
comparison piecrust/commands/builtin/baking.py @ 873:93ea115027fc
showrecord: Don't show empty records when filtering.
| author | Ludovic Chabant <ludovic@chabant.com> |
|---|---|
| date | Thu, 15 Jun 2017 07:30:44 -0700 |
| parents | 3004ab31bb46 |
| children | 58ae026b4c31 |
comparison
equal
deleted
inserted
replaced
| 872:3004ab31bb46 | 873:93ea115027fc |
|---|---|
| 203 logger.info("Incremental count: %d" % records.incremental_count) | 203 logger.info("Incremental count: %d" % records.incremental_count) |
| 204 logger.info("Versions: %s/%s" % (records._app_version, | 204 logger.info("Versions: %s/%s" % (records._app_version, |
| 205 records._record_version)) | 205 records._record_version)) |
| 206 logger.info("") | 206 logger.info("") |
| 207 | 207 |
| 208 for rec in records.records: | 208 if not ctx.args.show_stats: |
| 209 if ctx.args.fails and rec.success: | 209 for rec in records.records: |
| 210 continue | 210 if ctx.args.fails and rec.success: |
| 211 | |
| 212 ppname = rec.name[rec.name.index('@') + 1:] | |
| 213 if ppname not in pipelines: | |
| 214 continue | |
| 215 | |
| 216 entries_to_show = [] | |
| 217 | |
| 218 for e in rec.getEntries(): | |
| 219 if ctx.args.fails and e.success: | |
| 220 continue | 211 continue |
| 221 if in_pattern and not fnmatch.fnmatch(e.item_spec, in_pattern): | 212 |
| 213 ppname = rec.name[rec.name.index('@') + 1:] | |
| 214 if ppname not in pipelines: | |
| 222 continue | 215 continue |
| 223 if out_pattern and not any( | 216 |
| 224 [fnmatch.fnmatch(op, out_pattern) | 217 entries_to_show = [] |
| 225 for op in e.getAllOutputPaths()]): | 218 |
| 226 continue | 219 for e in rec.getEntries(): |
| 227 entries_to_show.append(e) | 220 if ctx.args.fails and e.success: |
| 228 | 221 continue |
| 229 if entries_to_show: | 222 if in_pattern and not fnmatch.fnmatch(e.item_spec, |
| 230 logger.info("Record: %s" % rec.name) | 223 in_pattern): |
| 231 logger.info("Status: %s" % ('SUCCESS' if rec.success | 224 continue |
| 232 else 'FAILURE')) | 225 if out_pattern and not any( |
| 233 for e in entries_to_show: | 226 [fnmatch.fnmatch(op, out_pattern) |
| 234 _print_record_entry(e) | 227 for op in e.getAllOutputPaths()]): |
| 235 logger.info("") | 228 continue |
| 229 entries_to_show.append(e) | |
| 230 | |
| 231 if entries_to_show: | |
| 232 logger.info("Record: %s" % rec.name) | |
| 233 logger.info("Status: %s" % ('SUCCESS' if rec.success | |
| 234 else 'FAILURE')) | |
| 235 for e in entries_to_show: | |
| 236 _print_record_entry(e) | |
| 237 logger.info("") | |
| 236 | 238 |
| 237 stats = records.stats | 239 stats = records.stats |
| 238 if ctx.args.show_stats: | 240 if ctx.args.show_stats: |
| 239 _show_stats(stats) | 241 _show_stats(stats) |
| 240 | 242 |
