mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
+1
-1
@@ -28,7 +28,7 @@ def ls(url, path=None, rev=None, recursive=None, dvc_only=False):
|
||||
"""
|
||||
from . import Repo
|
||||
|
||||
with Repo.open(url, rev, subrepos=True, uninitialized=True) as repo:
|
||||
with Repo.open(url, rev=rev, subrepos=True, uninitialized=True) as repo:
|
||||
path_info = PathInfo(repo.root_dir)
|
||||
if path:
|
||||
path_info /= path
|
||||
|
||||
@@ -273,6 +273,24 @@ def test_ls_repo_with_removed_dvc_dir_with_path_file(tmp_dir, dvc, scm):
|
||||
match_files(files, ((("file",), True),))
|
||||
|
||||
|
||||
def test_ls_repo_with_rev(erepo_dir):
|
||||
with erepo_dir.chdir():
|
||||
erepo_dir.scm_gen(FS_STRUCTURE, commit="init")
|
||||
erepo_dir.dvc_gen(DVC_STRUCTURE, commit="dvc")
|
||||
|
||||
rev = erepo_dir.scm.list_all_commits()[1]
|
||||
files = Repo.ls(os.fspath(erepo_dir), rev=rev)
|
||||
match_files(
|
||||
files,
|
||||
(
|
||||
((".dvcignore",), False),
|
||||
((".gitignore",), False),
|
||||
(("README.md",), False),
|
||||
(("model",), False),
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
def test_ls_remote_repo(erepo_dir):
|
||||
with erepo_dir.chdir():
|
||||
erepo_dir.scm_gen(FS_STRUCTURE, commit="init")
|
||||
|
||||
Reference in New Issue
Block a user