Set patchset description to 'Rebase' when rebasing
Change-Id: I9e27b211776fd4716a7e9af9dc201fc6fa1defe5
This commit is contained in:
@@ -391,7 +391,7 @@ public class ChangeIT extends AbstractDaemonTest {
|
||||
ChangeInfo c2 = gApi.changes().id(changeId).get();
|
||||
assertThat(c2.revisions.get(c2.currentRevision)._number).isEqualTo(2);
|
||||
|
||||
// ...and the committer should be correct
|
||||
// ...and the committer and description should be correct
|
||||
ChangeInfo info = gApi.changes()
|
||||
.id(changeId).get(EnumSet.of(
|
||||
ListChangesOption.CURRENT_REVISION,
|
||||
@@ -400,6 +400,9 @@ public class ChangeIT extends AbstractDaemonTest {
|
||||
info.currentRevision).commit.committer;
|
||||
assertThat(committer.name).isEqualTo(admin.fullName);
|
||||
assertThat(committer.email).isEqualTo(admin.email);
|
||||
String description = info.revisions.get(
|
||||
info.currentRevision).description;
|
||||
assertThat(description).isEqualTo("Rebase");
|
||||
|
||||
// Rebasing the second change again should fail
|
||||
exception.expect(ResourceConflictException.class);
|
||||
|
@@ -92,6 +92,7 @@ public class PatchSetInserter extends BatchUpdate.Op {
|
||||
|
||||
// Fields exposed as setters.
|
||||
private String message;
|
||||
private String description;
|
||||
private CommitValidators.Policy validatePolicy =
|
||||
CommitValidators.Policy.GERRIT;
|
||||
private boolean draft;
|
||||
@@ -145,6 +146,11 @@ public class PatchSetInserter extends BatchUpdate.Op {
|
||||
return this;
|
||||
}
|
||||
|
||||
public PatchSetInserter setDescription(String description) {
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PatchSetInserter setValidatePolicy(CommitValidators.Policy validate) {
|
||||
this.validatePolicy = checkNotNull(validate);
|
||||
return this;
|
||||
@@ -229,7 +235,7 @@ public class PatchSetInserter extends BatchUpdate.Op {
|
||||
}
|
||||
}
|
||||
patchSet = psUtil.insert(db, ctx.getRevWalk(), ctx.getUpdate(psId),
|
||||
psId, commit, draft, newGroups, null, null);
|
||||
psId, commit, draft, newGroups, null, description);
|
||||
|
||||
if (notify != NotifyHandling.NONE) {
|
||||
oldReviewers = approvalsUtil.getReviewers(db, ctl.getNotes());
|
||||
|
@@ -173,6 +173,7 @@ public class RebaseChangeOp extends BatchUpdate.Op {
|
||||
ctx.getRepository(), ctl.getChange().currentPatchSetId());
|
||||
patchSetInserter = patchSetInserterFactory
|
||||
.create(ctl, rebasedPatchSetId, rebasedCommit)
|
||||
.setDescription("Rebase")
|
||||
.setDraft(originalPatchSet.isDraft())
|
||||
.setNotify(NotifyHandling.NONE)
|
||||
.setFireRevisionCreated(fireRevisionCreated)
|
||||
|
Reference in New Issue
Block a user