mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-15 15:46:08 +10:00
Add "Mirror repository" checkbox to new project form.
This commit is contained in:
@@ -8,9 +8,7 @@ class Projects::ImportsController < Projects::ApplicationController
|
||||
end
|
||||
|
||||
def create
|
||||
@project.import_url = params[:project][:import_url]
|
||||
|
||||
if @project.save
|
||||
if @project.update_attributes(import_params)
|
||||
@project.reload
|
||||
|
||||
if @project.import_failed?
|
||||
@@ -48,4 +46,8 @@ class Projects::ImportsController < Projects::ApplicationController
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
def import_params
|
||||
params.require(:project).permit(:import_url, :mirror)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -216,6 +216,7 @@ class ProjectsController < ApplicationController
|
||||
:issues_enabled, :merge_requests_enabled, :snippets_enabled, :issues_tracker_id, :default_branch,
|
||||
:wiki_enabled, :issues_template, :merge_requests_template, :visibility_level, :merge_requests_rebase_enabled,
|
||||
:import_url, :last_activity_at, :namespace_id, :avatar,
|
||||
:mirror,
|
||||
:approvals_before_merge, :approver_ids, :reset_approvals_on_push, :merge_requests_ff_only_enabled
|
||||
)
|
||||
end
|
||||
@@ -245,7 +246,7 @@ class ProjectsController < ApplicationController
|
||||
project.repository_exists? && !project.empty_repo?
|
||||
end
|
||||
|
||||
# Override get_id from ExtractsPath, which returns the branch and file path
|
||||
# Override get_id from ExtractsPath, which returns the branch and file path
|
||||
# for the blob/tree, which in this case is just the root of the default branch.
|
||||
def get_id
|
||||
project.repository.root_ref
|
||||
|
||||
@@ -14,3 +14,13 @@
|
||||
The import will time out after 4 minutes. For big repositories, use a clone/push combination.
|
||||
%li
|
||||
To migrate an SVN repository, check out #{link_to "this document", "http://doc.gitlab.com/ce/workflow/importing/migrating_from_svn.html"}.
|
||||
|
||||
.form-group
|
||||
.col-sm-offset-2.col-sm-10
|
||||
.checkbox
|
||||
= f.label :mirror do
|
||||
= f.check_box :mirror
|
||||
%strong
|
||||
Mirror repository
|
||||
.help-block
|
||||
Automatically update this project's branches and tags from the upstream repository every hour.
|
||||
|
||||
Reference in New Issue
Block a user