Skip to content

Commit

Permalink
Merge pull request iterative#2011 from mroutis/refactor
Browse files Browse the repository at this point in the history
refactor: rely on RemoteBasic._changed_dir_cache
  • Loading branch information
efiop authored May 16, 2019
2 parents 0210604 + 15f074f commit 20a24e2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
7 changes: 0 additions & 7 deletions dvc/remote/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,14 +524,7 @@ def changed_cache_file(self, checksum):

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

Expand Down
7 changes: 5 additions & 2 deletions dvc/remote/local/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ def pull(self, checksum_infos, remote, jobs=None, show_checksums=False):
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)

Expand All @@ -506,7 +506,10 @@ def _changed_cache_dir(self):
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 = [
Expand Down

0 comments on commit 20a24e2

Please sign in to comment.