Merge "Extend PatchSetWebLink to include subject and branch name"
* submodules:
* Update plugins/gitiles from branch 'master'
to e929d29973ac732a096d1920b8060eafdd04316e
- Adjust to Gerrit change
This change is a part of I420161ca4.
Change-Id: Ic6cd617316d43097d9921a9f2ddda6b63917ebaa
This commit is contained in:
@@ -91,6 +91,7 @@ import com.google.gerrit.common.data.GlobalCapability;
|
||||
import com.google.gerrit.entities.Account;
|
||||
import com.google.gerrit.entities.AccountGroup;
|
||||
import com.google.gerrit.entities.Address;
|
||||
import com.google.gerrit.entities.BranchNameKey;
|
||||
import com.google.gerrit.entities.Change;
|
||||
import com.google.gerrit.entities.LabelFunction;
|
||||
import com.google.gerrit.entities.LabelType;
|
||||
@@ -154,6 +155,7 @@ import com.google.gerrit.server.ChangeMessagesUtil;
|
||||
import com.google.gerrit.server.StarredChangesUtil;
|
||||
import com.google.gerrit.server.change.ChangeResource;
|
||||
import com.google.gerrit.server.change.testing.TestChangeETagComputation;
|
||||
import com.google.gerrit.server.git.ChangeMessageModifier;
|
||||
import com.google.gerrit.server.group.SystemGroupBackend;
|
||||
import com.google.gerrit.server.index.change.ChangeIndex;
|
||||
import com.google.gerrit.server.index.change.ChangeIndexCollection;
|
||||
@@ -2951,14 +2953,19 @@ public class ChangeIT extends AbstractDaemonTest {
|
||||
public void customCommitFooters() throws Exception {
|
||||
PushOneCommit.Result change = createChange();
|
||||
ChangeInfo actual;
|
||||
try (Registration registration =
|
||||
extensionRegistry
|
||||
.newRegistration()
|
||||
.add(
|
||||
(newCommitMessage, original, mergeTip, destination) -> {
|
||||
assertThat(original.getName()).isNotEqualTo(mergeTip.getName());
|
||||
return newCommitMessage + "Custom: " + destination.branch();
|
||||
})) {
|
||||
ChangeMessageModifier link =
|
||||
new ChangeMessageModifier() {
|
||||
@Override
|
||||
public String onSubmit(
|
||||
String newCommitMessage,
|
||||
RevCommit original,
|
||||
RevCommit mergeTip,
|
||||
BranchNameKey destination) {
|
||||
assertThat(original.getName()).isNotEqualTo(mergeTip.getName());
|
||||
return newCommitMessage + "Custom: " + destination.branch();
|
||||
}
|
||||
};
|
||||
try (Registration registration = extensionRegistry.newRegistration().add(link)) {
|
||||
actual = gApi.changes().id(change.getChangeId()).get(ALL_REVISIONS, COMMIT_FOOTERS);
|
||||
}
|
||||
List<String> footers =
|
||||
|
||||
@@ -1573,7 +1573,8 @@ public class RevisionIT extends AbstractDaemonTest {
|
||||
PatchSetWebLink link =
|
||||
new PatchSetWebLink() {
|
||||
@Override
|
||||
public WebLinkInfo getPatchSetWebLink(String projectName, String commit) {
|
||||
public WebLinkInfo getPatchSetWebLink(
|
||||
String projectName, String commit, String subject, String branchName) {
|
||||
return expectedWebLinkInfo;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user