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
Tatuya Kamada
gitlab-ce
Commits
223f7f53
Commit
223f7f53
authored
Dec 21, 2015
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Import comments on GitHub Pull Request into GitLab
parent
95f1fe72
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
lib/gitlab/github_import/importer.rb
lib/gitlab/github_import/importer.rb
+14
-0
No files found.
lib/gitlab/github_import/importer.rb
View file @
223f7f53
...
@@ -71,9 +71,23 @@ module Gitlab
...
@@ -71,9 +71,23 @@ module Gitlab
created_at:
pull_request
.
created_at
,
created_at:
pull_request
.
created_at
,
updated_at:
pull_request
.
updated_at
updated_at:
pull_request
.
updated_at
)
)
client
.
issue_comments
(
project
.
import_source
,
pull_request
.
number
).
each
do
|
c
|
merge_request
.
notes
.
create!
(
project:
project
,
note:
format_body
(
c
.
user
.
login
,
c
.
body
),
author_id:
gl_author_id
(
project
,
c
.
user
.
id
),
created_at:
c
.
created_at
,
updated_at:
c
.
updated_at
)
end
end
end
end
end
def
format_body
(
author
,
body
)
@formatter
.
author_line
(
author
)
+
(
body
||
""
)
end
def
merge_request_state
(
pull_request
)
def
merge_request_state
(
pull_request
)
case
true
case
true
when
pull_request
.
state
==
'closed'
&&
pull_request
.
merged_at
.
present?
when
pull_request
.
state
==
'closed'
&&
pull_request
.
merged_at
.
present?
...
...
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