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
Léo-Paul Géneau
gitlab-ce
Commits
5625e828
Commit
5625e828
authored
Aug 01, 2016
by
Fatih Acet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check line lengths and fill missing lines with empty lines.
parent
b0b5e9f1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
9 deletions
+34
-9
app/assets/javascripts/merge_conflict_data_provider.js.es6
app/assets/javascripts/merge_conflict_data_provider.js.es6
+32
-9
app/assets/javascripts/merge_conflict_resolver.js.es6
app/assets/javascripts/merge_conflict_resolver.js.es6
+2
-0
No files found.
app/assets/javascripts/merge_conflict_data_provider.js.es6
View file @
5625e828
...
@@ -67,15 +67,38 @@ window.MergeConflictDataProvider = class MergeConflictDataProvider {
...
@@ -67,15 +67,38 @@ window.MergeConflictDataProvider = class MergeConflictDataProvider {
}
}
else {
else {
const lineType = type || 'context';
const lineType = type || 'context';
file.parallelLines.left.push (this.getLineForParallelView(line, id, lineType));
file.parallelLines.left.push (this.getLineForParallelView(line, id, lineType));
file.parallelLines.right.push(this.getLineForParallelView(line, id, lineType));
file.parallelLines.right.push(this.getLineForParallelView(line, id, lineType
, true
));
}
}
});
});
this.checkLineLengths(file);
});
});
});
});
}
}
checkLineLengths(file) {
let { left, right } = file.parallelLines;
if (left.length !== right.length) {
if (left.length > right.length) {
const diff = left.length - right.length;
for (let i = 0; i < diff; i++) {
file.parallelLines.right.push({ lineType: 'emptyLine', richText: '' });
}
}
else {
const diff = right.length - left.length;
for (let i = 0; i < diff; i++) {
file.parallelLines.left.push({ lineType: 'emptyLine', richText: '' });
}
}
}
}
setInlineLines(data) {
setInlineLines(data) {
data.files.forEach( (file) => {
data.files.forEach( (file) => {
file.inlineLines = []
file.inlineLines = []
...
@@ -208,14 +231,14 @@ window.MergeConflictDataProvider = class MergeConflictDataProvider {
...
@@ -208,14 +231,14 @@ window.MergeConflictDataProvider = class MergeConflictDataProvider {
id,
id,
lineType,
lineType,
hasConflict,
hasConflict,
isHead: hasConflict && isHead,
isHead
: hasConflict && isHead,
isOrigin: hasConflict && !isHead,
isOrigin
: hasConflict && !isHead,
hasMatch: lineType === 'match',
hasMatch
: lineType === 'match',
lineNumber: isHead ? new_line : old_line,
lineNumber
: isHead ? new_line : old_line,
section: isHead ? 'head' : 'origin',
section
: isHead ? 'head' : 'origin',
richText: rich_text,
richText
: rich_text,
isSelected: false,
isSelected
: false,
isUnselected: false
isUnselected
: false
}
}
}
}
...
...
app/assets/javascripts/merge_conflict_resolver.js.es6
View file @
5625e828
//= require lib/vue
//= require lib/vue
window.MergeConflictResolver = class MergeConflictResolver {
window.MergeConflictResolver = class MergeConflictResolver {
constructor() {
constructor() {
this.dataProvider = new MergeConflictDataProvider()
this.dataProvider = new MergeConflictDataProvider()
this.initVue()
this.initVue()
}
}
initVue() {
initVue() {
const that = this;
const that = this;
this.vue = new Vue({
this.vue = new Vue({
...
...
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