From 83791f3ef17f5d14df3c705b6bb10eb508ca4501 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Mar 20 2015 17:27:09 +0000 Subject: Add a method in the internal API to retrieve comments made on pull-request --- diff --git a/progit/lib/__init__.py b/progit/lib/__init__.py index cd49946..5baf550 100644 --- a/progit/lib/__init__.py +++ b/progit/lib/__init__.py @@ -978,6 +978,19 @@ def get_issue_comment(session, issue_uid, comment_id): return query.first() +def get_request_comment(session, request_uid, comment_id): + ''' Return a specific comment of a specified issue. + ''' + query = session.query( + model.PullRequestComment + ).filter( + model.PullRequestComment.pull_request_uid == request_uid + ).filter( + model.PullRequestComment.id == comment_id + ) + + return query.first() + def get_issue_by_uid(session, issue_uid): ''' Return the issue corresponding to the specified unique identifier.