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:
Edwin Kempin
2016-02-16 14:06:29 +01:00
parent df4868f382
commit 77f2a4e497

View File

@@ -125,7 +125,6 @@ public class Revert implements RestModifyView<ChangeResource, RevertInput>,
Change.Id revertedChangeId;
try {
revertedChangeId = revert(req.getControl(),
change.currentPatchSetId(),
Strings.emptyToNull(input.message));
} catch (NoSuchChangeException e) {
throw new ResourceNotFoundException(e.getMessage());
@@ -134,11 +133,12 @@ public class Revert implements RestModifyView<ChangeResource, RevertInput>,
revertedChangeId);
}
private Change.Id revert(ChangeControl ctl, PatchSet.Id patchSetId,
String message) throws NoSuchChangeException, OrmException,
MissingObjectException, IncorrectObjectTypeException, IOException,
RestApiException, UpdateException {
Change.Id changeIdToRevert = patchSetId.getParentKey();
private Change.Id revert(ChangeControl ctl, String message)
throws NoSuchChangeException, OrmException, MissingObjectException,
IncorrectObjectTypeException, IOException, RestApiException,
UpdateException {
Change.Id changeIdToRevert = ctl.getChange().getId();
PatchSet.Id patchSetId = ctl.getChange().currentPatchSetId();
PatchSet patch = psUtil.get(db.get(), ctl.getNotes(), patchSetId);
if (patch == null) {
throw new NoSuchChangeException(changeIdToRevert);