Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
8a9c8156
Commit
8a9c8156
authored
Nov 11, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add "Mirror repository" checkbox to new project form.
parent
afeb32eb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
4 deletions
+17
-4
app/controllers/projects/imports_controller.rb
app/controllers/projects/imports_controller.rb
+5
-3
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+2
-1
app/views/shared/_import_form.html.haml
app/views/shared/_import_form.html.haml
+10
-0
No files found.
app/controllers/projects/imports_controller.rb
View file @
8a9c8156
...
...
@@ -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
app/controllers/projects_controller.rb
View file @
8a9c8156
...
...
@@ -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
...
...
app/views/shared/_import_form.html.haml
View file @
8a9c8156
...
...
@@ -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.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment