Merge branch 'stable-2.16'
* stable-2.16: ChangeCleanupConfig: Remove unnecessary usage of regex in URL replacement AbandonIT: Add tests for changeCleanup.abandonMessage UrlFormatter#getChangeViewUrl: Remove @Nullable and simplify default implementation UrlFormatter#getSettingsUrl: Annotate section parameter as @Nullable MergeUtil: Include project name in "Reviewed-On" URL ChangeCleanupConfig: Inject UrlFormatter via DynamicItem Adjust more classes to inject UrlFormatter via DynamicItem Set version to 2.15.12-SNAPSHOT Set version to 2.15.11 Allow LFS-over-SSH created auth pass through ContainerAuthFilter Upgrade elasticsearch-rest-client to 6.6.1 ElasticContainer: Bump the test server version to 5.6.15 Change-Id: Ie90d450ddb16d165ed2d5ec91964d35b735214dd
This commit is contained in:
@@ -30,6 +30,7 @@ import com.google.common.collect.Sets;
|
||||
import com.google.common.flogger.FluentLogger;
|
||||
import com.google.gerrit.common.FooterConstants;
|
||||
import com.google.gerrit.common.data.LabelType;
|
||||
import com.google.gerrit.extensions.registration.DynamicItem;
|
||||
import com.google.gerrit.extensions.registration.DynamicSet;
|
||||
import com.google.gerrit.extensions.restapi.BadRequestException;
|
||||
import com.google.gerrit.extensions.restapi.MergeConflictException;
|
||||
@@ -159,7 +160,7 @@ public class MergeUtil {
|
||||
}
|
||||
|
||||
private final IdentifiedUser.GenericFactory identifiedUserFactory;
|
||||
private final UrlFormatter urlFormatter;
|
||||
private final DynamicItem<UrlFormatter> urlFormatter;
|
||||
private final ApprovalsUtil approvalsUtil;
|
||||
private final ProjectState project;
|
||||
private final boolean useContentMerge;
|
||||
@@ -170,7 +171,7 @@ public class MergeUtil {
|
||||
MergeUtil(
|
||||
@GerritServerConfig Config serverConfig,
|
||||
IdentifiedUser.GenericFactory identifiedUserFactory,
|
||||
UrlFormatter urlFormatter,
|
||||
DynamicItem<UrlFormatter> urlFormatter,
|
||||
ApprovalsUtil approvalsUtil,
|
||||
PluggableCommitMessageGenerator commitMessageGenerator,
|
||||
@Assisted ProjectState project) {
|
||||
@@ -188,7 +189,7 @@ public class MergeUtil {
|
||||
MergeUtil(
|
||||
@GerritServerConfig Config serverConfig,
|
||||
IdentifiedUser.GenericFactory identifiedUserFactory,
|
||||
UrlFormatter urlFormatter,
|
||||
DynamicItem<UrlFormatter> urlFormatter,
|
||||
ApprovalsUtil approvalsUtil,
|
||||
@Assisted ProjectState project,
|
||||
PluggableCommitMessageGenerator commitMessageGenerator,
|
||||
@@ -482,7 +483,7 @@ public class MergeUtil {
|
||||
msgbuf.append('\n');
|
||||
}
|
||||
|
||||
Optional<String> url = urlFormatter.getChangeViewUrl(null, c.getId());
|
||||
Optional<String> url = urlFormatter.get().getChangeViewUrl(c.getProject(), c.getId());
|
||||
if (url.isPresent()) {
|
||||
if (!contains(footers, FooterConstants.REVIEWED_ON, url.get())) {
|
||||
msgbuf
|
||||
|
||||
Reference in New Issue
Block a user