diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py index 7a68975..42d1c19 100644 --- a/pagure/lib/__init__.py +++ b/pagure/lib/__init__.py @@ -1507,7 +1507,8 @@ def new_pull_request(session, branch_from, requestfolder, initial_comment=None, repo_from=None, remote_git=None, requestuid=None, requestid=None, - status='Open', notify=True): + status='Open', notify=True, + commit_start=None, commit_stop=None): ''' Create a new pull request on the specified repo. ''' if not repo_from and not remote_git: raise pagure.exceptions.PagureException( @@ -1528,6 +1529,8 @@ def new_pull_request(session, branch_from, initial_comment=initial_comment or None, user_id=user_obj.id, status=status, + commit_start=commit_start, + commit_stop=commit_stop, ) request.last_updated = datetime.datetime.utcnow() diff --git a/pagure/ui/fork.py b/pagure/ui/fork.py index d8f90e3..c944d03 100644 --- a/pagure/ui/fork.py +++ b/pagure/ui/fork.py @@ -1061,6 +1061,10 @@ def new_request_pull( orig_commit = orig_commit.oid.hex initial_comment = form.initial_comment.data.strip() or None + commit_start = commit_stop = None + if diff_commits: + commit_stop = diff_commits[0].oid.hex + commit_start = diff_commits[-1].oid.hex request = pagure.lib.new_pull_request( SESSION, repo_to=parent, @@ -1071,6 +1075,8 @@ def new_request_pull( initial_comment=initial_comment, user=flask.g.fas_user.username, requestfolder=APP.config['REQUESTS_FOLDER'], + commit_start=commit_start, + commit_stop=commit_stop, ) try: