Revert: Remove patch set ID from signature of revert method
It's not needed to pass in the patch set ID. Change-Id: Ib2d50f483aa25d06ce5c071ac7fd1254b925248b Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
@@ -125,7 +125,6 @@ public class Revert implements RestModifyView<ChangeResource, RevertInput>,
|
|||||||
Change.Id revertedChangeId;
|
Change.Id revertedChangeId;
|
||||||
try {
|
try {
|
||||||
revertedChangeId = revert(req.getControl(),
|
revertedChangeId = revert(req.getControl(),
|
||||||
change.currentPatchSetId(),
|
|
||||||
Strings.emptyToNull(input.message));
|
Strings.emptyToNull(input.message));
|
||||||
} catch (NoSuchChangeException e) {
|
} catch (NoSuchChangeException e) {
|
||||||
throw new ResourceNotFoundException(e.getMessage());
|
throw new ResourceNotFoundException(e.getMessage());
|
||||||
@@ -134,11 +133,12 @@ public class Revert implements RestModifyView<ChangeResource, RevertInput>,
|
|||||||
revertedChangeId);
|
revertedChangeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Change.Id revert(ChangeControl ctl, PatchSet.Id patchSetId,
|
private Change.Id revert(ChangeControl ctl, String message)
|
||||||
String message) throws NoSuchChangeException, OrmException,
|
throws NoSuchChangeException, OrmException, MissingObjectException,
|
||||||
MissingObjectException, IncorrectObjectTypeException, IOException,
|
IncorrectObjectTypeException, IOException, RestApiException,
|
||||||
RestApiException, UpdateException {
|
UpdateException {
|
||||||
Change.Id changeIdToRevert = patchSetId.getParentKey();
|
Change.Id changeIdToRevert = ctl.getChange().getId();
|
||||||
|
PatchSet.Id patchSetId = ctl.getChange().currentPatchSetId();
|
||||||
PatchSet patch = psUtil.get(db.get(), ctl.getNotes(), patchSetId);
|
PatchSet patch = psUtil.get(db.get(), ctl.getNotes(), patchSetId);
|
||||||
if (patch == null) {
|
if (patch == null) {
|
||||||
throw new NoSuchChangeException(changeIdToRevert);
|
throw new NoSuchChangeException(changeIdToRevert);
|
||||||
|
|||||||
Reference in New Issue
Block a user