Fix using "Default Base For Merges"
Change-Id: I5c07906e1c6f69fc966f1d25a35beaaf81e05ecc
diff --git a/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.js b/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.js
index fface9d..301bdbd 100644
--- a/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.js
+++ b/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.js
@@ -890,12 +890,15 @@
_changeChanged(change) {
if (!change || !this._patchRange || !this._allPatchSets) { return; }
- // Update patchNum before getting basePatchNum.
+ // We get the parent first so we keep the original value for basePatchNum
+ // and not the updated value.
+ const parent = this._getBasePatchNum(change, this._patchRange);
+
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});
},