Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/interface.py
Show First 20 Lines • Show All 695 Lines • ▼ Show 20 Lines | ) -> Optional[Dict[Optional[str], int]]: | ||||
... | ... | ||||
@remote_api_endpoint("snapshot/get_branches") | @remote_api_endpoint("snapshot/get_branches") | ||||
def snapshot_get_branches( | def snapshot_get_branches( | ||||
self, | self, | ||||
snapshot_id: Sha1Git, | snapshot_id: Sha1Git, | ||||
branches_from: bytes = b"", | branches_from: bytes = b"", | ||||
branches_count: int = 1000, | branches_count: int = 1000, | ||||
target_types: Optional[List[str]] = None, | target_types: Optional[List[str]] = None, | ||||
vlorentz: s/pattern/substring/ ? | |||||
Done Inline Actionsack, will rename anlambert: ack, will rename | |||||
branches_name_pattern: Optional[str] = None, | |||||
) -> Optional[PartialBranches]: | ) -> Optional[PartialBranches]: | ||||
"""Get the content, possibly partial, of a snapshot with the given id | """Get the content, possibly partial, of a snapshot with the given id | ||||
The branches of the snapshot are iterated in the lexicographical | The branches of the snapshot are iterated in the lexicographical | ||||
order of their names. | order of their names. | ||||
Args: | Args: | ||||
snapshot_id: identifier of the snapshot | snapshot_id: identifier of the snapshot | ||||
branches_from: optional parameter used to skip branches | branches_from: optional parameter used to skip branches | ||||
whose name is lesser than it before returning them | whose name is lesser than it before returning them | ||||
branches_count: optional parameter used to restrain | branches_count: optional parameter used to restrain | ||||
the amount of returned branches | the amount of returned branches | ||||
target_types: optional parameter used to filter the | target_types: optional parameter used to filter the | ||||
target types of branch to return (possible values that can be | target types of branch to return (possible values that can be | ||||
contained in that list are `'content', 'directory', | contained in that list are `'content', 'directory', | ||||
'revision', 'release', 'snapshot', 'alias'`) | 'revision', 'release', 'snapshot', 'alias'`) | ||||
branches_name_pattern: if provided, only return branches whose names | |||||
match given pattern | |||||
Returns: | Returns: | ||||
dict: None if the snapshot does not exist; | dict: None if the snapshot does not exist; | ||||
a dict with three keys otherwise: | a dict with three keys otherwise: | ||||
* **id**: identifier of the snapshot | * **id**: identifier of the snapshot | ||||
* **branches**: a dict of branches contained in the snapshot | * **branches**: a dict of branches contained in the snapshot | ||||
whose keys are the branches' names. | whose keys are the branches' names. | ||||
* **next_branch**: the name of the first branch not returned | * **next_branch**: the name of the first branch not returned | ||||
▲ Show 20 Lines • Show All 473 Lines • Show Last 20 Lines |
s/pattern/substring/ ?