Skip to content

Commit

Permalink
allow filtering bw metadata —blame by key
Browse files Browse the repository at this point in the history
  • Loading branch information
trehn committed Jan 2, 2018
1 parent 7065e18 commit 7b7ad5f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bundlewrap/cmdline/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,14 @@ def bw_metadata(repo, args):
else:
node = get_node(repo, args['target'], adhoc_nodes=args['adhoc_nodes'])
if args['blame']:
key_paths = [path.strip() for path in " ".join(args['keys']).split(",")]
table = [[bold(_("path")), bold(_("source"))], ROW_SEPARATOR]
for path, blamed in sorted(node.metadata_blame.items()):
table.append([" ".join(path), ", ".join(blamed)])
joined_path = " ".join(path)
for key_path in key_paths:
if joined_path.startswith(key_path):
table.append([joined_path, ", ".join(blamed)])
break
page_lines(render_table(table))
else:
for line in dumps(
Expand Down

0 comments on commit 7b7ad5f

Please sign in to comment.