Fix missing patchNum in change edit page

Bug: Issue 11502
Bug: Issue 11517
Change-Id: Ib7b9aecb24e5b689e074f9e64147de72946dec27
This commit is contained in:
Tao Zhou
2019-09-16 11:56:11 +02:00
parent a3d504e078
commit 8aca4cba8a

View File

@@ -890,19 +890,19 @@
_changeChanged(change) {
if (!change || !this._patchRange || !this._allPatchSets) { return; }
const parent = this._getBasePatchNum(change, this._patchRange);
this.set('_patchRange.basePatchNum', parent);
// Update patchNum before getting basePatchNum.
this.set('_patchRange.patchNum', this._patchRange.patchNum ||
this.computeLatestPatchNum(this._allPatchSets));
const parent = this._getBasePatchNum(change, this._patchRange);
this.set('_patchRange.basePatchNum', parent);
const title = change.subject + ' (' + change.change_id.substr(0, 9) + ')';
this.fire('title-change', {title});
},
/**
* Gets base patch number, if it is a parent try and decide from
* preference weather to default to `auto merge`, `Parent 1` or `PARENT`.
* preference whether to default to `auto merge`, `Parent 1` or `PARENT`.
* @param {Object} change
* @param {Object} patchRange
* @return {number|string}
@@ -1244,7 +1244,7 @@
if (!this._patchRange.patchNum &&
change.current_revision === edit.base_revision) {
change.current_revision = edit.commit.commit;
this._patchRange.patchNum = this.EDIT_NAME;
this.set('_patchRange.patchNum', this.EDIT_NAME);
// Because edits are fibbed as revisions and added to the revisions
// array, and revision actions are always derived from the 'latest'
// patch set, we must copy over actions from the patch set base.