Merge changes from topic 'fix-broken-tests'

* changes:
  Submit: Set correct patch set on approval when submitting new patch set
  Fix broken SubmitByCherryPickIT
This commit is contained in:
Edwin Kempin
2015-03-05 07:50:22 +00:00
committed by Gerrit Code Review
2 changed files with 8 additions and 3 deletions

View File

@@ -163,8 +163,13 @@ public abstract class AbstractSubmit extends AbstractDaemonTest {
ChangeInfo info = get(change.getChangeId(), ListChangesOption.MESSAGES);
assertThat((Iterable<?>)info.messages).isNotNull();
assertThat((Iterable<?>)info.messages).hasSize(3);
assertThat(Iterables.getLast(info.messages).message).isEqualTo(
"Change has been successfully merged into the git repository by Administrator");
if (getSubmitType() == SubmitType.CHERRY_PICK) {
assertThat(Iterables.getLast(info.messages).message).startsWith(
"Change has been successfully cherry-picked as ");
} else {
assertThat(Iterables.getLast(info.messages).message).isEqualTo(
"Change has been successfully merged into the git repository by Administrator");
}
}
protected Git createProject() throws JSchException, IOException,

View File

@@ -385,7 +385,7 @@ public class Submit implements RestModifyView<RevisionResource, SubmitInput>,
db.changes().beginTransaction(change.getId());
try {
BatchMetaDataUpdate batch = approve(change.currentPatchSetId(),
BatchMetaDataUpdate batch = approve(rsrc.getPatchSet().getId(),
cd.changeControl(), update, caller, timestamp);
// Write update commit after all normalized label commits.
batch.write(update, new CommitBuilder());