PatchSetInserter: Simplify message setup

The commitMessageNotForChange branch was patterned after
ChangeInserter. However, the only caller that adds a message on a
different change was CherryPickChange, which adds the message in a
separate update in a different codepath. So, eliminate this ugly path.

Since we no longer allow callers to specify messages for another
change, the only field in the ChangeMessage that they need control
over is the message text itself. Simplify the setup by eliminating the
setMessage(ChangeMessage) method entirely and only storing the message
string.

Change-Id: Ifb4037bcb2962b4aba2b0d3fe5e660295aecf0a0
This commit is contained in:
Dave Borowitz
2015-10-07 16:00:14 -04:00
parent dd586b51ee
commit 4865d0f37d
5 changed files with 20 additions and 61 deletions

View File

@@ -473,7 +473,7 @@ public class ConsistencyChecker {
p.status = Status.FIXED;
p.outcome = "Inserted as patch set " + change.currentPatchSetId().get();
return inserter.getPatchSet();
} catch (InvalidChangeOperationException | OrmException | IOException
} catch (InvalidChangeOperationException | IOException
| NoSuchChangeException | UpdateException | RestApiException e) {
warn(e);
p.status = Status.FIX_FAILED;