Skip to content

Commit ac589a6

Browse files
committed
🌟 Updates to support newer python-gitlab
1 parent c32a289 commit ac589a6

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

git_repo/services/ext/gitlab.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def gist_fetch(self, snippet, fname=None):
182182
except Exception as err:
183183
raise ResourceNotFoundError('Could not find snippet') from err
184184

185-
return snippet.raw().decode('utf-8')
185+
return snippet.content().decode('utf-8')
186186

187187
def gist_clone(self, gist):
188188
raise ArgumentError('Snippets cannot be cloned in gitlab.')
@@ -302,15 +302,14 @@ def request_create(self, onto_user, onto_repo, from_branch, onto_branch, title=N
302302
if not title and not description:
303303
raise ArgumentError('Missing message for request creation')
304304

305-
request = self.gl.project_mergerequests.create(
306-
project_id=from_project.id,
307-
data={
308-
'source_branch': from_branch,
309-
'target_branch': onto_branch,
310-
'target_project_id': onto_project.id,
311-
'title': title,
312-
'description': description
313-
}
305+
request = self.gl.projects.get(project.id).mergerequests.create(
306+
{
307+
'source_branch': from_branch,
308+
'target_branch': onto_branch,
309+
'target_project_id': onto_project.id,
310+
'title': title,
311+
'description': description
312+
}
314313
)
315314

316315
yield '{}'
@@ -331,7 +330,7 @@ def request_list(self, user, repo):
331330
project = self.gl.projects.get('/'.join([user, repo]))
332331
yield "{:>3}\t{:<60}\t{:2}"
333332
yield ('id', 'title', 'URL')
334-
for mr in self.gl.project_mergerequests.list(project_id=project.id):
333+
for mr in self.gl.projects.get(project.id).mergerequests.list() :
335334
yield ( str(mr.iid),
336335
mr.title,
337336
mr.web_url

0 commit comments

Comments
 (0)