-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Currently, Remote classes can contain methods that fall into three categories:
- remote operations - indexing/
gc/etc - cache operations -
save/checkout/link/etc - tree operations -
exists/isfile/isdir/upload/download/etc
Having all of these methods grouped into a single Remote class causes issues when we are dealing with paths that can come from different namespaces (trees). In particular, LocalRemote was originally written with the assumption that all paths for local remote or local cache operations are always filesystem paths, which is no longer the case given that we now need to support GitTree objects (via brancher and erepos).
Ex. LocalRemote.exists(path) is used in different places as a replacement for os.path.exists() to test if path exists in a local remote, if path exists in the local cache directory, and if path exists in a DVC repo, even though these are distinct operations.
Tasks:
- separate remote/cache/tree methods
- cache methods which take
path_infoparameters which can belong to a namespace other thanremote.treeshould take explicittreeparameters, so it is always clear what treepath_infoapplies to (remote: separate cloud remote and cloud cache classes #4019) - local cache should have its own tree instance that is separate from
repo.tree(since local cache always operates on a filesystem working tree, butrepo.treedoes not) (remote: use separate working tree instance for local cache #3991) - state should belong to local cache and not repo, and should only be used for working tree paths (remote: use separate working tree instance for local cache #3991)