From 34619042e4839cf1f3031b1c3e6f791104f02dfe Mon Sep 17 00:00:00 2001 From: Gauvain Pocentek Date: Sun, 15 Jul 2018 17:21:09 +0200 Subject: Project import: fix the override_params parameter Closes #552 --- gitlab/v4/objects.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gitlab/v4/objects.py') diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index 9327e06..c266724 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -3605,7 +3605,8 @@ class ProjectManager(CRUDMixin, RESTManager): 'overwrite': overwrite } if override_params: - data['override_params'] = override_params + for k, v in override_params.items(): + data['override_params[%s]' % k] = v if namespace: data['namespace'] = namespace return self.gitlab.http_post('/projects/import', post_data=data, -- cgit v1.2.1 From 0379efaa641d22ccdb530214c56ec72891f73c4a Mon Sep 17 00:00:00 2001 From: Gauvain Pocentek Date: Sun, 15 Jul 2018 18:03:33 +0200 Subject: Support group and global MR listing Closes #553 --- gitlab/v4/objects.py | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'gitlab/v4/objects.py') diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index c266724..7f50440 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -710,8 +710,16 @@ class GroupMergeRequest(RESTObject): pass -class GroupMergeRequestManager(RESTManager): - pass +class GroupMergeRequestManager(ListMixin, RESTManager): + _path = '/groups/%(group_id)s/merge_requests' + _obj_cls = GroupMergeRequest + _from_parent_attrs = {'group_id': 'id'} + _list_filters = ('state', 'order_by', 'sort', 'milestone', 'view', + 'labels', 'created_after', 'created_before', + 'updated_after', 'updated_before', 'scope', 'author_id', + 'assignee_id', 'my_reaction_emoji', 'source_branch', + 'target_branch', 'search') + _types = {'labels': types.ListAttribute} class GroupMilestone(SaveMixin, ObjectDeleteMixin, RESTObject): @@ -842,6 +850,7 @@ class Group(SaveMixin, ObjectDeleteMixin, RESTObject): ('epics', 'GroupEpicManager'), ('issues', 'GroupIssueManager'), ('members', 'GroupMemberManager'), + ('mergerequests', 'GroupMergeRequestManager'), ('milestones', 'GroupMilestoneManager'), ('notificationsettings', 'GroupNotificationSettingsManager'), ('projects', 'GroupProjectManager'), @@ -1040,6 +1049,22 @@ class LicenseManager(RetrieveMixin, RESTManager): _optional_get_attrs = ('project', 'fullname') +class MergeRequest(RESTObject): + pass + + +class MergeRequestManager(ListMixin, RESTManager): + _path = '/merge_requests' + _obj_cls = MergeRequest + _from_parent_attrs = {'group_id': 'id'} + _list_filters = ('state', 'order_by', 'sort', 'milestone', 'view', + 'labels', 'created_after', 'created_before', + 'updated_after', 'updated_before', 'scope', 'author_id', + 'assignee_id', 'my_reaction_emoji', 'source_branch', + 'target_branch', 'search') + _types = {'labels': types.ListAttribute} + + class Snippet(UserAgentDetailMixin, SaveMixin, ObjectDeleteMixin, RESTObject): _short_print_attr = 'title' -- cgit v1.2.1 From 32ae92469f13fe2cbeb87361a4608dd5d95b3a70 Mon Sep 17 00:00:00 2001 From: Gauvain Pocentek Date: Sun, 15 Jul 2018 18:08:32 +0200 Subject: Implement MR.pipelines() Closes #555 --- gitlab/v4/objects.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'gitlab/v4/objects.py') diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index 7f50440..71dd90c 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -2157,6 +2157,24 @@ class ProjectMergeRequest(SubscribableMixin, TodoMixin, TimeTrackingMixin, path = '%s/%s/changes' % (self.manager.path, self.get_id()) return self.manager.gitlab.http_get(path, **kwargs) + @cli.register_custom_action('ProjectMergeRequest') + @exc.on_http_error(exc.GitlabListError) + def pipelines(self, **kwargs): + """List the merge request pipelines. + + Args: + **kwargs: Extra options to send to the server (e.g. sudo) + + Raises: + GitlabAuthenticationError: If authentication is not correct + GitlabListError: If the list could not be retrieved + + Returns: + RESTObjectList: List of changes + """ + path = '%s/%s/pipelines' % (self.manager.path, self.get_id()) + return self.manager.gitlab.http_get(path, **kwargs) + @cli.register_custom_action('ProjectMergeRequest', tuple(), ('merge_commit_message', 'should_remove_source_branch', -- cgit v1.2.1 From 35c8c8298392188c51e5956dd2eb90bb3d81a301 Mon Sep 17 00:00:00 2001 From: Gauvain Pocentek Date: Fri, 20 Jul 2018 07:24:25 +0200 Subject: MR: add the squash attribute for create/update Closes #557 --- gitlab/v4/objects.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'gitlab/v4/objects.py') diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index 71dd90c..508ca7c 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -2219,13 +2219,14 @@ class ProjectMergeRequestManager(CRUDMixin, RESTManager): _create_attrs = ( ('source_branch', 'target_branch', 'title'), ('assignee_id', 'description', 'target_project_id', 'labels', - 'milestone_id', 'remove_source_branch', 'allow_maintainer_to_push') + 'milestone_id', 'remove_source_branch', 'allow_maintainer_to_push', + 'squash') ) - _update_attrs = (tuple(), - ('target_branch', 'assignee_id', 'title', 'description', - 'state_event', 'labels', 'milestone_id', - 'remove_source_branch', 'discussion_locked', - 'allow_maintainer_to_push')) + _update_attrs = ( + tuple(), + ('target_branch', 'assignee_id', 'title', 'description', 'state_event', + 'labels', 'milestone_id', 'remove_source_branch', 'discussion_locked', + 'allow_maintainer_to_push', 'squash')) _list_filters = ('state', 'order_by', 'sort', 'milestone', 'view', 'labels', 'created_after', 'created_before', 'updated_after', 'updated_before', 'scope', 'author_id', -- cgit v1.2.1 From b325bd73400e3806e6ede59cc10011fbf138b877 Mon Sep 17 00:00:00 2001 From: David Guest Date: Thu, 26 Jul 2018 15:18:38 +1000 Subject: Added support for listing forks of a project (#562) --- gitlab/v4/objects.py | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'gitlab/v4/objects.py') diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index 508ca7c..7438655 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -1645,7 +1645,7 @@ class ProjectFork(RESTObject): pass -class ProjectForkManager(CreateMixin, RESTManager): +class ProjectForkManager(CreateMixin, ListMixin, RESTManager): _path = '/projects/%(project_id)s/fork' _obj_cls = ProjectFork _from_parent_attrs = {'project_id': 'id'} @@ -1655,6 +1655,28 @@ class ProjectForkManager(CreateMixin, RESTManager): 'with_merge_requests_enabled') _create_attrs = (tuple(), ('namespace', )) + def list(self, **kwargs): + """Retrieve a list of objects. + + 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) + + Returns: + list: The list of objects, or a generator if `as_list` is False + + Raises: + GitlabAuthenticationError: If authentication is not correct + GitlabListError: If the server cannot perform the request + """ + + path = self._compute_path('/projects/%(project_id)s/forks') + return ListMixin.list(self, path=path, **kwargs) + class ProjectHook(SaveMixin, ObjectDeleteMixin, RESTObject): _short_print_attr = 'url' -- cgit v1.2.1 From a1c79d2b7d719204c829235a9b0ebb08b45b4efb Mon Sep 17 00:00:00 2001 From: Will Rouesnel Date: Fri, 3 Aug 2018 04:46:30 +1000 Subject: Add support for project transfers from the projects interface. (#561) See https://docs.gitlab.com/ee/api/projects.html#transfer-a-project-to-a-new-namespace --- gitlab/v4/objects.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'gitlab/v4/objects.py') diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index 7438655..bd7635f 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -3611,6 +3611,25 @@ class Project(SaveMixin, ObjectDeleteMixin, RESTObject): path = '/projects/%d/mirror/pull' % self.get_id() self.manager.gitlab.http_post(path, **kwargs) + @cli.register_custom_action('Project', ('to_namespace', )) + @exc.on_http_error(exc.GitlabTransferProjectError) + def transfer_project(self, to_namespace, **kwargs): + """Transfer a project to the given namespace ID + + Args: + to_namespace (str): ID or path of the namespace to transfer the + project to + **kwargs: Extra options to send to the server (e.g. sudo) + + Raises: + GitlabAuthenticationError: If authentication is not correct + GitlabTransferProjectError: If the project could not be transfered + """ + path = '/projects/%d/transfer' % (self.id,) + self.manager.gitlab.http_put(path, + post_data={"namespace": to_namespace}, + **kwargs) + class ProjectManager(CRUDMixin, RESTManager): _path = '/projects' -- cgit v1.2.1 From 83fb4f9ec5f60a122fe9db26c426be74c335e5d5 Mon Sep 17 00:00:00 2001 From: Justin Date: Mon, 10 Sep 2018 13:49:18 -0500 Subject: add missing comma in ProjectIssueManager _create_attrs This fixes the argument handling for assignee/milestone ID when for `project-issue create` --- gitlab/v4/objects.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gitlab/v4/objects.py') diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index bd7635f..1d771ae 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -1862,8 +1862,8 @@ class ProjectIssueManager(CRUDMixin, RESTManager): 'order_by', 'sort', 'search', 'created_after', 'created_before', 'updated_after', 'updated_before') _create_attrs = (('title', ), - ('description', 'confidential', 'assignee_id', - 'assignee_idss' 'milestone_id', 'labels', 'created_at', + ('description', 'confidential', 'assignee_ids', + 'assignee_id', 'milestone_id', 'labels', 'created_at', 'due_date', 'merge_request_to_resolve_discussions_of', 'discussion_to_resolve')) _update_attrs = (tuple(), ('title', 'description', 'confidential', -- cgit v1.2.1 From ea71f1d121b723140671e2090182174234f0e2a1 Mon Sep 17 00:00:00 2001 From: Eric Sabouraud Date: Wed, 3 Oct 2018 21:36:56 +0200 Subject: Add project protected tags management (#581) --- gitlab/v4/objects.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'gitlab/v4/objects.py') diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index 1d771ae..281301e 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -1965,6 +1965,18 @@ class ProjectTagManager(NoUpdateMixin, RESTManager): _create_attrs = (('tag_name', 'ref'), ('message',)) +class ProjectProtectedTag(ObjectDeleteMixin, RESTObject): + _id_attr = 'name' + _short_print_attr = 'name' + + +class ProjectProtectedTagManager(NoUpdateMixin, RESTManager): + _path = '/projects/%(project_id)s/protected_tags' + _obj_cls = ProjectProtectedTag + _from_parent_attrs = {'project_id': 'id'} + _create_attrs = (('name',), ('create_access_level',)) + + class ProjectMergeRequestApproval(SaveMixin, RESTObject): _id_attr = None @@ -3124,6 +3136,7 @@ class Project(SaveMixin, ObjectDeleteMixin, RESTObject): ('pagesdomains', 'ProjectPagesDomainManager'), ('pipelines', 'ProjectPipelineManager'), ('protectedbranches', 'ProjectProtectedBranchManager'), + ('protectedtags', 'ProjectProtectedTagManager'), ('pipelineschedules', 'ProjectPipelineScheduleManager'), ('pushrules', 'ProjectPushRulesManager'), ('runners', 'ProjectRunnerManager'), -- cgit v1.2.1 From 95d0d745d4bafe702c89c972f644b049d6c810ab Mon Sep 17 00:00:00 2001 From: Gauvain Pocentek Date: Sat, 3 Nov 2018 09:50:37 +0100 Subject: Add support to resource label events Closes #611 --- gitlab/v4/objects.py | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) (limited to 'gitlab/v4/objects.py') diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index 281301e..84b3a86 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -662,9 +662,22 @@ class GroupEpicIssueManager(ListMixin, CreateMixin, UpdateMixin, DeleteMixin, return self._obj_cls(self, server_data) +class GroupEpicResourceLabelEvent(RESTObject): + pass + + +class GroupEpicResourceLabelEventManager(RetrieveMixin, RESTManager): + _path = ('/groups/%(group_id)s/epics/%(epic_id)s/resource_label_events') + _obj_cls = GroupEpicResourceLabelEvent + _from_parent_attrs = {'group_id': 'group_id', 'epic_id': 'id'} + + class GroupEpic(ObjectDeleteMixin, SaveMixin, RESTObject): _id_attr = 'iid' - _managers = (('issues', 'GroupEpicIssueManager'),) + _managers = ( + ('issues', 'GroupEpicIssueManager'), + ('resourcelabelevents', 'GroupEpicResourceLabelEventManager'), + ) class GroupEpicManager(CRUDMixin, RESTManager): @@ -1803,6 +1816,17 @@ class ProjectIssueLinkManager(ListMixin, CreateMixin, DeleteMixin, return source_issue, target_issue +class ProjectIssueResourceLabelEvent(RESTObject): + pass + + +class ProjectIssueResourceLabelEventManager(RetrieveMixin, RESTManager): + _path = ('/projects/%(project_id)s/issues/%(issue_iid)s' + '/resource_label_events') + _obj_cls = ProjectIssueResourceLabelEvent + _from_parent_attrs = {'project_id': 'project_id', 'issue_iid': 'iid'} + + class ProjectIssue(UserAgentDetailMixin, SubscribableMixin, TodoMixin, TimeTrackingMixin, ParticipantsMixin, SaveMixin, ObjectDeleteMixin, RESTObject): @@ -1813,6 +1837,7 @@ class ProjectIssue(UserAgentDetailMixin, SubscribableMixin, TodoMixin, ('discussions', 'ProjectIssueDiscussionManager'), ('links', 'ProjectIssueLinkManager'), ('notes', 'ProjectIssueNoteManager'), + ('resourcelabelevents', 'ProjectIssueResourceLabelEventManager'), ) @cli.register_custom_action('ProjectIssue', ('to_project_id',)) @@ -2086,6 +2111,17 @@ class ProjectMergeRequestDiscussionManager(RetrieveMixin, CreateMixin, _update_attrs = (('resolved',), tuple()) +class ProjectMergeRequestResourceLabelEvent(RESTObject): + pass + + +class ProjectMergeRequestResourceLabelEventManager(RetrieveMixin, RESTManager): + _path = ('/projects/%(project_id)s/merge_requests/%(mr_iid)s' + '/resource_label_events') + _obj_cls = ProjectMergeRequestResourceLabelEvent + _from_parent_attrs = {'project_id': 'project_id', 'mr_iid': 'iid'} + + class ProjectMergeRequest(SubscribableMixin, TodoMixin, TimeTrackingMixin, ParticipantsMixin, SaveMixin, ObjectDeleteMixin, RESTObject): @@ -2097,6 +2133,8 @@ class ProjectMergeRequest(SubscribableMixin, TodoMixin, TimeTrackingMixin, ('diffs', 'ProjectMergeRequestDiffManager'), ('discussions', 'ProjectMergeRequestDiscussionManager'), ('notes', 'ProjectMergeRequestNoteManager'), + ('resourcelabelevents', + 'ProjectMergeRequestResourceLabelEventManager'), ) @cli.register_custom_action('ProjectMergeRequest') -- cgit v1.2.1 From ef1523a23737db45d0f439badcd8be564bcb67fb Mon Sep 17 00:00:00 2001 From: Gauvain Pocentek Date: Sat, 24 Nov 2018 18:05:34 +0100 Subject: [feature] Add support for members all() method Closes #589 --- gitlab/v4/objects.py | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'gitlab/v4/objects.py') diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index 281301e..3f01955 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -705,6 +705,30 @@ class GroupMemberManager(CRUDMixin, RESTManager): _create_attrs = (('access_level', 'user_id'), ('expires_at', )) _update_attrs = (('access_level', ), ('expires_at', )) + @cli.register_custom_action('GroupMemberManager') + @exc.on_http_error(exc.GitlabListError) + def all(self, **kwargs): + """List all the members, included inherited ones. + + 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) + + Raises: + GitlabAuthenticationError: If authentication is not correct + GitlabListError: If the list could not be retrieved + + Returns: + RESTObjectList: The list of members + """ + + path = '%s/all' % self.path + return self.gitlab.http_list(path, **kwargs) + class GroupMergeRequest(RESTObject): pass @@ -1884,6 +1908,30 @@ class ProjectMemberManager(CRUDMixin, RESTManager): _create_attrs = (('access_level', 'user_id'), ('expires_at', )) _update_attrs = (('access_level', ), ('expires_at', )) + @cli.register_custom_action('ProjectMemberManager') + @exc.on_http_error(exc.GitlabListError) + def all(self, **kwargs): + """List all the members, included inherited ones. + + 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) + + Raises: + GitlabAuthenticationError: If authentication is not correct + GitlabListError: If the list could not be retrieved + + Returns: + RESTObjectList: The list of members + """ + + path = '%s/all' % self.path + return self.gitlab.http_list(path, **kwargs) + class ProjectNote(RESTObject): pass -- cgit v1.2.1 From cebbbf67f2529bd9380276ac28abe726d3a57a81 Mon Sep 17 00:00:00 2001 From: Eric Sabouraud Date: Fri, 7 Dec 2018 18:10:41 +0100 Subject: Add access control options to protected branch creation --- gitlab/v4/objects.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gitlab/v4/objects.py') diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index 04444f7..fd673b5 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -3117,7 +3117,10 @@ class ProjectProtectedBranchManager(NoUpdateMixin, RESTManager): _path = '/projects/%(project_id)s/protected_branches' _obj_cls = ProjectProtectedBranch _from_parent_attrs = {'project_id': 'id'} - _create_attrs = (('name', ), ('push_access_level', 'merge_access_level')) + _create_attrs = (('name', ), + ('push_access_level', 'merge_access_level', + 'unprotect_access_level', 'allowed_to_push', + 'allowed_to_merge', 'allowed_to_unprotect')) class ProjectRunner(ObjectDeleteMixin, RESTObject): -- cgit v1.2.1 From 35a6d85acea4776e9c4ad23ff75259481a6bcf8d Mon Sep 17 00:00:00 2001 From: Gauvain Pocentek Date: Sat, 19 Jan 2019 09:13:58 +0100 Subject: fix(api): Don't try to parse raw downloads http_get always tries to interpret the retrieved data if the content-type is json. In some cases (artifact download for instance) this is not the expected behavior. This patch changes http_get and download methods to always get the raw data without parsing. Closes #683 --- gitlab/v4/objects.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'gitlab/v4/objects.py') diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index fd673b5..c3714d8 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -1128,7 +1128,7 @@ class Snippet(UserAgentDetailMixin, SaveMixin, ObjectDeleteMixin, RESTObject): """ path = '/snippets/%s/raw' % self.get_id() result = self.manager.gitlab.http_get(path, streamed=streamed, - **kwargs) + raw=True, **kwargs) return utils.response_content(result, streamed, action, chunk_size) @@ -1365,7 +1365,7 @@ class ProjectJob(RESTObject, RefreshMixin): """ path = '%s/%s/artifacts' % (self.manager.path, self.get_id()) result = self.manager.gitlab.http_get(path, streamed=streamed, - **kwargs) + raw=True, **kwargs) return utils.response_content(result, streamed, action, chunk_size) @cli.register_custom_action('ProjectJob') @@ -1393,7 +1393,7 @@ class ProjectJob(RESTObject, RefreshMixin): """ path = '%s/%s/artifacts/%s' % (self.manager.path, self.get_id(), path) result = self.manager.gitlab.http_get(path, streamed=streamed, - **kwargs) + raw=True, **kwargs) return utils.response_content(result, streamed, action, chunk_size) @cli.register_custom_action('ProjectJob') @@ -1419,7 +1419,7 @@ class ProjectJob(RESTObject, RefreshMixin): """ path = '%s/%s/trace' % (self.manager.path, self.get_id()) result = self.manager.gitlab.http_get(path, streamed=streamed, - **kwargs) + raw=True, **kwargs) return utils.response_content(result, streamed, action, chunk_size) @@ -2654,7 +2654,7 @@ class ProjectFileManager(GetMixin, CreateMixin, UpdateMixin, DeleteMixin, path = '%s/%s/raw' % (self.path, file_path) query_data = {'ref': ref} result = self.gitlab.http_get(path, query_data=query_data, - streamed=streamed, **kwargs) + streamed=streamed, raw=True, **kwargs) return utils.response_content(result, streamed, action, chunk_size) @@ -2897,7 +2897,7 @@ class ProjectSnippet(UserAgentDetailMixin, SaveMixin, ObjectDeleteMixin, """ path = "%s/%s/raw" % (self.manager.path, self.get_id()) result = self.manager.gitlab.http_get(path, streamed=streamed, - **kwargs) + raw=True, **kwargs) return utils.response_content(result, streamed, action, chunk_size) @@ -3174,7 +3174,7 @@ class ProjectExport(RefreshMixin, RESTObject): """ path = '/projects/%d/export/download' % self.project_id result = self.manager.gitlab.http_get(path, streamed=streamed, - **kwargs) + raw=True, **kwargs) return utils.response_content(result, streamed, action, chunk_size) @@ -3315,7 +3315,7 @@ class Project(SaveMixin, ObjectDeleteMixin, RESTObject): """ path = '/projects/%s/repository/blobs/%s/raw' % (self.get_id(), sha) result = self.manager.gitlab.http_get(path, streamed=streamed, - **kwargs) + raw=True, **kwargs) return utils.response_content(result, streamed, action, chunk_size) @cli.register_custom_action('Project', ('from_', 'to')) @@ -3391,7 +3391,8 @@ class Project(SaveMixin, ObjectDeleteMixin, RESTObject): if sha: query_data['sha'] = sha result = self.manager.gitlab.http_get(path, query_data=query_data, - streamed=streamed, **kwargs) + raw=True, streamed=streamed, + **kwargs) return utils.response_content(result, streamed, action, chunk_size) @cli.register_custom_action('Project', ('forked_from_id', )) @@ -3674,7 +3675,7 @@ class Project(SaveMixin, ObjectDeleteMixin, RESTObject): """ path = '/projects/%d/snapshot' % self.get_id() result = self.manager.gitlab.http_get(path, streamed=streamed, - **kwargs) + raw=True, **kwargs) return utils.response_content(result, streamed, action, chunk_size) @cli.register_custom_action('Project', ('scope', 'search')) -- cgit v1.2.1