Skip to content

Commit

Permalink
remote: rename "checksum" -> "hash" (iterative#4051)
Browse files Browse the repository at this point in the history
* remote: s/get_checksum/get_hash/

* remote/tree: s/get_file_checksum/get_file_hash/

* remote: s/get_dir_checksum/get_dir_hash/

* remote: s/checksum_to_path/hash_to_path/

* remote: s/path_to_checksum/path_to_hash/

* remote: cleanup remaining checksum references

* remote.index: s/checksum/hash/

* note: does not rename "checksum" field in the index DB schema
  • Loading branch information
pmrowla authored Jun 16, 2020
1 parent 73e60a8 commit 0fb9870
Show file tree
Hide file tree
Showing 29 changed files with 476 additions and 519 deletions.
2 changes: 1 addition & 1 deletion dvc/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def get_url(path, repo=None, rev=None, remote=None):
raise UrlNotDvcRepoError(_repo.url)
out = _repo.find_out_by_relpath(path)
remote_obj = _repo.cloud.get_remote(remote)
return str(remote_obj.checksum_to_path_info(out.checksum))
return str(remote_obj.hash_to_path_info(out.checksum))


def open(path, repo=None, rev=None, remote=None, mode="r", encoding=None):
Expand Down
2 changes: 1 addition & 1 deletion dvc/data_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def pull(

def _save_pulled_checksums(self, cache):
for checksum in cache.scheme_keys("local"):
cache_file = self.repo.cache.local.checksum_to_path_info(checksum)
cache_file = self.repo.cache.local.hash_to_path_info(checksum)
if self.repo.cache.local.tree.exists(cache_file):
# We can safely save here, as existing corrupted files will
# be removed upon status, while files corrupted during
Expand Down
4 changes: 2 additions & 2 deletions dvc/dependency/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ def _get_checksum(self, locked=True):

# We are polluting our repo cache with some dir listing here
if tree.isdir(path):
return self.repo.cache.local.get_checksum(path, tree)
return tree.get_file_checksum(path)
return self.repo.cache.local.get_hash(path, tree)
return tree.get_file_hash(path)

def status(self):
current_checksum = self._get_checksum(locked=True)
Expand Down
6 changes: 3 additions & 3 deletions dvc/output/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def supported(cls, url):

@property
def cache_path(self):
return self.cache.checksum_to_path_info(self.checksum).url
return self.cache.hash_to_path_info(self.checksum).url

@property
def checksum_type(self):
Expand All @@ -178,11 +178,11 @@ def checksum(self, checksum):
self.info[self.remote.tree.PARAM_CHECKSUM] = checksum

def get_checksum(self):
return self.remote.get_checksum(self.path_info)
return self.remote.get_hash(self.path_info)

@property
def is_dir_checksum(self):
return self.remote.is_dir_checksum(self.checksum)
return self.remote.is_dir_hash(self.checksum)

@property
def exists(self):
Expand Down
2 changes: 1 addition & 1 deletion dvc/remote/azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def remove(self, path_info):
logger.debug(f"Removing {path_info}")
self.blob_service.delete_blob(path_info.bucket, path_info.path)

def get_file_checksum(self, path_info):
def get_file_hash(self, path_info):
return self.get_etag(path_info)

def _upload(
Expand Down
Loading

0 comments on commit 0fb9870

Please sign in to comment.