def test_collect(tmp_dir, scm, dvc, run_copy): def collect_outs(*args, **kwargs): return set( str(out.path_info) for stage in dvc.collect(*args, **kwargs) for out in stage.outs ) tmp_dir.dvc_gen("foo", "foo") run_copy("foo", "bar") scm.add([".gitignore", "foo.dvc", "bar.dvc"]) scm.commit("Add foo and bar") scm.checkout("new-branch", create_new=True) run_copy("bar", "buzz") scm.add([".gitignore", "buzz.dvc"]) scm.commit("Add buzz") assert collect_outs("bar.dvc", with_deps=True) == {"foo", "bar"} dvc.tree = GitTree(scm.repo, "new-branch") assert collect_outs("buzz.dvc", with_deps=True) == {"foo", "bar", "buzz"} assert collect_outs("buzz.dvc", with_deps=False) == {"buzz"}
def get_tree(self, rev): return GitTree(self.repo, self.resolve_rev(rev))
def get_tree(self, rev): return GitTree(self.repo, rev)
def get_tree(self, rev): return GitTree(self.git, rev)
def get_tree(self, rev, **kwargs): return GitTree(self.repo, self.resolve_rev(rev), **kwargs)