about summary refs log tree commit diff
path: root/third_party/gerrit/0003-Add-titles-to-CLs-over-HTTP.patch
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/gerrit/0003-Add-titles-to-CLs-over-HTTP.patch')
-rw-r--r--third_party/gerrit/0003-Add-titles-to-CLs-over-HTTP.patch38
1 files changed, 19 insertions, 19 deletions
diff --git a/third_party/gerrit/0003-Add-titles-to-CLs-over-HTTP.patch b/third_party/gerrit/0003-Add-titles-to-CLs-over-HTTP.patch
index d2b3e3541f5e..c4edee3a40c3 100644
--- a/third_party/gerrit/0003-Add-titles-to-CLs-over-HTTP.patch
+++ b/third_party/gerrit/0003-Add-titles-to-CLs-over-HTTP.patch
@@ -1,4 +1,4 @@
-From 585077e751107729b7a2dd495a3b17c677a3f528 Mon Sep 17 00:00:00 2001
+From f49c50ca9a84ca374b7bd91c171bbea0457f2c7a Mon Sep 17 00:00:00 2001
 From: Luke Granger-Brown <git@lukegb.com>
 Date: Thu, 2 Jul 2020 23:03:02 +0100
 Subject: [PATCH 3/3] Add titles to CLs over HTTP
@@ -13,18 +13,18 @@ Subject: [PATCH 3/3] Add titles to CLs over HTTP
  create mode 100644 java/com/google/gerrit/httpd/raw/TitleComputer.java
 
 diff --git a/java/com/google/gerrit/httpd/raw/IndexHtmlUtil.java b/java/com/google/gerrit/httpd/raw/IndexHtmlUtil.java
-index ce22ae8e59..952ba1fef4 100644
+index 72bfe40c3b..439bd73b44 100644
 --- a/java/com/google/gerrit/httpd/raw/IndexHtmlUtil.java
 +++ b/java/com/google/gerrit/httpd/raw/IndexHtmlUtil.java
-@@ -40,6 +40,7 @@ import java.util.Arrays;
- import java.util.Collections;
+@@ -41,6 +41,7 @@ import java.util.Collections;
  import java.util.HashMap;
+ import java.util.HashSet;
  import java.util.Map;
 +import java.util.Optional;
  import java.util.Set;
  import java.util.function.Function;
  
-@@ -61,13 +62,14 @@ public class IndexHtmlUtil {
+@@ -62,13 +63,14 @@ public class IndexHtmlUtil {
        String faviconPath,
        Map<String, String[]> urlParameterMap,
        Function<String, SanitizedContent> urlInScriptTagOrdainer,
@@ -38,20 +38,20 @@ index ce22ae8e59..952ba1fef4 100644
                  canonicalURL, cdnPath, faviconPath, urlParameterMap, urlInScriptTagOrdainer))
 -        .putAll(dynamicTemplateData(gerritApi, requestedURL));
 +        .putAll(dynamicTemplateData(gerritApi, requestedURL, titleComputer));
-     Set<String> enabledExperiments = experimentFeatures.getEnabledExperimentFeatures();
- 
-     if (!enabledExperiments.isEmpty()) {
-@@ -78,7 +80,8 @@ public class IndexHtmlUtil {
+     Set<String> enabledExperiments = new HashSet<>();
+     enabledExperiments.addAll(experimentFeatures.getEnabledExperimentFeatures());
+     // Add all experiments enabled through url
+@@ -81,7 +83,8 @@ public class IndexHtmlUtil {
  
    /** Returns dynamic parameters of {@code index.html}. */
    public static ImmutableMap<String, Object> dynamicTemplateData(
 -      GerritApi gerritApi, String requestedURL) throws RestApiException, URISyntaxException {
 +      GerritApi gerritApi, String requestedURL, TitleComputer titleComputer)
-+		  throws RestApiException, URISyntaxException {
++                throws RestApiException, URISyntaxException {
      ImmutableMap.Builder<String, Object> data = ImmutableMap.builder();
      Map<String, SanitizedContent> initialData = new HashMap<>();
      Server serverApi = gerritApi.config().server();
-@@ -131,6 +134,10 @@ public class IndexHtmlUtil {
+@@ -129,6 +132,10 @@ public class IndexHtmlUtil {
      }
  
      data.put("gerritInitialData", initialData);
@@ -63,7 +63,7 @@ index ce22ae8e59..952ba1fef4 100644
    }
  
 diff --git a/java/com/google/gerrit/httpd/raw/IndexServlet.java b/java/com/google/gerrit/httpd/raw/IndexServlet.java
-index fcb821e5ae..36eb0c990c 100644
+index fcb821e5ae..e1464b992b 100644
 --- a/java/com/google/gerrit/httpd/raw/IndexServlet.java
 +++ b/java/com/google/gerrit/httpd/raw/IndexServlet.java
 @@ -48,13 +48,15 @@ public class IndexServlet extends HttpServlet {
@@ -97,21 +97,21 @@ index fcb821e5ae..36eb0c990c 100644
                urlOrdainer,
 -              getRequestUrl(req));
 +              getRequestUrl(req),
-+	      titleComputer);
++              titleComputer);
        renderer = soySauce.renderTemplate("com.google.gerrit.httpd.raw.Index").setData(templateData);
      } catch (URISyntaxException | RestApiException e) {
        throw new IOException(e);
 diff --git a/java/com/google/gerrit/httpd/raw/StaticModule.java b/java/com/google/gerrit/httpd/raw/StaticModule.java
-index 8e8a9d27f0..a0fb168554 100644
+index 15dcf42e0e..9f56bf33ce 100644
 --- a/java/com/google/gerrit/httpd/raw/StaticModule.java
 +++ b/java/com/google/gerrit/httpd/raw/StaticModule.java
-@@ -226,10 +226,11 @@ public class StaticModule extends ServletModule {
+@@ -241,10 +241,11 @@ public class StaticModule extends ServletModule {
          @CanonicalWebUrl @Nullable String canonicalUrl,
          @GerritServerConfig Config cfg,
          GerritApi gerritApi,
 -        ExperimentFeatures experimentFeatures) {
 +        ExperimentFeatures experimentFeatures,
-+	TitleComputer titleComputer) {
++        TitleComputer titleComputer) {
        String cdnPath = options.devCdn().orElse(cfg.getString("gerrit", null, "cdnPath"));
        String faviconPath = cfg.getString("gerrit", null, "faviconPath");
 -      return new IndexServlet(canonicalUrl, cdnPath, faviconPath, gerritApi, experimentFeatures);
@@ -193,10 +193,10 @@ index 0000000000..8fd2053ad0
 +  }
 +}
 diff --git a/resources/com/google/gerrit/httpd/raw/PolyGerritIndexHtml.soy b/resources/com/google/gerrit/httpd/raw/PolyGerritIndexHtml.soy
-index 8c97a49e81..129092dc7e 100644
+index dbfef44dfe..347ee75aab 100644
 --- a/resources/com/google/gerrit/httpd/raw/PolyGerritIndexHtml.soy
 +++ b/resources/com/google/gerrit/httpd/raw/PolyGerritIndexHtml.soy
-@@ -32,10 +32,12 @@
+@@ -33,10 +33,12 @@
    {@param? defaultDashboardHex: ?}
    {@param? dashboardQuery: ?}
    {@param? userIsAuthenticated: ?}
@@ -211,5 +211,5 @@ index 8c97a49e81..129092dc7e 100644
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">{\n}
  
 -- 
-2.36.0
+2.37.3