From a2bedb9bfd1620c6fd9b5c8998d61d3d15a77ad5 Mon Sep 17 00:00:00 2001 From: David Ostrovsky Date: Tue, 24 Dec 2019 08:28:32 +0100 Subject: [PATCH] Delete unused download command general preference I cannot find where it is used from the client. Not on gerrit@HEAD and also not in 2.12 release. I stopped looking at older gerrit releases. Change-Id: Ied6580b8bb2597561d0c42667db3021a1d32f75e --- Documentation/rest-api-accounts.txt | 7 ------- .../gerrit/extensions/client/GeneralPreferencesInfo.java | 3 --- java/com/google/gerrit/server/account/Preferences.java | 7 ------- .../acceptance/api/accounts/GeneralPreferencesIT.java | 2 -- 4 files changed, 19 deletions(-) diff --git a/Documentation/rest-api-accounts.txt b/Documentation/rest-api-accounts.txt index 27a31b1333..7af4a01fff 100644 --- a/Documentation/rest-api-accounts.txt +++ b/Documentation/rest-api-accounts.txt @@ -1251,7 +1251,6 @@ any account. )]}' { "changes_per_page": 25, - "download_command": "CHECKOUT", "date_format": "STD", "time_format": "HHMM_12", "diff_view": "SIDE_BY_SIDE", @@ -1305,7 +1304,6 @@ link:#preferences-input[PreferencesInput] entity. { "changes_per_page": 50, "expand_inline_diffs": true, - "download_command": "CHECKOUT", "date_format": "STD", "time_format": "HHMM_12", "size_bar_in_change_table": true, @@ -1353,7 +1351,6 @@ link:#preferences-info[PreferencesInfo] entity. { "changes_per_page": 50, "expand_inline_diffs": true, - "download_command": "CHECKOUT", "date_format": "STD", "time_format": "HHMM_12", "size_bar_in_change_table": true, @@ -2737,8 +2734,6 @@ Whether to expand diffs inline instead of opening as separate page The type of download URL the user prefers to use. May be any key from the `schemes` map in link:rest-api-config.html#download-info[DownloadInfo]. -|`download_command` || -The type of download command the user prefers to use. |`date_format` || The format to display the date in. Allowed values are `STD`, `US`, `ISO`, `EURO`, `UK`. @@ -2799,8 +2794,6 @@ Whether to expand diffs inline instead of opening as separate page (PolyGerrit only). |`download_scheme` |optional| The type of download URL the user prefers to use. -|`download_command` |optional| -The type of download command the user prefers to use. |`date_format` |optional| The format to display the date in. Allowed values are `STD`, `US`, `ISO`, `EURO`, `UK`. diff --git a/java/com/google/gerrit/extensions/client/GeneralPreferencesInfo.java b/java/com/google/gerrit/extensions/client/GeneralPreferencesInfo.java index 458bcf539e..212f6da7a9 100644 --- a/java/com/google/gerrit/extensions/client/GeneralPreferencesInfo.java +++ b/java/com/google/gerrit/extensions/client/GeneralPreferencesInfo.java @@ -124,8 +124,6 @@ public class GeneralPreferencesInfo { public Integer changesPerPage; /** Type of download URL the user prefers to use. */ public String downloadScheme; - /** Type of download command the user prefers to use. */ - public DownloadCommand downloadCommand; public DateFormat dateFormat; public TimeFormat timeFormat; @@ -184,7 +182,6 @@ public class GeneralPreferencesInfo { GeneralPreferencesInfo p = new GeneralPreferencesInfo(); p.changesPerPage = DEFAULT_PAGESIZE; p.downloadScheme = null; - p.downloadCommand = DownloadCommand.CHECKOUT; p.dateFormat = DateFormat.STD; p.timeFormat = TimeFormat.HHMM_12; p.expandInlineDiffs = false; diff --git a/java/com/google/gerrit/server/account/Preferences.java b/java/com/google/gerrit/server/account/Preferences.java index c15e6b0c57..7d30951e08 100644 --- a/java/com/google/gerrit/server/account/Preferences.java +++ b/java/com/google/gerrit/server/account/Preferences.java @@ -23,7 +23,6 @@ import com.google.gerrit.extensions.client.GeneralPreferencesInfo; import com.google.gerrit.extensions.client.GeneralPreferencesInfo.DateFormat; import com.google.gerrit.extensions.client.GeneralPreferencesInfo.DefaultBase; import com.google.gerrit.extensions.client.GeneralPreferencesInfo.DiffView; -import com.google.gerrit.extensions.client.GeneralPreferencesInfo.DownloadCommand; import com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailFormat; import com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy; import com.google.gerrit.extensions.client.GeneralPreferencesInfo.TimeFormat; @@ -40,8 +39,6 @@ public abstract class Preferences { public abstract Optional downloadScheme(); - public abstract Optional downloadCommand(); - public abstract Optional dateFormat(); public abstract Optional timeFormat(); @@ -82,8 +79,6 @@ public abstract class Preferences { abstract Builder downloadScheme(@Nullable String val); - abstract Builder downloadCommand(@Nullable DownloadCommand val); - abstract Builder dateFormat(@Nullable DateFormat val); abstract Builder timeFormat(@Nullable TimeFormat val); @@ -125,7 +120,6 @@ public abstract class Preferences { return (new AutoValue_Preferences_General.Builder()) .changesPerPage(info.changesPerPage) .downloadScheme(info.downloadScheme) - .downloadCommand(info.downloadCommand) .dateFormat(info.dateFormat) .timeFormat(info.timeFormat) .expandInlineDiffs(info.expandInlineDiffs) @@ -150,7 +144,6 @@ public abstract class Preferences { GeneralPreferencesInfo info = new GeneralPreferencesInfo(); info.changesPerPage = changesPerPage().orElse(null); info.downloadScheme = downloadScheme().orElse(null); - info.downloadCommand = downloadCommand().orElse(null); info.dateFormat = dateFormat().orElse(null); info.timeFormat = timeFormat().orElse(null); info.expandInlineDiffs = expandInlineDiffs().orElse(null); diff --git a/javatests/com/google/gerrit/acceptance/api/accounts/GeneralPreferencesIT.java b/javatests/com/google/gerrit/acceptance/api/accounts/GeneralPreferencesIT.java index 3b106a461f..6717fb7ec1 100644 --- a/javatests/com/google/gerrit/acceptance/api/accounts/GeneralPreferencesIT.java +++ b/javatests/com/google/gerrit/acceptance/api/accounts/GeneralPreferencesIT.java @@ -27,7 +27,6 @@ import com.google.gerrit.extensions.client.GeneralPreferencesInfo; import com.google.gerrit.extensions.client.GeneralPreferencesInfo.DateFormat; import com.google.gerrit.extensions.client.GeneralPreferencesInfo.DefaultBase; import com.google.gerrit.extensions.client.GeneralPreferencesInfo.DiffView; -import com.google.gerrit.extensions.client.GeneralPreferencesInfo.DownloadCommand; import com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailFormat; import com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy; import com.google.gerrit.extensions.client.GeneralPreferencesInfo.TimeFormat; @@ -69,7 +68,6 @@ public class GeneralPreferencesIT extends AbstractDaemonTest { // change all default values i.changesPerPage *= -1; - i.downloadCommand = DownloadCommand.REPO_DOWNLOAD; i.dateFormat = DateFormat.US; i.timeFormat = TimeFormat.HHMM_24; i.emailStrategy = EmailStrategy.DISABLED;