Commit e1ab530f authored by James Lopez's avatar James Lopez

Merge branch 'feature/project-import' of gitlab.com:gitlab-org/gitlab-ce into...

Merge branch 'feature/project-import' of gitlab.com:gitlab-org/gitlab-ce into feature/project-export-ui-experimental
parents 7ea68d00 27991525
......@@ -53,11 +53,19 @@ module Gitlab
def update_project_references(relation_hash, klass)
project_id = relation_hash.delete('project_id')
if relation_hash['source_project_id'] && relation_hash['target_project_id']
# If source and target are the same, populate them with the new project ID.
if relation_hash['target_project_id'] == relation_hash['source_project_id']
relation_hash['source_project_id'] = project_id
else
relation_hash['source_project_id'] = -1
end
end
relation_hash['target_project_id'] = project_id if relation_hash['target_project_id']
# project_id may not be part of the export, but we always need to populate it if required.
relation_hash['project_id'] = project_id if klass.column_names.include?('project_id')
relation_hash['gl_project_id'] = project_id if relation_hash ['gl_project_id']
relation_hash['target_project_id'] = project_id if relation_hash['target_project_id']
relation_hash['source_project_id'] = -1 if relation_hash['source_project_id']
end
def relation_class(relation_sym)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment