mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-19 07:18:27 +01:00
* metrics * fix path handling * fix dvc metrics diff * params show/diff * share common utils * remove onerror_collect from exp_show * extract read_params * move around code * fix path handling on Windows * rename _show to _gather_metrics * remove _collect_vars * add tests * Revert "remove _collect_vars" This reverts commit 6d2cb500c32a882497406d66fb13e613790c3436. * bring back _collect_vars * fix tests * fix paths
22 lines
556 B
Python
22 lines
556 B
Python
from typing import TYPE_CHECKING
|
|
|
|
if TYPE_CHECKING:
|
|
from dvc.repo import Repo
|
|
from dvc.repo.metrics.diff import DiffResult
|
|
|
|
|
|
def diff(
|
|
repo: "Repo",
|
|
a_rev: str = "HEAD",
|
|
b_rev: str = "workspace",
|
|
all: bool = False, # noqa: A002 # pylint: disable=redefined-builtin
|
|
**kwargs,
|
|
) -> "DiffResult":
|
|
if repo.scm.no_commits:
|
|
return {}
|
|
|
|
from dvc.repo.metrics.diff import _diff
|
|
|
|
params = repo.params.show(revs=[a_rev, b_rev], hide_workspace=False, **kwargs)
|
|
return _diff(params, a_rev, b_rev, with_unchanged=all)
|