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
Boxiang Sun
gitlab-ce
Commits
8ff9fc55
Commit
8ff9fc55
authored
Sep 03, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some more refactoring
parent
d3348474
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
18 deletions
+5
-18
lib/gitlab/import_export/project_tree_restorer.rb
lib/gitlab/import_export/project_tree_restorer.rb
+4
-17
lib/gitlab/import_export/shared.rb
lib/gitlab/import_export/shared.rb
+1
-1
No files found.
lib/gitlab/import_export/project_tree_restorer.rb
View file @
8ff9fc55
...
@@ -62,21 +62,6 @@ module Gitlab
...
@@ -62,21 +62,6 @@ module Gitlab
relation_hash_list
=
@tree_hash
[
relation_key
.
to_s
]
relation_hash_list
=
@tree_hash
[
relation_key
.
to_s
]
save_relation_hash
(
relation_hash_list
,
relation_key
)
save_relation_hash
(
relation_hash_list
,
relation_key
)
end
end
# relation_key = relation.is_a?(Hash) ? relation.keys.first : relation
# relation_hash_list = @tree_hash[relation_key.to_s]
#
# next unless relation_hash_list
#
# if relation_hash_list.is_a?(Array)
# [relation_hash_list].flatten.each_slice(15) do |relation_hash_batch|
# save_relation_hash(relation_hash_batch, relation_key, saved)
# end
# else
# save_relation_hash(relation_hash_list, relation_key, saved)
# end
end
end
@saved
.
all?
@saved
.
all?
end
end
...
@@ -123,6 +108,7 @@ module Gitlab
...
@@ -123,6 +108,7 @@ module Gitlab
tree_array
=
[
tree_hash
[
relation_key
]].
flatten
tree_array
=
[
tree_hash
[
relation_key
]].
flatten
while
relation_item
=
tree_array
.
shift
while
relation_item
=
tree_array
.
shift
Project
.
transaction
do
process_sub_relation
(
relation
,
relation_item
)
process_sub_relation
(
relation
,
relation_item
)
if
save
if
save
...
@@ -130,6 +116,7 @@ module Gitlab
...
@@ -130,6 +116,7 @@ module Gitlab
tree_hash
[
relation_key
].
delete
(
relation_item
)
tree_hash
[
relation_key
].
delete
(
relation_item
)
end
end
end
end
end
tree_hash
.
delete
(
relation_key
)
if
save
tree_hash
.
delete
(
relation_key
)
if
save
end
end
...
...
lib/gitlab/import_export/shared.rb
View file @
8ff9fc55
...
@@ -16,7 +16,7 @@ module Gitlab
...
@@ -16,7 +16,7 @@ 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
)
Rails
.
logger
.
error
(
error
.
backtrace
.
join
(
"
\n
"
)
)
end
end
private
private
...
...
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