Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/interface.py
Show First 20 Lines • Show All 496 Lines • ▼ Show 20 Lines | def revision_get(self, revision_ids: List[Sha1Git]) -> List[Optional[Revision]]: | ||||
Returns: | Returns: | ||||
list of revision object (if the revision exists or None otherwise) | list of revision object (if the revision exists or None otherwise) | ||||
""" | """ | ||||
... | ... | ||||
@remote_api_endpoint("extid/from_extid") | @remote_api_endpoint("extid/from_extid") | ||||
def extid_get_from_extid( | def extid_get_from_extid(self, id_type: str, ids: List[bytes]) -> List[ExtID]: | ||||
self, id_type: str, ids: List[bytes] | |||||
) -> List[Optional[ExtID]]: | |||||
"""Get ExtID objects from external IDs | """Get ExtID objects from external IDs | ||||
Args: | Args: | ||||
id_type: type of the given external identifiers (e.g. 'mercurial') | id_type: type of the given external identifiers (e.g. 'mercurial') | ||||
ids: list of external IDs | ids: list of external IDs | ||||
Returns: | Returns: | ||||
list of ExtID objects (if the ext ID is known, None otherwise) | list of ExtID objects | ||||
""" | """ | ||||
... | ... | ||||
@remote_api_endpoint("extid/from_target") | @remote_api_endpoint("extid/from_target") | ||||
def extid_get_from_target( | def extid_get_from_target( | ||||
self, target_type: ObjectType, ids: List[Sha1Git] | self, target_type: ObjectType, ids: List[Sha1Git] | ||||
) -> List[Optional[ExtID]]: | ) -> List[ExtID]: | ||||
"""Get ExtID objects from target IDs and target_type | """Get ExtID objects from target IDs and target_type | ||||
Args: | Args: | ||||
target_type: type the SWH object | target_type: type the SWH object | ||||
ids: list of target IDs | ids: list of target IDs | ||||
Returns: | Returns: | ||||
list of ExtID objects (if the SWH ID is known, None otherwise) | list of ExtID objects | ||||
""" | """ | ||||
... | ... | ||||
@remote_api_endpoint("extid/add") | @remote_api_endpoint("extid/add") | ||||
def extid_add(self, ids: List[ExtID]) -> Dict[str, int]: | def extid_add(self, ids: List[ExtID]) -> Dict[str, int]: | ||||
"""Add a series of ExtID objects | """Add a series of ExtID objects | ||||
▲ Show 20 Lines • Show All 714 Lines • Show Last 20 Lines |