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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
5817c670
Commit
5817c670
authored
Jun 28, 2018
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Import threaded discussions in diffs
parent
ea727862
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
6 deletions
+21
-6
lib/gitlab/bitbucket_server_import/importer.rb
lib/gitlab/bitbucket_server_import/importer.rb
+21
-6
No files found.
lib/gitlab/bitbucket_server_import/importer.rb
View file @
5817c670
...
...
@@ -135,7 +135,23 @@ module Gitlab
end
inline_comments
.
each
do
|
comment
|
begin
parent
=
build_diff_note
(
merge_request
,
comment
,
line_code_map
)
next
unless
parent
&
.
persisted?
comment
.
comments
.
each
do
|
reply
|
attributes
=
pull_request_comment_attributes
(
reply
)
attributes
.
merge!
(
position:
build_position
(
merge_request
,
comment
),
line_code:
line_code_map
.
fetch
(
reply
.
id
)
discussion_id:
parent
.
discussion_id
,
type:
'DiffNote'
)
merge_request
.
notes
.
create!
(
attributes
)
end
end
end
def
build_diff_note
(
merge_request
,
comment
,
line_code_map
)
attributes
=
pull_request_comment_attributes
(
comment
)
attributes
.
merge!
(
position:
build_position
(
merge_request
,
comment
),
...
...
@@ -145,8 +161,7 @@ module Gitlab
merge_request
.
notes
.
create!
(
attributes
)
rescue
StandardError
=>
e
errors
<<
{
type: :pull_request
,
id:
comment
.
id
,
errors:
e
.
message
}
end
end
nil
end
def
build_position
(
merge_request
,
pr_comment
)
...
...
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