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;
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user