Remove method removeLastPatchSetId() from Change.
Instead, use the patchSet prior to the current patchSet. This is part of the code cleanup to remove the nbrPatchSets field. Change-Id: I7355aac57a6959fd145957c2d874a69c29e19c87
This commit is contained in:
@@ -482,15 +482,6 @@ public final class Change {
|
||||
++nbrPatchSets;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverts to an older PatchSet id within this change.
|
||||
* <p>
|
||||
* <b>Note: This makes the change dirty. Call update() after.</b>
|
||||
*/
|
||||
public void removeLastPatchSetId() {
|
||||
--nbrPatchSets;
|
||||
}
|
||||
|
||||
public void updateNumberOfPatchSets(int max) {
|
||||
nbrPatchSets = Math.max(nbrPatchSets, max);
|
||||
}
|
||||
|
@@ -111,9 +111,10 @@ public class DeleteDraftPatchSet implements Callable<ReviewResult> {
|
||||
}
|
||||
}
|
||||
if (change.currentPatchSetId().equals(patchSetId)) {
|
||||
change.removeLastPatchSetId();
|
||||
try {
|
||||
change.setCurrentPatchSet(patchSetInfoFactory.get(db, change.currPatchSetId()));
|
||||
PatchSet.Id id =
|
||||
new PatchSet.Id(patchSetId.getParentKey(), patchSetId.get() - 1);
|
||||
change.setCurrentPatchSet(patchSetInfoFactory.get(db, id));
|
||||
} catch (PatchSetInfoNotAvailableException e) {
|
||||
throw new NoSuchChangeException(changeId);
|
||||
}
|
||||
|
Reference in New Issue
Block a user