diff options
Diffstat (limited to 'gitlab/v4/objects/repositories.py')
-rw-r--r-- | gitlab/v4/objects/repositories.py | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/gitlab/v4/objects/repositories.py b/gitlab/v4/objects/repositories.py index 18b0f8f..400f9d4 100644 --- a/gitlab/v4/objects/repositories.py +++ b/gitlab/v4/objects/repositories.py @@ -28,10 +28,10 @@ class RepositoryMixin(_RestObjectBase): """Update a project submodule Args: - submodule (str): Full path to the submodule - branch (str): Name of the branch to commit into - commit_sha (str): Full commit SHA to update the submodule to - commit_message (str): Commit message. If no message is provided, a + submodule: Full path to the submodule + branch: Name of the branch to commit into + commit_sha: Full commit SHA to update the submodule to + commit_message: Commit message. If no message is provided, a default one will be set (optional) Raises: @@ -53,23 +53,23 @@ class RepositoryMixin(_RestObjectBase): ) -> Union[gitlab.client.GitlabList, List[Dict[str, Any]]]: """Return a list of files in the repository. - Args: - path (str): Path of the top folder (/ by default) - ref (str): Reference to a commit or branch - recursive (bool): Whether to get the tree recursively - all (bool): If True, return all the items, without pagination - per_page (int): Number of items to retrieve per request - page (int): ID of the page to return (starts with page 1) - as_list (bool): If set to False and no pagination option is - defined, return a generator instead of a list - **kwargs: Extra options to send to the server (e.g. sudo) - - Raises: - GitlabAuthenticationError: If authentication is not correct - GitlabGetError: If the server failed to perform the request - - Returns: - list: The representation of the tree + Args: + path: Path of the top folder (/ by default) + ref: Reference to a commit or branch + recursive: Whether to get the tree recursively + all: If True, return all the items, without pagination + per_page: Number of items to retrieve per request + page: ID of the page to return (starts with page 1) + as_list: If set to False and no pagination option is + defined, return a generator instead of a list + **kwargs: Extra options to send to the server (e.g. sudo) + + Raises: + GitlabAuthenticationError: If authentication is not correct + GitlabGetError: If the server failed to perform the request + + Returns: + The representation of the tree """ gl_path = f"/projects/{self.get_id()}/repository/tree" query_data: Dict[str, Any] = {"recursive": recursive} @@ -95,7 +95,7 @@ class RepositoryMixin(_RestObjectBase): GitlabGetError: If the server failed to perform the request Returns: - dict: The blob content and metadata + The blob content and metadata """ path = f"/projects/{self.get_id()}/repository/blobs/{sha}" @@ -115,12 +115,12 @@ class RepositoryMixin(_RestObjectBase): Args: sha(str): ID of the blob - streamed (bool): If True the data will be processed by chunks of + streamed: If True the data will be processed by chunks of `chunk_size` and each chunk is passed to `action` for treatment action (callable): Callable responsible of dealing with chunk of data - chunk_size (int): Size of each chunk + chunk_size: Size of each chunk **kwargs: Extra options to send to the server (e.g. sudo) Raises: @@ -128,7 +128,7 @@ class RepositoryMixin(_RestObjectBase): GitlabGetError: If the server failed to perform the request Returns: - str: The blob content if streamed is False, None otherwise + The blob content if streamed is False, None otherwise """ path = f"/projects/{self.get_id()}/repository/blobs/{sha}/raw" result = self.manager.gitlab.http_get( @@ -145,17 +145,17 @@ class RepositoryMixin(_RestObjectBase): ) -> Union[Dict[str, Any], requests.Response]: """Return a diff between two branches/commits. - Args: - from_(str): Source branch/SHA - to(str): Destination branch/SHA - **kwargs: Extra options to send to the server (e.g. sudo) + Args: + from_(str): Source branch/SHA + to(str): Destination branch/SHA + **kwargs: Extra options to send to the server (e.g. sudo) - Raises: - GitlabAuthenticationError: If authentication is not correct - GitlabGetError: If the server failed to perform the request + Raises: + GitlabAuthenticationError: If authentication is not correct + GitlabGetError: If the server failed to perform the request - Returns: - str: The diff + Returns: + The diff """ path = f"/projects/{self.get_id()}/repository/compare" query_data = {"from": from_, "to": to} @@ -168,20 +168,20 @@ class RepositoryMixin(_RestObjectBase): ) -> Union[gitlab.client.GitlabList, List[Dict[str, Any]]]: """Return a list of contributors for the project. - Args: - all (bool): If True, return all the items, without pagination - per_page (int): Number of items to retrieve per request - page (int): ID of the page to return (starts with page 1) - as_list (bool): If set to False and no pagination option is - defined, return a generator instead of a list - **kwargs: Extra options to send to the server (e.g. sudo) + Args: + all: If True, return all the items, without pagination + per_page: Number of items to retrieve per request + page: ID of the page to return (starts with page 1) + as_list: If set to False and no pagination option is + defined, return a generator instead of a list + **kwargs: Extra options to send to the server (e.g. sudo) - Raises: - GitlabAuthenticationError: If authentication is not correct - GitlabGetError: If the server failed to perform the request + Raises: + GitlabAuthenticationError: If authentication is not correct + GitlabGetError: If the server failed to perform the request - Returns: - list: The contributors + Returns: + The contributors """ path = f"/projects/{self.get_id()}/repository/contributors" return self.manager.gitlab.http_list(path, **kwargs) @@ -199,13 +199,13 @@ class RepositoryMixin(_RestObjectBase): """Return a tarball of the repository. Args: - sha (str): ID of the commit (default branch by default) - streamed (bool): If True the data will be processed by chunks of + sha: ID of the commit (default branch by default) + streamed: If True the data will be processed by chunks of `chunk_size` and each chunk is passed to `action` for treatment action (callable): Callable responsible of dealing with chunk of data - chunk_size (int): Size of each chunk + chunk_size: Size of each chunk **kwargs: Extra options to send to the server (e.g. sudo) Raises: @@ -213,7 +213,7 @@ class RepositoryMixin(_RestObjectBase): GitlabListError: If the server failed to perform the request Returns: - bytes: The binary data of the archive + The binary data of the archive """ path = f"/projects/{self.get_id()}/repository/archive" query_data = {} |