Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/algos/revisions_walker.py
Show First 20 Lines • Show All 376 Lines • ▼ Show 20 Lines | def __init__(self, storage, rev_start, path, **kwargs): | ||||
paths = path.strip("/").split("/") | paths = path.strip("/").split("/") | ||||
self._path = list(map(lambda p: p.encode("utf-8"), paths)) | self._path = list(map(lambda p: p.encode("utf-8"), paths)) | ||||
self._rev_dir_path = {} | self._rev_dir_path = {} | ||||
def _get_path_id(self, rev_id): | def _get_path_id(self, rev_id): | ||||
""" | """ | ||||
Return the path checksum identifier in the source tree of the | Return the path checksum identifier in the source tree of the | ||||
provided revision. If the path corresponds to a directory, the | provided revision. If the path corresponds to a directory, the | ||||
value computed by :func:`swh.model.identifiers.directory_identifier` | value computed by :meth:`swh.model.Directory.compute_hash` | ||||
will be returned. If the path corresponds to a file, its sha1 | will be returned. If the path corresponds to a file, its sha1 | ||||
checksum will be returned. | checksum will be returned. | ||||
Args: | Args: | ||||
rev_id (bytes): a revision identifier | rev_id (bytes): a revision identifier | ||||
Returns: | Returns: | ||||
bytes: the path identifier | bytes: the path identifier | ||||
▲ Show 20 Lines • Show All 154 Lines • Show Last 20 Lines |