Highlight hunks which are due to rebase on PolyGerrit

Change-Id: Ifd31c8b2d31d71ff19060da56d81b64954f4fdb7
This commit is contained in:
Alice Kober-Sotzek
2017-05-05 17:48:31 +02:00
parent 1afa2cb52e
commit ec44e83877
5 changed files with 26 additions and 0 deletions

View File

@@ -29,6 +29,9 @@
if (this._isTotal(group)) {
sectionEl.classList.add('total');
}
if (group.dueToRebase) {
sectionEl.classList.add('dueToRebase');
}
const pairs = group.getSideBySidePairs();
for (let i = 0; i < pairs.length; i++) {
sectionEl.appendChild(this._createRow(sectionEl, pairs[i].left,

View File

@@ -29,6 +29,9 @@
if (this._isTotal(group)) {
sectionEl.classList.add('total');
}
if (group.dueToRebase) {
sectionEl.classList.add('dueToRebase');
}
for (let i = 0; i < group.lines.length; ++i) {
sectionEl.appendChild(this._createRow(sectionEl, group.lines[i]));

View File

@@ -210,6 +210,7 @@
state.lineNums.left,
state.lineNums.right,
highlights);
deltaGroup.dueToRebase = section.due_to_rebase;
return {
lineDelta: {

View File

@@ -22,6 +22,7 @@
this.lines = [];
this.adds = [];
this.removes = [];
this.dueToRebase = undefined;
this.lineRange = {
left: {start: null, end: null},

View File

@@ -34,6 +34,10 @@ limitations under the License.
--dark-remove-highlight-color: rgba(255, 0, 0, 0.15);
--light-add-highlight-color: #efe;
--dark-add-highlight-color: rgba(0, 255, 0, 0.15);
--light-rebased-remove-highlight-color: #fff6ea;
--dark-rebased-remove-highlight-color: rgba(255, 139, 6, 0.15);
--light-rebased-add-highlight-color: #edfffa;
--dark-rebased-add-highlight-color: rgba(11, 255, 155, 0.15);
}
:host(.no-left) .sideBySide ::content .left,
:host(.no-left) .sideBySide ::content .left + td,
@@ -145,6 +149,20 @@ limitations under the License.
.content.remove {
background-color: var(--light-remove-highlight-color);
}
.dueToRebase .content.add .intraline,
.delta.total.dueToRebase .content.add {
background-color: var(--dark-rebased-add-highlight-color);
}
.dueToRebase .content.add {
background-color: var(--light-rebased-add-highlight-color);
}
.dueToRebase .content.remove .intraline,
.delta.total.dueToRebase .content.remove {
background-color: var(--dark-rebased-remove-highlight-color);
}
.dueToRebase .content.remove {
background-color: var(--light-rebased-remove-highlight-color);
}
.content .contentText:after {
/* Newline, to ensure all lines are one line-height tall. */
content: '\A';