Reset 'Old Version History' if dependent change is opened

Following the navigation link in the dependencies table on the
ChangeScreen, the user can directly navigate to dependent changes.
The value for 'Old Version History' of the current change is
incorrectly applied to the new change. If the value is invalid for
the new change the 'Old Version History' field becomes blank.

Bug: issue 1518
Change-Id: Ifb0fe9bb565ab66cd85f8b426b438e8c50da7b27
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
Edwin Kempin
2013-01-03 15:37:01 +01:00
parent 6802493d7b
commit 7516b17eb6

View File

@@ -98,14 +98,6 @@ public class ChangeScreen extends Screen
public ChangeScreen(final Change.Id toShow) {
changeId = toShow;
openPatchSetId = null;
// If we have any diff stored, make sure they are applicable to the
// current change, discard them otherwise.
//
if (currentChangeId != null && !currentChangeId.equals(toShow)) {
diffBaseId = null;
}
currentChangeId = toShow;
}
public ChangeScreen(final PatchSet.Id toShow) {
@@ -271,6 +263,7 @@ public class ChangeScreen extends Screen
private void display(final ChangeDetail detail) {
displayTitle(detail.getChange().getKey(), detail.getChange().getSubject());
discardDiffBaseIfNotApplicable(detail.getChange().getId());
if (Status.MERGED == detail.getChange().getStatus()) {
includedInPanel.setVisible(true);
@@ -354,6 +347,13 @@ public class ChangeScreen extends Screen
patchSetsBlock.setRegisterKeys(true);
}
private static void discardDiffBaseIfNotApplicable(final Change.Id toShow) {
if (currentChangeId != null && !currentChangeId.equals(toShow)) {
diffBaseId = null;
}
currentChangeId = toShow;
}
private void addComments(final ChangeDetail detail) {
comments.clear();