mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
refactor: rely on RemoteBasic._changed_dir_cache
Defining `_changed_cache_dir` for the sole purpose of executing code before `_changed_dir_cache` was not that clear. Now, it overwrites `_changed_dir_cache` but reference the base method.
This commit is contained in:
@@ -524,14 +524,7 @@ class RemoteBASE(object):
|
||||
|
||||
return True
|
||||
|
||||
def _changed_cache_dir(self):
|
||||
# NOTE: only implemented for RemoteLOCAL
|
||||
return True
|
||||
|
||||
def _changed_dir_cache(self, checksum):
|
||||
if not self._changed_cache_dir():
|
||||
return False
|
||||
|
||||
if self.changed_cache_file(checksum):
|
||||
return True
|
||||
|
||||
|
||||
@@ -495,7 +495,7 @@ class RemoteLOCAL(RemoteBASE):
|
||||
download=True,
|
||||
)
|
||||
|
||||
def _changed_cache_dir(self):
|
||||
def _changed_dir_cache(self, checksum):
|
||||
mtime, size = get_mtime_and_size(self.cache_dir)
|
||||
inode = get_inode(self.cache_dir)
|
||||
|
||||
@@ -506,7 +506,10 @@ class RemoteLOCAL(RemoteBASE):
|
||||
else:
|
||||
changed = True
|
||||
|
||||
return changed
|
||||
if not changed:
|
||||
return False
|
||||
|
||||
return super(RemoteLOCAL, self)._changed_dir_cache(checksum)
|
||||
|
||||
def _log_missing_caches(self, checksum_info_dict):
|
||||
missing_caches = [
|
||||
|
||||
Reference in New Issue
Block a user