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
37e363c9
Commit
37e363c9
authored
Jul 14, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed similar issue with gitlab.com importer because why not!
parent
b1ab079f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
25 deletions
+28
-25
lib/gitlab/gitlab_import/importer.rb
lib/gitlab/gitlab_import/importer.rb
+28
-25
No files found.
lib/gitlab/gitlab_import/importer.rb
View file @
37e363c9
...
...
@@ -15,32 +15,35 @@ module Gitlab
end
def
execute
project_identifier
=
CGI
.
escape
(
project
.
import_source
)
# Issues && Comments
issues
=
client
.
issues
(
project_identifier
)
issues
.
each
do
|
issue
|
body
=
@formatter
.
author_line
(
issue
[
"author"
][
"name"
])
body
+=
issue
[
"description"
]
comments
=
client
.
issue_comments
(
project_identifier
,
issue
[
"id"
])
if
comments
.
any?
body
+=
@formatter
.
comments_header
ActiveRecord
::
Base
.
no_touching
do
project_identifier
=
CGI
.
escape
(
project
.
import_source
)
# Issues && Comments
issues
=
client
.
issues
(
project_identifier
)
issues
.
each
do
|
issue
|
body
=
@formatter
.
author_line
(
issue
[
"author"
][
"name"
])
body
+=
issue
[
"description"
]
comments
=
client
.
issue_comments
(
project_identifier
,
issue
[
"id"
])
if
comments
.
any?
body
+=
@formatter
.
comments_header
end
comments
.
each
do
|
comment
|
body
+=
@formatter
.
comment
(
comment
[
"author"
][
"name"
],
comment
[
"created_at"
],
comment
[
"body"
])
end
project
.
issues
.
create!
(
iid:
issue
[
"iid"
],
description:
body
,
title:
issue
[
"title"
],
state:
issue
[
"state"
],
updated_at:
issue
[
"updated_at"
],
author_id:
gl_user_id
(
project
,
issue
[
"author"
][
"id"
])
)
end
comments
.
each
do
|
comment
|
body
+=
@formatter
.
comment
(
comment
[
"author"
][
"name"
],
comment
[
"created_at"
],
comment
[
"body"
])
end
project
.
issues
.
create!
(
iid:
issue
[
"iid"
],
description:
body
,
title:
issue
[
"title"
],
state:
issue
[
"state"
],
author_id:
gl_user_id
(
project
,
issue
[
"author"
][
"id"
])
)
end
true
...
...
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