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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
ff44198e
Commit
ff44198e
authored
Jun 14, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
few fixes after refactoring the whole UI stuff
parent
b53ed848
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
10 deletions
+8
-10
app/controllers/import/gitlab_projects_controller.rb
app/controllers/import/gitlab_projects_controller.rb
+3
-3
app/views/projects/imports/show.html.haml
app/views/projects/imports/show.html.haml
+1
-1
lib/gitlab/import_export/importer.rb
lib/gitlab/import_export/importer.rb
+0
-2
lib/gitlab/import_export/relation_factory.rb
lib/gitlab/import_export/relation_factory.rb
+2
-2
lib/gitlab/import_export/shared.rb
lib/gitlab/import_export/shared.rb
+2
-2
No files found.
app/controllers/import/gitlab_projects_controller.rb
View file @
ff44198e
...
@@ -14,7 +14,7 @@ class Import::GitlabProjectsController < Import::BaseController
...
@@ -14,7 +14,7 @@ class Import::GitlabProjectsController < Import::BaseController
@project
=
Gitlab
::
ImportExport
::
ProjectCreator
.
new
(
project_params
[
:namespace_id
],
@project
=
Gitlab
::
ImportExport
::
ProjectCreator
.
new
(
project_params
[
:namespace_id
],
current_user
,
current_user
,
File
.
expand_path
(
params
[
:file
].
path
),
File
.
expand_path
(
p
roject_p
arams
[
:file
].
path
),
project_params
[
:path
]).
execute
project_params
[
:path
]).
execute
if
@project
.
saved?
if
@project
.
saved?
...
@@ -33,7 +33,7 @@ class Import::GitlabProjectsController < Import::BaseController
...
@@ -33,7 +33,7 @@ class Import::GitlabProjectsController < Import::BaseController
private
private
def
file_is_valid?
def
file_is_valid?
p
arams
[
:file
].
respond_to?
(
:read
)
&&
params
[
:file
].
content_type
==
'application/x-gzip'
p
roject_params
[
:file
].
respond_to?
(
:read
)
&&
project_
params
[
:file
].
content_type
==
'application/x-gzip'
end
end
def
verify_project_and_namespace_access
def
verify_project_and_namespace_access
...
@@ -52,7 +52,7 @@ class Import::GitlabProjectsController < Import::BaseController
...
@@ -52,7 +52,7 @@ class Import::GitlabProjectsController < Import::BaseController
def
project_params
def
project_params
params
.
permit
(
params
.
permit
(
:path
,
:namespace_id
,
:path
,
:namespace_id
,
:file
)
)
end
end
end
end
app/views/projects/imports/show.html.haml
View file @
ff44198e
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
Forking in progress.
Forking in progress.
-
else
-
else
Import in progress.
Import in progress.
-
unless
@project
.
forked?
-
unless
@project
.
forked?
||
@project
.
gitlab_project_import?
%p
.monospace
git clone --bare
#{
@project
.
safe_import_url
}
%p
.monospace
git clone --bare
#{
@project
.
safe_import_url
}
%p
Please wait while we import the repository for you. Refresh at will.
%p
Please wait while we import the repository for you. Refresh at will.
:javascript
:javascript
...
...
lib/gitlab/import_export/importer.rb
View file @
ff44198e
...
@@ -15,8 +15,6 @@ module Gitlab
...
@@ -15,8 +15,6 @@ module Gitlab
if
check_version!
&&
[
project_tree
,
repo_restorer
,
wiki_restorer
,
uploads_restorer
].
all?
(
&
:restore
)
if
check_version!
&&
[
project_tree
,
repo_restorer
,
wiki_restorer
,
uploads_restorer
].
all?
(
&
:restore
)
project_tree
.
restored_project
project_tree
.
restored_project
else
else
project_tree
.
restored_project
.
destroy
if
project_tree
.
restored_project
raise
Projects
::
ImportService
::
Error
.
new
,
@shared
.
errors
.
join
(
', '
)
raise
Projects
::
ImportService
::
Error
.
new
,
@shared
.
errors
.
join
(
', '
)
end
end
end
end
...
...
lib/gitlab/import_export/relation_factory.rb
View file @
ff44198e
...
@@ -57,10 +57,10 @@ module Gitlab
...
@@ -57,10 +57,10 @@ module Gitlab
author
=
@relation_hash
.
delete
(
'author'
)
author
=
@relation_hash
.
delete
(
'author'
)
update_note_for_missing_author
(
author
[
'name'
])
if
missing_author?
update_note_for_missing_author
(
author
[
'name'
])
if
missing_author?
(
old_author_id
)
end
end
def
missing_author?
def
missing_author?
(
old_author_id
)
!
admin_user?
||
@members_mapper
.
missing_author_ids
.
include?
(
old_author_id
)
!
admin_user?
||
@members_mapper
.
missing_author_ids
.
include?
(
old_author_id
)
end
end
...
...
lib/gitlab/import_export/shared.rb
View file @
ff44198e
...
@@ -17,13 +17,13 @@ module Gitlab
...
@@ -17,13 +17,13 @@ module Gitlab
error_out
(
error
.
message
,
caller
[
0
].
dup
)
error_out
(
error
.
message
,
caller
[
0
].
dup
)
@errors
<<
error
.
message
@errors
<<
error
.
message
# Debug:
# Debug:
Rails
.
logger
.
error
(
error
.
backtrace
)
logger
.
error
(
error
.
backtrace
)
end
end
private
private
def
error_out
(
message
,
caller
)
def
error_out
(
message
,
caller
)
Rails
.
logger
.
error
(
"Import/Export error raised on
#{
caller
}
:
#{
message
}
"
)
logger
.
error
(
"Import/Export error raised on
#{
caller
}
:
#{
message
}
"
)
end
end
end
end
end
end
...
...
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