diff options
author | Gauvain Pocentek <gauvain@pocentek.net> | 2017-08-20 21:42:38 +0200 |
---|---|---|
committer | Gauvain Pocentek <gauvain@pocentek.net> | 2017-08-20 21:42:38 +0200 |
commit | cda2d59e13bfa48447f2a1b999a2538f6baf83f5 (patch) | |
tree | f41839b3004321e2e1baf506fb102e7e2dd7dfa5 /gitlab | |
parent | f00562c7682875930b505fac0b1fc7e19ab1358c (diff) | |
download | gitlab-cda2d59e13bfa48447f2a1b999a2538f6baf83f5.tar.gz |
[v4] Fix the CLI for project files
Diffstat (limited to 'gitlab')
-rw-r--r-- | gitlab/v4/objects.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index 641db82..d4e9e63 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -1374,6 +1374,7 @@ class ProjectFileManager(GetMixin, CreateMixin, UpdateMixin, DeleteMixin, _update_attrs = (('file_path', 'branch', 'content', 'commit_message'), ('encoding', 'author_email', 'author_name')) + @cli.register_custom_action('ProjectFileManager', ('file_path', 'ref')) def get(self, file_path, ref, **kwargs): """Retrieve a single file. @@ -1392,6 +1393,10 @@ class ProjectFileManager(GetMixin, CreateMixin, UpdateMixin, DeleteMixin, file_path = file_path.replace('/', '%2F') return GetMixin.get(self, file_path, ref=ref, **kwargs) + @cli.register_custom_action('ProjectFileManager', + ('file_path', 'branch', 'content', + 'commit_message'), + ('encoding', 'author_email', 'author_name')) @exc.on_http_error(exc.GitlabCreateError) def create(self, data, **kwargs): """Create a new object. @@ -1416,6 +1421,8 @@ class ProjectFileManager(GetMixin, CreateMixin, UpdateMixin, DeleteMixin, server_data = self.gitlab.http_post(path, post_data=data, **kwargs) return self._obj_cls(self, server_data) + @cli.register_custom_action('ProjectFileManager', ('file_path', 'branch', + 'commit_message')) @exc.on_http_error(exc.GitlabDeleteError) def delete(self, file_path, branch, commit_message, **kwargs): """Delete a file on the server. |