From dffef9d65a54a5c31547ac425c521554dcef647d Mon Sep 17 00:00:00 2001 From: xarx00 Date: Tue, 5 Mar 2019 17:27:30 +0100 Subject: [PATCH 1/6] fix for issue #718 --- gitlab/v4/cli.py | 6 +++++- gitlab/v4/objects.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gitlab/v4/cli.py b/gitlab/v4/cli.py index 242874d1a..728536844 100644 --- a/gitlab/v4/cli.py +++ b/gitlab/v4/cli.py @@ -230,7 +230,11 @@ def _populate_sub_parser_by_class(cls, sub_parser): for x in required if x != cls._id_attr] [sub_parser_action.add_argument("--%s" % x.replace('_', '-'), required=False) - for x in optional if x != cls._id_attr] + for x in optional if x != cls._id_attr + and x not in ['recursive']] + [sub_parser_action.add_argument("--%s" % x, action='store_true', + required=False) + for x in optional if x in ['recursive']] if mgr_cls.__name__ in cli.custom_actions: name = mgr_cls.__name__ diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index c3f8a8154..006fd3261 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -3282,7 +3282,7 @@ class Project(SaveMixin, ObjectDeleteMixin, RESTObject): ('wikis', 'ProjectWikiManager'), ) - @cli.register_custom_action('Project', tuple(), ('path', 'ref')) + @cli.register_custom_action('Project', tuple(), ('path', 'ref', 'recursive')) @exc.on_http_error(exc.GitlabGetError) def repository_tree(self, path='', ref='', recursive=False, **kwargs): """Return a list of files in the repository. From de86c251d4fdcda728add8a607c1436aef00b17e Mon Sep 17 00:00:00 2001 From: xarx00 Date: Tue, 5 Mar 2019 17:39:36 +0100 Subject: [PATCH 2/6] fix for PEP8: E501 line too long --- gitlab/v4/objects.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index 006fd3261..e1f388f81 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -3282,7 +3282,8 @@ class Project(SaveMixin, ObjectDeleteMixin, RESTObject): ('wikis', 'ProjectWikiManager'), ) - @cli.register_custom_action('Project', tuple(), ('path', 'ref', 'recursive')) + @cli.register_custom_action('Project', tuple(), + ('path', 'ref', 'recursive')) @exc.on_http_error(exc.GitlabGetError) def repository_tree(self, path='', ref='', recursive=False, **kwargs): """Return a list of files in the repository. From 05b8ef80c62d6772ae096927acb69b0f89649a4f Mon Sep 17 00:00:00 2001 From: xarx00 Date: Tue, 5 Mar 2019 17:48:18 +0100 Subject: [PATCH 3/6] Fix for PEP8: E127 continuation line over-indented for visual indent --- gitlab/v4/objects.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index e1f388f81..b21cf1676 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -3282,7 +3282,7 @@ class Project(SaveMixin, ObjectDeleteMixin, RESTObject): ('wikis', 'ProjectWikiManager'), ) - @cli.register_custom_action('Project', tuple(), + @cli.register_custom_action('Project', tuple(), ('path', 'ref', 'recursive')) @exc.on_http_error(exc.GitlabGetError) def repository_tree(self, path='', ref='', recursive=False, **kwargs): From e3a76505b242656a05e4cc76a93b7f0898fcc4c1 Mon Sep 17 00:00:00 2001 From: xarx00 Date: Tue, 5 Mar 2019 17:58:09 +0100 Subject: [PATCH 4/6] Fix for PEP8: E127 continuation line over-indented for visual indent --- gitlab/v4/objects.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index b21cf1676..f1faff7a5 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -3283,7 +3283,7 @@ class Project(SaveMixin, ObjectDeleteMixin, RESTObject): ) @cli.register_custom_action('Project', tuple(), - ('path', 'ref', 'recursive')) + ('path', 'ref', 'recursive')) @exc.on_http_error(exc.GitlabGetError) def repository_tree(self, path='', ref='', recursive=False, **kwargs): """Return a list of files in the repository. From 6f94ced395d3c9df3c673d5afa966d4f4e6c6af5 Mon Sep 17 00:00:00 2001 From: xarx00 Date: Tue, 5 Mar 2019 18:07:38 +0100 Subject: [PATCH 5/6] Fix for PEP8: E127 continuation line over-indented for visual indent --- gitlab/v4/cli.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gitlab/v4/cli.py b/gitlab/v4/cli.py index 728536844..c76ce9a09 100644 --- a/gitlab/v4/cli.py +++ b/gitlab/v4/cli.py @@ -230,8 +230,7 @@ def _populate_sub_parser_by_class(cls, sub_parser): for x in required if x != cls._id_attr] [sub_parser_action.add_argument("--%s" % x.replace('_', '-'), required=False) - for x in optional if x != cls._id_attr - and x not in ['recursive']] + for x in optional if x != cls._id_attr and x not in ['recursive']] [sub_parser_action.add_argument("--%s" % x, action='store_true', required=False) for x in optional if x in ['recursive']] From 965b3e041c02ffe2047ba87ca00dc6f94a773822 Mon Sep 17 00:00:00 2001 From: xarx00 Date: Fri, 8 Mar 2019 14:26:51 +0100 Subject: [PATCH 6/6] Changes in cli.py reverted --- gitlab/v4/cli.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/gitlab/v4/cli.py b/gitlab/v4/cli.py index c76ce9a09..242874d1a 100644 --- a/gitlab/v4/cli.py +++ b/gitlab/v4/cli.py @@ -230,10 +230,7 @@ def _populate_sub_parser_by_class(cls, sub_parser): for x in required if x != cls._id_attr] [sub_parser_action.add_argument("--%s" % x.replace('_', '-'), required=False) - for x in optional if x != cls._id_attr and x not in ['recursive']] - [sub_parser_action.add_argument("--%s" % x, action='store_true', - required=False) - for x in optional if x in ['recursive']] + for x in optional if x != cls._id_attr] if mgr_cls.__name__ in cli.custom_actions: name = mgr_cls.__name__