Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
0267a645
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,发现更多精彩内容 >>
提交
0267a645
编写于
7月 31, 2016
作者:
F
Fatih Acet
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove CS MergeConflictResolver class.
上级
4d8b0293
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
0 addition
and
576 deletion
+0
-576
app/assets/javascripts/merge_conflict_resolver.js.coffee
app/assets/javascripts/merge_conflict_resolver.js.coffee
+0
-171
app/assets/javascripts/merge_conflicts_data.coffee
app/assets/javascripts/merge_conflicts_data.coffee
+0
-405
未找到文件。
app/assets/javascripts/merge_conflict_resolver.js.coffee
已删除
100644 → 0
浏览文件 @
4d8b0293
#= require lib/vue
class
window
.
MergeConflictResolver
extends
Vue
constructor
:
(
options
=
{})
->
options
.
el
=
'#conflicts'
options
.
data
=
@
getInitialData
()
options
.
name
=
'MergeConflictResolver'
options
.
created
=
->
@
fetchData
()
options
.
computed
=
conflictsCount
:
->
@
getConflictsCount
()
resolvedCount
:
->
@
getResolvedCount
()
allResolved
:
->
@
isAllResolved
()
super
options
window
.
v
=
this
fetchData
:
->
$
.
ajax
url
:
'./conflicts.json'
success
:
(
response
)
=>
@
handleResponse
response
handleResponse
:
(
data
)
->
@
isLoading
=
no
@
conflictsData
=
@
decorateData
data
handleViewTypeChange
:
(
newType
)
->
return
if
newType
is
@
diffView
return
unless
newType
in
[
'parallel'
,
'inline'
]
@
diffView
=
newType
$
.
cookie
'diff_view'
,
newType
@
isParallel
=
@
diffView
is
'parallel'
# FIXME: Maybe even better with vue.js
$
(
'.container-fluid'
).
toggleClass
'container-limited'
handleSelected
:
(
sectionId
,
selection
)
->
@
resolutionData
[
sectionId
]
=
selection
#FIXME: Dry!!
for
file
in
@
conflictsData
.
files
for
line
in
file
.
inlineLines
if
line
.
id
is
sectionId
and
(
line
.
conflict
or
line
.
isHeader
)
if
selection
is
'head'
and
line
.
isHead
line
.
isSelected
=
yes
line
.
isUnselected
=
no
else
if
selection
is
'origin'
and
line
.
isOrigin
line
.
isSelected
=
yes
line
.
isUnselected
=
no
else
line
.
isUnselected
=
yes
line
.
isSelected
=
no
for
section
,
lines
of
file
.
parallelLines
for
line
in
lines
if
line
.
id
is
sectionId
and
(
line
.
lineType
is
'conflict'
or
line
.
isHeader
)
if
selection
is
'head'
and
line
.
isHead
line
.
isSelected
=
yes
line
.
isUnselected
=
no
else
if
selection
is
'origin'
and
line
.
isOrigin
line
.
isSelected
=
yes
line
.
isUnselected
=
no
else
line
.
isUnselected
=
yes
line
.
isSelected
=
no
decorateData
:
(
data
)
->
headHeaderText
=
'HEAD//our changes'
originHeaderText
=
'origin//their changes'
data
.
shortCommitSha
=
data
.
commit_sha
.
slice
0
,
7
data
.
commitMessage
=
data
.
commit_message
@
updateResolutionsData
data
# FIXME: Add comments and separate parallel and inline data decoration
for
file
in
data
.
files
file
.
parallelLines
=
{
left
:
[],
right
:
[]
}
file
.
inlineLines
=
[]
currentLineType
=
'old'
for
section
in
file
.
sections
{
conflict
,
lines
,
id
}
=
section
if
conflict
# FIXME: Make these lines better
file
.
parallelLines
.
left
.
push
{
isHeader
:
yes
,
id
,
richText
:
headHeaderText
,
section
:
'head'
,
isHead
:
yes
,
isSelected
:
no
,
isUnselected
:
no
}
file
.
parallelLines
.
right
.
push
{
isHeader
:
yes
,
id
,
richText
:
originHeaderText
,
section
:
'origin'
,
isOrigin
:
yes
,
isSelected
:
no
,
isUnselected
:
no
}
file
.
inlineLines
.
push
{
isHeader
:
yes
,
id
,
richText
:
headHeaderText
,
type
:
'old'
,
section
:
'head'
,
isHead
:
yes
,
isSelected
:
no
,
isUnselected
:
no
}
for
line
in
lines
if
line
.
type
in
[
'new'
,
'old'
]
and
currentLineType
isnt
line
.
type
currentLineType
=
line
.
type
# FIXME: Find a better way to add a new line
file
.
inlineLines
.
push
{
lineType
:
'emptyLine'
,
richText
:
'<span> </span>'
}
# FIXME: Make these lines better
line
.
conflict
=
conflict
line
.
id
=
id
line
.
isHead
=
line
.
type
is
'new'
line
.
isOrigin
=
line
.
type
is
'old'
line
.
isSelected
=
no
line
.
isUnselected
=
no
line
.
richText
=
line
.
rich_text
file
.
inlineLines
.
push
line
if
conflict
if
line
.
type
is
'old'
line
=
{
lineType
:
'conflict'
,
lineNumber
:
line
.
old_line
,
richText
:
line
.
rich_text
,
section
:
'head'
,
id
,
isSelected
:
no
,
isUnselected
:
no
,
isHead
:
yes
}
file
.
parallelLines
.
left
.
push
line
else
if
line
.
type
is
'new'
line
=
{
lineType
:
'conflict'
,
lineNumber
:
line
.
new_line
,
richText
:
line
.
rich_text
,
section
:
'origin'
,
id
,
isSelected
:
no
,
isUnselected
:
no
,
isOrigin
:
yes
}
file
.
parallelLines
.
right
.
push
line
else
console
.
log
'unhandled line type...'
,
line
else
file
.
parallelLines
.
left
.
push
{
lineType
:
'context'
,
lineNumber
:
line
.
old_line
,
richText
:
line
.
rich_text
}
file
.
parallelLines
.
right
.
push
{
lineType
:
'context'
,
lineNumber
:
line
.
new_line
,
richText
:
line
.
rich_text
}
if
conflict
file
.
inlineLines
.
push
{
isHeader
:
yes
,
id
,
type
:
'new'
,
richText
:
originHeaderText
,
section
:
'origin'
,
isOrigin
:
yes
,
isSelected
:
no
,
isUnselected
:
no
}
return
data
getConflictsCount
:
->
return
Object
.
keys
(
@
resolutionData
).
length
getResolvedCount
:
->
count
=
0
count
++
for
id
,
resolution
of
@
resolutionData
when
resolution
return
count
isAllResolved
:
->
return
@
resolvedCount
is
@
conflictsCount
updateResolutionsData
:
(
data
)
->
for
file
in
data
.
files
for
section
in
file
.
sections
when
section
.
conflict
@
$set
"resolutionData['
#{
section
.
id
}
']"
,
no
getInitialData
:
->
diffViewType
=
$
.
cookie
'diff_view'
return
{
isLoading
:
yes
isParallel
:
diffViewType
is
'parallel'
diffView
:
diffViewType
conflictsData
:
{}
resolutionData
:
{}
}
app/assets/javascripts/merge_conflicts_data.coffee
已删除
100644 → 0
浏览文件 @
4d8b0293
window
.
mergeConflictsData
=
{
"target_branch"
:
"master"
,
"source_branch"
:
"mc-ui"
,
"commit_sha"
:
"b5fa56eb3f2cea5e21c68b43c7c22b5b96e0e7b3"
,
"files"
:
[
{
"old_path"
:
"lib/component.js"
,
"new_path"
:
"lib/component.js"
,
"sections"
:
[
{
"conflict"
:
false
,
"lines"
:
[
{
"type"
:
null
,
"old_line"
:
206
,
"new_line"
:
206
,
"text"
:
""
},
{
"type"
:
null
,
"old_line"
:
207
,
"new_line"
:
207
,
"text"
:
"var options = utils.merge.apply(utils, args);"
}
]
},
{
"conflict"
:
true
,
"id"
:
"section123"
,
"lines"
:
[
{
"type"
:
"old"
,
"old_line"
:
208
,
"new_line"
:
null
,
"text"
:
"$(selector).each(function(i, rawNode) {"
},
{
"type"
:
"old"
,
"old_line"
:
209
,
"new_line"
:
null
,
"text"
:
"var componentInfo = registry.findComponentInfo(this)"
},
{
"type"
:
"old"
,
"old_line"
:
210
,
"new_line"
:
null
,
"text"
:
"if (componentInfo && componentInfo.isAttachedTo(rawNode)) {"
},
{
"type"
:
"new"
,
"old_line"
:
null
,
"new_line"
:
208
,
"text"
:
"$(selector).each(function(i, node) {"
},
{
"type"
:
"new"
,
"old_line"
:
null
,
"new_line"
:
209
,
"text"
:
"if (componentInfo && componentInfo.isAttachedTo(node)) {"
}
]
},
{
"conflict"
:
false
,
"lines"
:
[
{
"type"
:
null
,
"old_line"
:
211
,
"new_line"
:
210
,
"text"
:
"return;"
},
{
"type"
:
null
,
"old_line"
:
212
,
"new_line"
:
211
,
"text"
:
"}"
},
{
"type"
:
null
,
"old_line"
:
null
,
"new_line"
:
212
,
"text"
:
""
},
{
"type"
:
null
,
"old_line"
:
213
,
"new_line"
:
213
,
"text"
:
""
}
]
}
]
},
{
"commit_sha"
:
"b5fa56eb3f2cea5e21c68b43c7c22b5b96e0e7b3"
,
"old_path"
:
"lib/component.js"
,
"new_path"
:
"lib/component.js"
,
"sections"
:
[
{
"conflict"
:
false
,
"lines"
:
[
{
"type"
:
null
,
"old_line"
:
62
,
"new_line"
:
62
,
"text"
:
" (new this).initialize(node, options);"
},
{
"type"
:
null
,
"old_line"
:
63
,
"new_line"
:
63
,
"text"
:
" }.bind(this));"
},
{
"type"
:
null
,
"old_line"
:
64
,
"new_line"
:
64
,
"text"
:
" }"
},
{
"type"
:
null
,
"old_line"
:
65
,
"new_line"
:
65
,
"text"
:
""
}
]
},
{
"conflict"
:
true
,
"id"
:
"section124"
,
"lines"
:
[
{
"type"
:
"old"
,
"old_line"
:
67
,
"new_line"
:
null
,
"text"
:
" function removeFrom(selector) {"
},
{
"type"
:
"old"
,
"old_line"
:
68
,
"new_line"
:
null
,
"text"
:
" if (!selector) {"
},
{
"type"
:
"old"
,
"old_line"
:
69
,
"new_line"
:
null
,
"text"
:
" throw new Error(
\"
Component needs to be removeFrom'd a jQuery object, native node or selector string
\"
);"
},
{
"type"
:
"old"
,
"old_line"
:
70
,
"new_line"
:
null
,
"text"
:
" }"
},
{
"type"
:
"old"
,
"old_line"
:
71
,
"new_line"
:
null
,
"text"
:
" "
},
{
"type"
:
"old"
,
"old_line"
:
72
,
"new_line"
:
null
,
"text"
:
" $(selector).each(function(i, rawNode) {"
},
{
"type"
:
"old"
,
"old_line"
:
73
,
"new_line"
:
null
,
"text"
:
" var componentInfo = registry.findComponentInfo(this)"
},
{
"type"
:
"old"
,
"old_line"
:
74
,
"new_line"
:
null
,
"text"
:
" if (componentInfo && componentInfo.isAttachedTo(rawNode)) {"
},
{
"type"
:
"old"
,
"old_line"
:
75
,
"new_line"
:
null
,
"text"
:
" Object.keys(componentInfo.instances).forEach(function(index) {"
},
{
"type"
:
"old"
,
"old_line"
:
76
,
"new_line"
:
null
,
"text"
:
" var instance = componentInfo.instances[index].instance;"
},
{
"type"
:
"old"
,
"old_line"
:
77
,
"new_line"
:
null
,
"text"
:
" if (instance.node === rawNode) {"
},
{
"type"
:
"old"
,
"old_line"
:
78
,
"new_line"
:
null
,
"text"
:
" instance.teardown();"
},
{
"type"
:
"old"
,
"old_line"
:
79
,
"new_line"
:
null
,
"text"
:
" }"
},
{
"type"
:
"old"
,
"old_line"
:
80
,
"new_line"
:
null
,
"text"
:
" });"
},
{
"type"
:
"old"
,
"old_line"
:
81
,
"new_line"
:
null
,
"text"
:
" }"
},
{
"type"
:
"old"
,
"old_line"
:
82
,
"new_line"
:
null
,
"text"
:
" }.bind(this));"
},
{
"type"
:
"old"
,
"old_line"
:
83
,
"new_line"
:
null
,
"text"
:
" }"
},
{
"type"
:
"new"
,
"old_line"
:
null
,
"new_line"
:
67
,
"text"
:
" function prettyPrintMixins() {"
},
{
"type"
:
"new"
,
"old_line"
:
null
,
"new_line"
:
68
,
"text"
:
" //could be called from constructor or constructor.prototype"
},
{
"type"
:
"new"
,
"old_line"
:
null
,
"new_line"
:
69
,
"text"
:
" var mixedIn = this.mixedIn || this.prototype.mixedIn || [];"
},
{
"type"
:
"new"
,
"old_line"
:
null
,
"new_line"
:
70
,
"text"
:
" return mixedIn.map(function(mixin) {"
},
{
"type"
:
"new"
,
"old_line"
:
null
,
"new_line"
:
71
,
"text"
:
" if (mixin.name == null) {"
},
{
"type"
:
"new"
,
"old_line"
:
null
,
"new_line"
:
72
,
"text"
:
" // function name property not supported by this browser, use regex"
},
{
"type"
:
"new"
,
"old_line"
:
null
,
"new_line"
:
73
,
"text"
:
" var m = mixin.toString().match(functionNameRegEx);"
},
{
"type"
:
"new"
,
"old_line"
:
null
,
"new_line"
:
74
,
"text"
:
" return (m && m[1]) ? m[1] : '';"
},
{
"type"
:
"new"
,
"old_line"
:
null
,
"new_line"
:
75
,
"text"
:
" } else {"
},
{
"type"
:
"new"
,
"old_line"
:
null
,
"new_line"
:
76
,
"text"
:
" return (mixin.name != 'withBase') ? mixin.name : '';"
},
{
"type"
:
"new"
,
"old_line"
:
null
,
"new_line"
:
77
,
"text"
:
" }"
},
{
"type"
:
"new"
,
"old_line"
:
null
,
"new_line"
:
78
,
"text"
:
" }).filter(Boolean).join(', ');"
},
{
"type"
:
"new"
,
"old_line"
:
null
,
"new_line"
:
79
,
"text"
:
" };"
},
{
"type"
:
"new"
,
"old_line"
:
null
,
"new_line"
:
80
,
"text"
:
""
}
]
},
{
"conflict"
:
false
,
"lines"
:
[
{
"type"
:
null
,
"old_line"
:
84
,
"new_line"
:
81
,
"text"
:
""
},
{
"type"
:
null
,
"old_line"
:
85
,
"new_line"
:
82
,
"text"
:
" // define the constructor for a custom component type"
},
{
"type"
:
null
,
"old_line"
:
86
,
"new_line"
:
83
,
"text"
:
" // takes an unlimited number of mixin functions as arguments"
},
{
"type"
:
null
,
"old_line"
:
87
,
"new_line"
:
84
,
"text"
:
" // typical api call with 3 mixins: define(timeline, withTweetCapability, withScrollCapability);"
}
]
}
]
},
{
"commit_sha"
:
"c68b43c7c22b5b96e0e7b3b5fa56eb3f2cea5e21"
,
"old_path"
:
"lib/registry.js"
,
"new_path"
:
"lib/registry.js"
,
"sections"
:
[
{
"conflict"
:
false
,
"lines"
:
[
{
"type"
:
null
,
"old_line"
:
159
,
"new_line"
:
159
,
"text"
:
""
},
{
"type"
:
null
,
"old_line"
:
160
,
"new_line"
:
160
,
"text"
:
"var thisInstanceInfo = this.allInstances[k]"
}
]
},
{
"conflict"
:
true
,
"id"
:
"section125"
,
"lines"
:
[
{
"type"
:
"old"
,
"old_line"
:
161
,
"new_line"
:
null
,
"text"
:
"if(thisInstanceInfo.instance.node == node){"
},
{
"type"
:
"new"
,
"old_line"
:
null
,
"new_line"
:
161
,
"text"
:
"if (thisInstanceInfo.instance.node === node) {"
}
]
},
{
"conflict"
:
false
,
"lines"
:
[
{
"type"
:
null
,
"old_line"
:
162
,
"new_line"
:
162
,
"text"
:
"result.push(thisInstanceInfo);"
}
]
}
]
}
]
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录