|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
|
|
|
|
|
class PullRequestsController < ApplicationController
|
|
|
|
|
before_filter :find_project_and_repository
|
|
|
|
|
before_filter :connect_gitlab, :only => [:index, :show, :create, :accept_pull_request, :pull_request_commits, :pull_request_changes, :new]
|
|
|
|
|
before_filter :connect_gitlab, :only => [:index, :show, :create, :accept_pull_request, :pull_request_commits, :pull_request_changes, :new, :update_pull_request]
|
|
|
|
|
layout "base_projects"
|
|
|
|
|
include PullRequestsHelper
|
|
|
|
|
include ApplicationHelper
|
|
|
|
@ -107,6 +107,18 @@ class PullRequestsController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 更新请求的状态state => cloesed
|
|
|
|
|
def update_pull_request
|
|
|
|
|
begin
|
|
|
|
|
@g.update_merge_request(@project.gpid, params[:id], :state_event => params[:state])
|
|
|
|
|
respond_to do |format|
|
|
|
|
|
format.html{redirect_to project_pull_request_path(params[:id], :project_id => @project.id)}
|
|
|
|
|
end
|
|
|
|
|
rescue Exception => e
|
|
|
|
|
@message = e.message
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 获取某次请求的提交次数
|
|
|
|
|
def pull_request_commits
|
|
|
|
|
@type = parms[:type]
|
|
|
|
|