Skip to content

Commit 62297a8

Browse files
committed
Add support for upcoming Commit API changes (in 6.1)
Add Project.get_commit() and Commit.diff() support. (doc already updated)
1 parent 0888f25 commit 62297a8

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

gitlab3/_api_definition.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -363,11 +363,18 @@ class File(APIDefinition):
363363
]
364364

365365
class Commit(APIDefinition):
366-
url = '/repository/commits'
367-
actions = [ _LIST ]
366+
url = '/repository/commits/:sha'
367+
actions = [ _LIST, _GET ]
368368
optional_params = [
369369
'ref_name',
370370
]
371+
class DiffAction(ExtraActionDefinition):
372+
"""gl.Project.Commit.diff()"""
373+
url = '/diff'
374+
method = _HTTP_GET
375+
class GetDiffAction(DiffAction):
376+
pass
377+
extra_actions = [ DiffAction, GetDiffAction ]
371378

372379
class WallNote(Note):
373380
@classmethod

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
setup(
99
name='gitlab3',
10-
version='0.4.0',
10+
version='0.4.1',
1111
license='LGPLv3',
1212
description='GitLab API v3 Python Wrapper.',
1313
long_description='A complete Python client/wrapper for GitLab API v3',

0 commit comments

Comments
 (0)