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
Léo-Paul Géneau
gitlab-ce
Commits
4ffcd427
Commit
4ffcd427
authored
Apr 12, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
import working!
parent
dbf755ae
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
app/services/projects/import_export/project_tree_restorer.rb
app/services/projects/import_export/project_tree_restorer.rb
+1
-2
app/services/projects/import_export/relation_factory.rb
app/services/projects/import_export/relation_factory.rb
+2
-1
No files found.
app/services/projects/import_export/project_tree_restorer.rb
View file @
4ffcd427
...
...
@@ -74,9 +74,8 @@ module Projects
relation
.
values
.
flatten
.
each
do
|
sub_relation
|
relation_hash
=
relation_item
[
sub_relation
.
to_s
]
next
if
relation_hash
.
blank?
relation_hash
.
merge!
(
'project_id'
=>
project
.
id
)
if
sub_relation
==
:merge_requests
sub_relation_object
=
Projects
::
ImportExport
::
RelationFactory
.
create
(
relation_sym:
sub_relation
,
relation_hash:
relation_hash
,
members_map:
members_map
)
relation_sym:
sub_relation
,
relation_hash:
relation_hash
.
merge!
(
'project_id'
=>
project
.
id
)
,
members_map:
members_map
)
relation_item
[
sub_relation
.
to_s
]
=
sub_relation_object
end
end
...
...
app/services/projects/import_export/relation_factory.rb
View file @
4ffcd427
...
...
@@ -3,7 +3,7 @@ module Projects
module
RelationFactory
extend
self
OVERRIDES
=
{
snippets: :project_snippets
}.
freeze
OVERRIDES
=
{
snippets: :project_snippets
,
commit:
'Ci::Commit'
}.
freeze
USER_REFERENCES
=
%w(author_id assignee_id updated_by_id)
.
freeze
def
create
(
relation_sym
:,
relation_hash
:,
members_map
:)
...
...
@@ -11,6 +11,7 @@ module Projects
relation_sym
=
parse_relation_sym
(
relation_sym
)
klass
=
relation_class
(
relation_sym
)
relation_hash
.
delete
(
'id'
)
#screw IDs for now
relation_hash
.
delete
(
'project_id'
)
unless
klass
.
column_names
.
include?
(
:project_id
)
handle_merge_requests
(
relation_hash
)
if
relation_sym
==
:merge_requests
update_user_references
(
relation_hash
,
members_map
)
imported_object
=
klass
.
new
(
relation_hash
)
...
...
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