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
iv
gitlab-ce
Commits
f19bf0ea
Commit
f19bf0ea
authored
Dec 21, 2015
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Import comments on the diff of a GitHub Pull Request into GitLab
parent
223f7f53
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
lib/gitlab/github_import/importer.rb
lib/gitlab/github_import/importer.rb
+16
-0
No files found.
lib/gitlab/github_import/importer.rb
View file @
f19bf0ea
...
...
@@ -81,6 +81,18 @@ module Gitlab
updated_at:
c
.
updated_at
)
end
client
.
pull_request_comments
(
project
.
import_source
,
pull_request
.
number
).
each
do
|
c
|
merge_request
.
notes
.
create!
(
project:
project
,
note:
format_body
(
c
.
user
.
login
,
c
.
body
),
commit_id:
c
.
commit_id
,
line_code:
generate_line_code
(
c
.
path
,
c
.
position
),
author_id:
gl_author_id
(
project
,
c
.
user
.
id
),
created_at:
c
.
created_at
,
updated_at:
c
.
updated_at
)
end
end
end
...
...
@@ -99,6 +111,10 @@ module Gitlab
end
end
def
generate_line_code
(
file_path
,
position
)
Gitlab
::
Diff
::
LineCode
.
generate
(
file_path
,
position
,
0
)
end
def
gl_author_id
(
project
,
github_id
)
gl_user_id
(
github_id
)
||
project
.
creator_id
end
...
...
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