exp show: add --rev flag (#7152)

fix: #7152
1. Add `--rev` flag to `dvc exp show`.
2. Add -1 support for `--num` flag`.
3. Extract revision found logic to `utils`.
4. Brancher use this revision found logic.
5. Update command unit test
6. Add a util unit test.

Co-authored-by: Peter Rowlands (변기호) <[email protected]>
This commit is contained in:
karajan1001
2022-01-11 19:01:34 +08:00
committed by Gao
co-authored by Peter Rowlands
parent 87abeaddc2
commit b673ac24d0
7 changed files with 171 additions and 68 deletions
+4 -1
View File
@@ -99,6 +99,8 @@ def test_experiments_show(dvc, scm, mocker):
"--param-deps",
"-n",
"1",
"--rev",
"foo",
]
)
assert cli_args.func == CmdExperimentsShow
@@ -113,8 +115,9 @@ def test_experiments_show(dvc, scm, mocker):
all_tags=True,
all_branches=True,
all_commits=True,
sha_only=True,
num=1,
revs="foo",
sha_only=True,
param_deps=True,
)