Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/interface.py
Show First 20 Lines • Show All 502 Lines • ▼ Show 20 Lines | def revision_add(self, revisions: List[Revision]) -> Dict: | ||||
Summary dict of keys with associated count as values | Summary dict of keys with associated count as values | ||||
revision:add: New objects actually stored in db | revision:add: New objects actually stored in db | ||||
""" | """ | ||||
... | ... | ||||
@remote_api_endpoint("revision/missing") | @remote_api_endpoint("revision/missing") | ||||
def revision_missing(self, revisions): | def revision_missing(self, revisions: List[Sha1Git]) -> Iterable[Sha1Git]: | ||||
"""List revisions missing from storage | """List revisions missing from storage | ||||
Args: | Args: | ||||
revisions (iterable): revision ids | revisions: revision ids | ||||
Yields: | Yields: | ||||
missing revision ids | missing revision ids | ||||
""" | """ | ||||
... | ... | ||||
@remote_api_endpoint("revision") | @remote_api_endpoint("revision") | ||||
def revision_get(self, revisions): | def revision_get( | ||||
"""Get all revisions from storage | self, revisions: List[Sha1Git] | ||||
) -> Iterable[Optional[Dict[str, Any]]]: | |||||
"""Get revisions from storage | |||||
Args: | Args: | ||||
revisions: an iterable of revision ids | revisions: revision ids | ||||
Returns: | Yields: | ||||
iterable: an iterable of revisions as dictionaries (or None if the | revisions as dictionaries (or None if the revision doesn't exist) | ||||
revision doesn't exist) | |||||
""" | """ | ||||
... | ... | ||||
@remote_api_endpoint("revision/log") | @remote_api_endpoint("revision/log") | ||||
def revision_log(self, revisions, limit=None): | def revision_log( | ||||
self, revisions: List[Sha1Git], limit: Optional[int] = None | |||||
) -> Iterable[Optional[Dict[str, Any]]]: | |||||
"""Fetch revision entry from the given root revisions. | """Fetch revision entry from the given root revisions. | ||||
Args: | Args: | ||||
revisions: array of root revision to lookup | revisions: array of root revisions to lookup | ||||
limit: limitation on the output result. Default to None. | limit: limitation on the output result. Default to None. | ||||
Yields: | Yields: | ||||
List of revision log from such revisions root. | revision entries log from the given root root revisions | ||||
""" | """ | ||||
... | ... | ||||
@remote_api_endpoint("revision/shortlog") | @remote_api_endpoint("revision/shortlog") | ||||
def revision_shortlog(self, revisions, limit=None): | def revision_shortlog( | ||||
self, revisions: List[Sha1Git], limit: Optional[int] = None | |||||
) -> Iterable[Optional[Tuple[Sha1Git, Tuple[Sha1Git, ...]]]]: | |||||
"""Fetch the shortlog for the given revisions | """Fetch the shortlog for the given revisions | ||||
Args: | Args: | ||||
revisions: list of root revisions to lookup | revisions: list of root revisions to lookup | ||||
limit: depth limitation for the output | limit: depth limitation for the output | ||||
Yields: | Yields: | ||||
a list of (id, parents) tuples. | a list of (id, parents) tuples | ||||
""" | """ | ||||
... | ... | ||||
@remote_api_endpoint("revision/get_random") | @remote_api_endpoint("revision/get_random") | ||||
def revision_get_random(self) -> Sha1Git: | def revision_get_random(self) -> Sha1Git: | ||||
"""Finds a random revision id. | """Finds a random revision id. | ||||
▲ Show 20 Lines • Show All 738 Lines • Show Last 20 Lines |