Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
bb060393
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bb060393
编写于
7月 17, 2018
作者:
S
Stan Hu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Some formatting cleanup
上级
c16cbed9
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
5 addition
and
9 deletion
+5
-9
lib/gitlab/bitbucket_server_import/importer.rb
lib/gitlab/bitbucket_server_import/importer.rb
+4
-7
lib/gitlab/bitbucket_server_import/project_creator.rb
lib/gitlab/bitbucket_server_import/project_creator.rb
+1
-2
未找到文件。
lib/gitlab/bitbucket_server_import/importer.rb
浏览文件 @
bb060393
...
...
@@ -230,9 +230,7 @@ module Gitlab
def
create_diff_note
(
merge_request
,
comment
,
position
,
discussion_id
=
nil
)
attributes
=
pull_request_comment_attributes
(
comment
)
attributes
.
merge!
(
position:
position
,
type:
'DiffNote'
)
attributes
.
merge!
(
position:
position
,
type:
'DiffNote'
)
attributes
[
:discussion_id
]
=
discussion_id
if
discussion_id
note
=
merge_request
.
notes
.
build
(
attributes
)
...
...
@@ -242,16 +240,15 @@ module Gitlab
return
note
end
# Fallback to a regular comment
# Bitbucket Server supports the ability to comment on any line, not just the
# line in the diff. If we can't add the note as a DiffNote, fallback to creating
# a regular note.
create_fallback_diff_note
(
merge_request
,
comment
)
rescue
StandardError
=>
e
errors
<<
{
type: :pull_request
,
id:
comment
.
id
,
errors:
e
.
message
}
nil
end
# Bitbucket Server supports the ability to comment on any line, not just the
# line in the diff. If we can't add the note as a DiffNote, fallback to creating
# a regular note.
def
create_fallback_diff_note
(
merge_request
,
comment
)
attributes
=
pull_request_comment_attributes
(
comment
)
attributes
[
:note
]
=
"Comment on file:
#{
comment
.
file_path
}
, old position:
#{
comment
.
old_pos
}
, new_position:
#{
comment
.
new_pos
}
\n\n
"
+
attributes
[
:note
]
...
...
lib/gitlab/bitbucket_server_import/project_creator.rb
浏览文件 @
bb060393
...
...
@@ -26,8 +26,7 @@ module Gitlab
import_url:
repo
.
clone_url
,
import_data:
{
credentials:
session_data
,
data:
{
project_key:
project_key
,
repo_slug:
repo_slug
}
data:
{
project_key:
project_key
,
repo_slug:
repo_slug
}
},
skip_wiki:
true
).
execute
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录