No longer throw InvalidChangeOp in changeUpdated

InvalidChangeOperationExceptions are only thrown when we pass a null
change to this method.  It is better that we just don't pass the change
and add a more useful error to the ReviewResult.

We no longer perform a check to see if the patchset we have is the most
current one.  restore/abandon happens at the change level and the
patchset is just fetched to append a message to the change.

Change-Id: I3b3af1e3982fcd9111214a7c66a28476189c923b
This commit is contained in:
Conley Owens
2012-06-07 18:08:59 -07:00
parent 4d26f3cd62
commit 8f258d9972
7 changed files with 34 additions and 31 deletions

View File

@@ -585,12 +585,8 @@ public class ChangeUtil {
public static <T extends ReplyToChangeSender> void updatedChange(
final ReviewDb db, final IdentifiedUser user, final Change change,
final ChangeMessage cmsg, ReplyToChangeSender.Factory<T> senderFactory,
final String err) throws NoSuchChangeException,
InvalidChangeOperationException, EmailException, OrmException {
if (change == null) {
throw new InvalidChangeOperationException(err);
}
final ChangeMessage cmsg, ReplyToChangeSender.Factory<T> senderFactory)
throws NoSuchChangeException, EmailException, OrmException {
db.changeMessages().insert(Collections.singleton(cmsg));
new ApprovalsUtil(db, null).syncChangeStatus(change);