Enhance UpToChange link to activate the last browsed patchset.

While returning to the Change using "UpToChange" link in any
patchset, always the latest patchset is activated. This commit
modifies the functionality of the "UpToChange" link by storing
the last browsed patchset and activating it on return. This
makes it easy to review older patchsets.

Bug: issue 822
Change-Id: Iaf01c53797d92434a0bc150f73ad232aec3619d6
This commit is contained in:
Raviteja Sunkara
2011-03-02 19:34:17 +05:30
committed by Shawn O. Pearce
parent 620255aef7
commit 547e8e8ebf
8 changed files with 67 additions and 27 deletions

View File

@@ -54,6 +54,7 @@ import java.util.List;
public class ChangeScreen extends Screen {
private final Change.Id changeId;
private final PatchSet.Id openPatchSetId;
private Image starChange;
private boolean starred;
@@ -78,6 +79,12 @@ public class ChangeScreen extends Screen {
public ChangeScreen(final Change.Id toShow) {
changeId = toShow;
openPatchSetId = null;
}
public ChangeScreen(final PatchSet.Id toShow) {
changeId = toShow.getParentKey();
openPatchSetId = toShow;
}
public ChangeScreen(final ChangeInfo c) {
@@ -251,6 +258,9 @@ public class ChangeScreen extends Screen {
.getApprovals());
patchSetsBlock.display(detail);
if (openPatchSetId != null) {
patchSetsBlock.activate(openPatchSetId);
}
addComments(detail);
// If any dependency change is still open, show our dependency list.