mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
integrate @efiop 's suggestions
This commit is contained in:
@@ -16,9 +16,9 @@ def show_metrics(metrics, all_branches=False, all_tags=False):
|
||||
metrics (list): Where each element is either a `list`
|
||||
if an xpath was specified, otherwise a `str`
|
||||
"""
|
||||
# When `metrics` contains a `_missing` key, it means that some files
|
||||
# When `metrics` contains a `None` key, it means that some files
|
||||
# specified as `targets` in `repo.metrics.show` didn't contain any metrics.
|
||||
missing = metrics.pop("_missing", None)
|
||||
missing = metrics.pop(None, None)
|
||||
|
||||
for branch, val in metrics.items():
|
||||
if all_branches or all_tags:
|
||||
|
||||
@@ -276,12 +276,14 @@ def show(
|
||||
for branch in repo.brancher(all_branches=all_branches, all_tags=all_tags):
|
||||
metrics = {}
|
||||
|
||||
for p in targets:
|
||||
entries = _collect_metrics(repo, p, recursive, typ, xpath, branch)
|
||||
for target in targets:
|
||||
entries = _collect_metrics(
|
||||
repo, target, recursive, typ, xpath, branch
|
||||
)
|
||||
metric = _read_metrics(repo, entries, branch)
|
||||
|
||||
if metric:
|
||||
found.add(p)
|
||||
found.add(target)
|
||||
metrics.update(metric)
|
||||
|
||||
if metrics:
|
||||
@@ -293,6 +295,6 @@ def show(
|
||||
missing = set(targets) - found
|
||||
|
||||
if missing:
|
||||
res["_missing"] = missing
|
||||
res[None] = missing
|
||||
|
||||
return res
|
||||
|
||||
Reference in New Issue
Block a user