diff --git a/Documentation/intro-project-owner.txt b/Documentation/intro-project-owner.txt index 1f98291382..9f148af49d 100644 --- a/Documentation/intro-project-owner.txt +++ b/Documentation/intro-project-owner.txt @@ -586,13 +586,6 @@ The `download-commands` plugin provides the default download commands Gerrit administrators may configure which of the commands are shown on the change screen. -- link:https://gerrit-review.googlesource.com/admin/repos/plugins/egit[ - egit] plugin: -+ -The `egit` plugin provides the change ref as a download command, which is -needed for downloading a change from within -link:https://www.eclipse.org/egit/[EGit]. - - link:https://gerrit-review.googlesource.com/admin/repos/plugins/project-download-commands[ project-download-commands] plugin: + @@ -759,7 +752,14 @@ link:project-configuration.html#project-state[project state] to `ReadOnly` or Gerrit core does not support the renaming of projects. -As workaround you can perform the following steps: +If the link:https://gerrit-review.googlesource.com/admin/repos/plugins/rename-project[rename-project] +plugin is installed, projects can be renamed using the +link:https://gerrit.googlesource.com/plugins/rename-project/+/refs/heads/master/src/main/resources/Documentation/cmd-rename.md[rename-project] +ssh command. Find details about prerequisites in the +link:https://gerrit.googlesource.com/plugins/rename-project/+/refs/heads/master/src/main/resources/Documentation/about.md[plugin documentation]. + +If you don't want to use the rename-project plugin you can perform the following steps as +a workaround: . link:#project-creation[Create a new project] with the new name. . link:#import-history[Import the history of the old project]. @@ -768,11 +768,6 @@ As workaround you can perform the following steps: Please note that a drawback of this workaround is that the whole review history (changes, review comments) is lost. -Alternatively, you can use the -link:https://gerrit.googlesource.com/plugins/importer/[importer] plugin -to copy the project _including the review history_, and then -link:#project-deletion[delete the old project]. - GERRIT ------ Part of link:index.html[Gerrit Code Review] diff --git a/java/com/google/gerrit/acceptance/BUILD b/java/com/google/gerrit/acceptance/BUILD index b4984f9471..0e5d040539 100644 --- a/java/com/google/gerrit/acceptance/BUILD +++ b/java/com/google/gerrit/acceptance/BUILD @@ -106,7 +106,6 @@ java_library2( "//java/com/google/gerrit/lucene", "//java/com/google/gerrit/mail", "//java/com/google/gerrit/metrics", - "//java/com/google/gerrit/pgm/init", "//java/com/google/gerrit/reviewdb:server", "//java/com/google/gerrit/server", "//java/com/google/gerrit/server/audit", diff --git a/java/com/google/gerrit/httpd/auth/oauth/BUILD b/java/com/google/gerrit/httpd/auth/oauth/BUILD index b74a65a20b..e201e5902b 100644 --- a/java/com/google/gerrit/httpd/auth/oauth/BUILD +++ b/java/com/google/gerrit/httpd/auth/oauth/BUILD @@ -13,7 +13,6 @@ java_library( "//java/com/google/gerrit/httpd", "//java/com/google/gerrit/reviewdb:server", "//java/com/google/gerrit/server", - "//java/com/google/gerrit/server/audit", "//lib:gson", "//lib:guava", "//lib:servlet-api-3_1", diff --git a/java/com/google/gerrit/httpd/auth/openid/BUILD b/java/com/google/gerrit/httpd/auth/openid/BUILD index 95b1efc191..cd204e79e3 100644 --- a/java/com/google/gerrit/httpd/auth/openid/BUILD +++ b/java/com/google/gerrit/httpd/auth/openid/BUILD @@ -16,7 +16,6 @@ java_library( "//java/com/google/gerrit/reviewdb:server", "//java/com/google/gerrit/util/http", "//java/com/google/gerrit/server", - "//java/com/google/gerrit/server/audit", "//lib:guava", "//java/com/google/gwtorm", "//lib:servlet-api-3_1", diff --git a/java/com/google/gerrit/httpd/init/BUILD b/java/com/google/gerrit/httpd/init/BUILD index 09772fddca..de94a1a58c 100644 --- a/java/com/google/gerrit/httpd/init/BUILD +++ b/java/com/google/gerrit/httpd/init/BUILD @@ -16,14 +16,12 @@ java_library( "//java/com/google/gerrit/metrics/dropwizard", "//java/com/google/gerrit/pgm/init", "//java/com/google/gerrit/pgm/util", - "//java/com/google/gerrit/reviewdb:server", "//java/com/google/gerrit/server", "//java/com/google/gerrit/server:module", "//java/com/google/gerrit/server/api", "//java/com/google/gerrit/server/audit", "//java/com/google/gerrit/server/cache/h2", "//java/com/google/gerrit/server/cache/mem", - "//java/com/google/gerrit/server/git/receive", "//java/com/google/gerrit/server/restapi", "//java/com/google/gerrit/server/schema", "//java/com/google/gerrit/sshd", @@ -33,6 +31,5 @@ java_library( "//lib/guice", "//lib/guice:guice-servlet", "//lib/jgit/org.eclipse.jgit:jgit", - "//prolog:gerrit-prolog-common", ], ) diff --git a/java/com/google/gerrit/lucene/BUILD b/java/com/google/gerrit/lucene/BUILD index 40b2548b46..40e3157b48 100644 --- a/java/com/google/gerrit/lucene/BUILD +++ b/java/com/google/gerrit/lucene/BUILD @@ -9,8 +9,6 @@ java_library( deps = [ "//java/com/google/gerrit/index", "//java/com/google/gerrit/index:query_exception", - "//java/com/google/gerrit/reviewdb:server", - "//java/com/google/gerrit/server", "//lib:guava", "//lib/lucene:lucene-core-and-backward-codecs", ], diff --git a/java/com/google/gerrit/metrics/dropwizard/BUILD b/java/com/google/gerrit/metrics/dropwizard/BUILD index 307980939f..4b3859f7a8 100644 --- a/java/com/google/gerrit/metrics/dropwizard/BUILD +++ b/java/com/google/gerrit/metrics/dropwizard/BUILD @@ -8,7 +8,6 @@ java_library( "//java/com/google/gerrit/common:annotations", "//java/com/google/gerrit/extensions:api", "//java/com/google/gerrit/metrics", - "//java/com/google/gerrit/pgm/http/jetty", "//java/com/google/gerrit/server", "//lib:args4j", "//lib:guava", diff --git a/java/com/google/gerrit/pgm/BUILD b/java/com/google/gerrit/pgm/BUILD index 2dd4ba52ce..5cb84c158e 100644 --- a/java/com/google/gerrit/pgm/BUILD +++ b/java/com/google/gerrit/pgm/BUILD @@ -43,13 +43,11 @@ java_library( "//java/com/google/gerrit/server/audit", "//java/com/google/gerrit/server/cache/h2", "//java/com/google/gerrit/server/cache/mem", - "//java/com/google/gerrit/server/git/receive", "//java/com/google/gerrit/server/ioutil", "//java/com/google/gerrit/server/restapi", "//java/com/google/gerrit/server/schema", "//java/com/google/gerrit/server/util/time", "//java/com/google/gerrit/sshd", - "//java/com/google/gerrit/util/http", "//lib:args4j", "//lib:guava", "//lib:protobuf", diff --git a/java/com/google/gerrit/pgm/http/jetty/BUILD b/java/com/google/gerrit/pgm/http/jetty/BUILD index 43a8ed92b8..6e54a9461a 100644 --- a/java/com/google/gerrit/pgm/http/jetty/BUILD +++ b/java/com/google/gerrit/pgm/http/jetty/BUILD @@ -5,10 +5,8 @@ java_library( srcs = glob(["**/*.java"]), visibility = ["//visibility:public"], deps = [ - "//java/com/google/gerrit/common:server", "//java/com/google/gerrit/extensions:api", "//java/com/google/gerrit/httpd", - "//java/com/google/gerrit/launcher", "//java/com/google/gerrit/lifecycle", "//java/com/google/gerrit/metrics", "//java/com/google/gerrit/server", diff --git a/java/com/google/gerrit/pgm/util/BUILD b/java/com/google/gerrit/pgm/util/BUILD index 94798f70ad..60fb5e4faa 100644 --- a/java/com/google/gerrit/pgm/util/BUILD +++ b/java/com/google/gerrit/pgm/util/BUILD @@ -12,10 +12,8 @@ java_library( "//java/com/google/gerrit/metrics/dropwizard", "//java/com/google/gerrit/reviewdb:server", "//java/com/google/gerrit/server", - "//java/com/google/gerrit/server:module", "//java/com/google/gerrit/server/cache/h2", "//java/com/google/gerrit/server/cache/mem", - "//java/com/google/gerrit/server/git/receive", "//java/com/google/gerrit/server/restapi", "//java/com/google/gerrit/server/schema", "//java/com/google/gerrit/util/cli", diff --git a/java/com/google/gerrit/server/api/BUILD b/java/com/google/gerrit/server/api/BUILD index 459c16ae0e..89b1370029 100644 --- a/java/com/google/gerrit/server/api/BUILD +++ b/java/com/google/gerrit/server/api/BUILD @@ -11,7 +11,6 @@ java_library( "//java/com/google/gerrit/common:server", "//java/com/google/gerrit/exceptions", "//java/com/google/gerrit/extensions:api", - "//java/com/google/gerrit/lifecycle", "//java/com/google/gerrit/reviewdb:server", "//java/com/google/gerrit/server", "//java/com/google/gerrit/server/restapi", diff --git a/java/com/google/gerrit/server/audit/BUILD b/java/com/google/gerrit/server/audit/BUILD index 5c2a40aa06..f666746e21 100644 --- a/java/com/google/gerrit/server/audit/BUILD +++ b/java/com/google/gerrit/server/audit/BUILD @@ -10,12 +10,6 @@ java_library( visibility = ["//visibility:public"], deps = [ "//java/com/google/gerrit/extensions:api", - "//java/com/google/gerrit/index", - "//java/com/google/gerrit/index:query_exception", - "//java/com/google/gerrit/index/project", - "//java/com/google/gerrit/lifecycle", - "//java/com/google/gerrit/metrics", - "//java/com/google/gerrit/prettify:server", "//java/com/google/gerrit/reviewdb:server", "//java/com/google/gerrit/server", "//java/com/google/gerrit/server/ioutil", @@ -83,7 +77,6 @@ java_library( "//lib/log:jsonevent-layout", "//lib/log:log4j", "//lib/lucene:lucene-analyzers-common", - "//lib/lucene:lucene-core-and-backward-codecs", "//lib/lucene:lucene-queryparser", "//lib/mime4j:core", "//lib/mime4j:dom", diff --git a/java/com/google/gerrit/server/cache/h2/BUILD b/java/com/google/gerrit/server/cache/h2/BUILD index 79baefc467..a191f75fcb 100644 --- a/java/com/google/gerrit/server/cache/h2/BUILD +++ b/java/com/google/gerrit/server/cache/h2/BUILD @@ -6,7 +6,6 @@ java_library( visibility = ["//visibility:public"], deps = [ "//java/com/google/gerrit/common:annotations", - "//java/com/google/gerrit/common:server", "//java/com/google/gerrit/extensions:api", "//java/com/google/gerrit/lifecycle", "//java/com/google/gerrit/server", diff --git a/java/com/google/gerrit/server/group/db/testing/BUILD b/java/com/google/gerrit/server/group/db/testing/BUILD index b5d5a43f5f..0cc45fd020 100644 --- a/java/com/google/gerrit/server/group/db/testing/BUILD +++ b/java/com/google/gerrit/server/group/db/testing/BUILD @@ -7,9 +7,6 @@ java_library( testonly = True, srcs = glob(["*.java"]), deps = [ - "//java/com/google/gerrit/common:server", - "//java/com/google/gerrit/extensions:api", - "//java/com/google/gerrit/reviewdb:server", "//java/com/google/gerrit/server", "//lib:guava", "//lib/jgit/org.eclipse.jgit:jgit", diff --git a/java/com/google/gerrit/server/notedb/DeleteZombieCommentsRefs.java b/java/com/google/gerrit/server/notedb/DeleteZombieCommentsRefs.java index 2b98554a04..0070cc54f0 100644 --- a/java/com/google/gerrit/server/notedb/DeleteZombieCommentsRefs.java +++ b/java/com/google/gerrit/server/notedb/DeleteZombieCommentsRefs.java @@ -17,6 +17,7 @@ package com.google.gerrit.server.notedb; import static com.google.common.collect.ImmutableList.toImmutableList; import com.google.common.collect.Iterables; +import com.google.common.flogger.FluentLogger; import com.google.gerrit.git.RefUpdateUtil; import com.google.gerrit.reviewdb.client.Change; import com.google.gerrit.server.config.AllUsersName; @@ -42,6 +43,8 @@ import org.eclipse.jgit.transport.ReceiveCommand; * and not get deleted. These refs point to an empty tree. */ public class DeleteZombieCommentsRefs { + private static final FluentLogger logger = FluentLogger.forEnclosingClass(); + private final String EMPTY_TREE_ID = "4b825dc642cb6eb9a060e54bf8d69288fbee4904"; private final String DRAFT_REFS_PREFIX = "refs/draft-comments"; private final int CHUNK_SIZE = 100; // log progress after deleting every CHUNK_SIZE refs @@ -70,18 +73,15 @@ public class DeleteZombieCommentsRefs { List draftRefs = allUsersRepo.getRefDatabase().getRefsByPrefix(DRAFT_REFS_PREFIX); List zombieRefs = filterZombieRefs(draftRefs); - System.out.println( - String.format( - "Found a total of %d zombie draft refs in %s repo.", - zombieRefs.size(), allUsers.get())); + logger.atInfo().log( + "Found a total of %d zombie draft refs in %s repo.", zombieRefs.size(), allUsers.get()); - System.out.println(String.format("Cleanup percentage = %d", cleanupPercentage)); + logger.atInfo().log("Cleanup percentage = %d", cleanupPercentage); zombieRefs = zombieRefs.stream() .filter(ref -> Change.Id.fromAllUsersRef(ref.getName()).get() % 100 < cleanupPercentage) .collect(toImmutableList()); - System.out.println( - String.format("Number of zombie refs to be cleaned = %d", zombieRefs.size())); + logger.atInfo().log("Number of zombie refs to be cleaned = %d", zombieRefs.size()); long zombieRefsCnt = zombieRefs.size(); long deletedRefsCnt = 0; @@ -124,7 +124,7 @@ public class DeleteZombieCommentsRefs { } private void logProgress(long deletedRefsCount, long allRefsCount, long elapsed) { - System.out.format( + logger.atInfo().log( "Deleted %d/%d zombie draft refs (%d seconds)\n", deletedRefsCount, allRefsCount, elapsed); } } diff --git a/java/com/google/gerrit/server/restapi/BUILD b/java/com/google/gerrit/server/restapi/BUILD index 9e733b251b..c4820198d4 100644 --- a/java/com/google/gerrit/server/restapi/BUILD +++ b/java/com/google/gerrit/server/restapi/BUILD @@ -23,7 +23,6 @@ java_library( "//java/com/google/gerrit/reviewdb:server", "//java/com/google/gerrit/server", "//java/com/google/gerrit/server/ioutil", - "//java/com/google/gerrit/server/logging", "//java/com/google/gerrit/server/util/time", "//java/com/google/gerrit/util/cli", "//lib:args4j", diff --git a/java/com/google/gerrit/sshd/BUILD b/java/com/google/gerrit/sshd/BUILD index 4ef70c7229..557fde1e6a 100644 --- a/java/com/google/gerrit/sshd/BUILD +++ b/java/com/google/gerrit/sshd/BUILD @@ -11,12 +11,10 @@ java_library( "//java/com/google/gerrit/extensions:api", "//java/com/google/gerrit/json", "//java/com/google/gerrit/lifecycle", - "//java/com/google/gerrit/lucene", "//java/com/google/gerrit/metrics", "//java/com/google/gerrit/reviewdb:server", "//java/com/google/gerrit/server", "//java/com/google/gerrit/server/audit", - "//java/com/google/gerrit/server/cache/h2", "//java/com/google/gerrit/server/git/receive", "//java/com/google/gerrit/server/ioutil", "//java/com/google/gerrit/server/logging", diff --git a/java/com/google/gerrit/util/cli/BUILD b/java/com/google/gerrit/util/cli/BUILD index e4f2c21d86..ebcc67ed70 100644 --- a/java/com/google/gerrit/util/cli/BUILD +++ b/java/com/google/gerrit/util/cli/BUILD @@ -6,7 +6,6 @@ java_library( visibility = ["//visibility:public"], deps = [ "//java/com/google/gerrit/common:annotations", - "//java/com/google/gerrit/common:server", "//lib:args4j", "//lib:guava", "//lib/auto:auto-value-annotations", diff --git a/javatests/com/google/gerrit/gpg/BUILD b/javatests/com/google/gerrit/gpg/BUILD index 6edfa93d91..f73208d8b6 100644 --- a/javatests/com/google/gerrit/gpg/BUILD +++ b/javatests/com/google/gerrit/gpg/BUILD @@ -6,16 +6,12 @@ junit_tests( tags = ["no_windows"], visibility = ["//visibility:public"], deps = [ - "//java/com/google/gerrit/common:server", "//java/com/google/gerrit/extensions:api", "//java/com/google/gerrit/gpg", "//java/com/google/gerrit/gpg/testing:gpg-test-util", "//java/com/google/gerrit/lifecycle", - "//java/com/google/gerrit/lucene", "//java/com/google/gerrit/reviewdb:server", "//java/com/google/gerrit/server", - "//java/com/google/gerrit/server/cache/h2", - "//java/com/google/gerrit/server/project/testing:project-test-util", "//java/com/google/gerrit/server/schema", "//java/com/google/gerrit/testing:gerrit-test-util", "//lib:guava", diff --git a/javatests/com/google/gerrit/httpd/BUILD b/javatests/com/google/gerrit/httpd/BUILD index 0fbd9224ae..adf072efe0 100644 --- a/javatests/com/google/gerrit/httpd/BUILD +++ b/javatests/com/google/gerrit/httpd/BUILD @@ -4,11 +4,8 @@ junit_tests( name = "httpd_tests", srcs = glob(["**/*.java"]), deps = [ - "//java/com/google/gerrit/common:annotations", - "//java/com/google/gerrit/common:server", "//java/com/google/gerrit/extensions:api", "//java/com/google/gerrit/httpd", - "//java/com/google/gerrit/reviewdb:server", "//java/com/google/gerrit/server", "//java/com/google/gerrit/testing:gerrit-test-util", "//java/com/google/gerrit/util/http", diff --git a/javatests/com/google/gerrit/mail/BUILD b/javatests/com/google/gerrit/mail/BUILD index 54671dd7e0..b1c97120d0 100644 --- a/javatests/com/google/gerrit/mail/BUILD +++ b/javatests/com/google/gerrit/mail/BUILD @@ -8,18 +8,8 @@ junit_tests( ), visibility = ["//visibility:public"], deps = [ - "//java/com/google/gerrit/common:annotations", - "//java/com/google/gerrit/common:server", - "//java/com/google/gerrit/extensions:api", - "//java/com/google/gerrit/extensions/common/testing:common-test-util", - "//java/com/google/gerrit/index", - "//java/com/google/gerrit/index:query_exception", - "//java/com/google/gerrit/lifecycle", "//java/com/google/gerrit/mail", - "//java/com/google/gerrit/metrics", "//java/com/google/gerrit/reviewdb:server", - "//java/com/google/gerrit/server", - "//java/com/google/gerrit/server/project/testing:project-test-util", "//java/com/google/gerrit/testing:gerrit-test-util", "//lib:gson", "//lib:guava-retrying", diff --git a/javatests/com/google/gerrit/pgm/BUILD b/javatests/com/google/gerrit/pgm/BUILD index 84eda60605..e82b8848a3 100644 --- a/javatests/com/google/gerrit/pgm/BUILD +++ b/javatests/com/google/gerrit/pgm/BUILD @@ -7,7 +7,6 @@ junit_tests( deps = [ "//java/com/google/gerrit/common:server", "//java/com/google/gerrit/pgm", - "//java/com/google/gerrit/pgm/http/jetty", "//java/com/google/gerrit/pgm/init", "//java/com/google/gerrit/pgm/init/api", "//java/com/google/gerrit/server", diff --git a/javatests/com/google/gerrit/server/cache/h2/BUILD b/javatests/com/google/gerrit/server/cache/h2/BUILD index 2ee8e48c05..98f1b0e9ec 100644 --- a/javatests/com/google/gerrit/server/cache/h2/BUILD +++ b/javatests/com/google/gerrit/server/cache/h2/BUILD @@ -4,7 +4,6 @@ junit_tests( name = "tests", srcs = glob(["**/*.java"]), deps = [ - "//java/com/google/gerrit/server", "//java/com/google/gerrit/server/cache/h2", "//java/com/google/gerrit/server/cache/serialize", "//lib:guava", diff --git a/javatests/com/google/gerrit/server/query/account/BUILD b/javatests/com/google/gerrit/server/query/account/BUILD index 7b72f4e268..ba0f779e02 100644 --- a/javatests/com/google/gerrit/server/query/account/BUILD +++ b/javatests/com/google/gerrit/server/query/account/BUILD @@ -8,6 +8,9 @@ java_library( testonly = True, srcs = ABSTRACT_QUERY_TEST, visibility = ["//visibility:public"], + runtime_deps = [ + "//prolog:gerrit-prolog-common", + ], deps = [ "//java/com/google/gerrit/extensions:api", "//java/com/google/gerrit/index", @@ -21,7 +24,6 @@ java_library( "//lib/jgit/org.eclipse.jgit:jgit", "//lib/truth", "//lib/truth:truth-java8-extension", - "//prolog:gerrit-prolog-common", ], ) diff --git a/javatests/com/google/gerrit/server/query/change/BUILD b/javatests/com/google/gerrit/server/query/change/BUILD index 4a3f508cdc..8347484e2e 100644 --- a/javatests/com/google/gerrit/server/query/change/BUILD +++ b/javatests/com/google/gerrit/server/query/change/BUILD @@ -8,7 +8,9 @@ java_library( testonly = True, srcs = ABSTRACT_QUERY_TEST, visibility = ["//visibility:public"], - runtime_deps = ["//prolog:gerrit-prolog-common"], + runtime_deps = [ + "//prolog:gerrit-prolog-common", + ], deps = [ "//java/com/google/gerrit/common:annotations", "//java/com/google/gerrit/common:server", diff --git a/javatests/com/google/gerrit/server/query/project/BUILD b/javatests/com/google/gerrit/server/query/project/BUILD index e978be6114..5afc7da590 100644 --- a/javatests/com/google/gerrit/server/query/project/BUILD +++ b/javatests/com/google/gerrit/server/query/project/BUILD @@ -35,7 +35,6 @@ junit_tests( deps = [ ":abstract_query_tests", "//java/com/google/gerrit/index/project", - "//java/com/google/gerrit/server", "//java/com/google/gerrit/testing:gerrit-test-util", "//lib/guice", "//lib/jgit/org.eclipse.jgit:jgit", diff --git a/javatests/com/google/gerrit/server/rules/BUILD b/javatests/com/google/gerrit/server/rules/BUILD index 62d9a79177..1e335db063 100644 --- a/javatests/com/google/gerrit/server/rules/BUILD +++ b/javatests/com/google/gerrit/server/rules/BUILD @@ -5,6 +5,7 @@ junit_tests( srcs = glob(["*.java"]), resource_strip_prefix = "prologtests", resources = ["//prologtests:gerrit_common_test"], + runtime_deps = ["//prolog:gerrit-prolog-common"], deps = [ "//java/com/google/gerrit/common:server", "//java/com/google/gerrit/reviewdb:server", @@ -17,6 +18,5 @@ junit_tests( "//lib/jgit/org.eclipse.jgit:jgit", "//lib/prolog:runtime", "//lib/truth", - "//prolog:gerrit-prolog-common", ], ) diff --git a/javatests/com/google/gerrit/server/update/BUILD b/javatests/com/google/gerrit/server/update/BUILD index efe24d5369..c98b35fc3a 100644 --- a/javatests/com/google/gerrit/server/update/BUILD +++ b/javatests/com/google/gerrit/server/update/BUILD @@ -5,11 +5,8 @@ junit_tests( size = "small", srcs = glob(["*.java"]), deps = [ - "//java/com/google/gerrit/common:server", - "//java/com/google/gerrit/lifecycle", "//java/com/google/gerrit/reviewdb:server", "//java/com/google/gerrit/server", - "//java/com/google/gerrit/server/schema", "//java/com/google/gerrit/server/util/time", "//java/com/google/gerrit/testing:gerrit-test-util", "//lib:guava", diff --git a/javatests/com/google/gerrit/sshd/BUILD b/javatests/com/google/gerrit/sshd/BUILD index 7a5e18edfa..c010d7c4d3 100644 --- a/javatests/com/google/gerrit/sshd/BUILD +++ b/javatests/com/google/gerrit/sshd/BUILD @@ -5,7 +5,6 @@ junit_tests( srcs = glob(["**/*.java"]), deps = [ "//java/com/google/gerrit/extensions:api", - "//java/com/google/gerrit/server", "//java/com/google/gerrit/sshd", "//java/com/google/gerrit/testing:gerrit-test-util", "//lib/mina:sshd", diff --git a/javatests/com/google/gerrit/util/http/testutil/BUILD b/javatests/com/google/gerrit/util/http/testutil/BUILD index 5cb94c6d60..6acc7caf03 100644 --- a/javatests/com/google/gerrit/util/http/testutil/BUILD +++ b/javatests/com/google/gerrit/util/http/testutil/BUILD @@ -6,7 +6,6 @@ java_library( srcs = glob(["**/*.java"]), visibility = ["//visibility:public"], deps = [ - "//java/com/google/gerrit/extensions:api", "//lib:guava", "//lib:servlet-api-3_1", "//lib/httpcomponents:httpclient", diff --git a/plugins/BUILD b/plugins/BUILD index 3e937687dd..610ee9ba40 100644 --- a/plugins/BUILD +++ b/plugins/BUILD @@ -40,6 +40,7 @@ EXPORTS = [ "//java/com/google/gerrit/index:query_exception", "//java/com/google/gerrit/json", "//java/com/google/gerrit/lifecycle", + "//java/com/google/gerrit/lucene", "//java/com/google/gerrit/mail", "//java/com/google/gerrit/metrics", "//java/com/google/gerrit/metrics/dropwizard", diff --git a/polygerrit-ui/app/elements/diff/gr-diff-view/gr-diff-view.html b/polygerrit-ui/app/elements/diff/gr-diff-view/gr-diff-view.html index 104aaa8414..72b5ebe64c 100644 --- a/polygerrit-ui/app/elements/diff/gr-diff-view/gr-diff-view.html +++ b/polygerrit-ui/app/elements/diff/gr-diff-view/gr-diff-view.html @@ -138,11 +138,13 @@ limitations under the License. align-items: center; display: flex; } - .diffModeSelector { + .diffModeSelector, + .editButton { align-items: center; display: flex; } - .diffModeSelector span { + .diffModeSelector span, + .editButton span { margin-right: .2rem; } .diffModeSelector.hide, @@ -154,6 +156,9 @@ limitations under the License. text-transform: none; } } + .editButtona a { + text-decoration: none; + } @media screen and (max-width: 50em) { header { padding: .5em var(--default-horizontal-margin); @@ -283,8 +288,15 @@ limitations under the License. link disabled="[[_isBlameLoading]]" on-tap="_toggleBlame">[[_computeBlameToggleLabel(_isBlameLoaded, _isBlameLoading)]] - +
Diff view: arg === undefined)) { + return ''; + } + return Gerrit.Nav.getEditUrlForDiff( + change, path, patchRange.patchNum); + }, + /** * Gives an object representing the target of navigating either left or * right through the change. The resulting object will have one of the @@ -1101,5 +1109,9 @@ _handleReloadingDiffPreference() { this._getDiffPreferences(); }, + + _computeIsLoggedIn(loggedIn) { + return loggedIn ? true : false; + }, }); })(); diff --git a/polygerrit-ui/app/elements/shared/gr-editable-content/gr-editable-content.js b/polygerrit-ui/app/elements/shared/gr-editable-content/gr-editable-content.js index d9e228bd43..5463564aa0 100644 --- a/polygerrit-ui/app/elements/shared/gr-editable-content/gr-editable-content.js +++ b/polygerrit-ui/app/elements/shared/gr-editable-content/gr-editable-content.js @@ -82,13 +82,34 @@ if (newContent.length) { this.$.storage.setEditableContentItem(this.storageKey, newContent); } else { + // This does not really happen, because we don't clear newContent + // after saving (see below). So this only occurs when the user clears + // all the content in the editable textarea. But cleans + // up itself after one day, so we are not so concerned about leaving + // some garbage behind. this.$.storage.eraseEditableContentItem(this.storageKey); } }, STORAGE_DEBOUNCE_INTERVAL_MS); }, _editingChanged(editing) { - if (!editing) { return; } + // This method is for initializing _newContent when you start editing. + // Restoring content from local storage is not perfect and has + // some issues: + // + // 1. When you start editing in multiple tabs, then we are vulnerable to + // race conditions between the tabs. + // 2. The stored content is keyed by revision, so when you upload a new + // patchset and click "reload" and then click "cancel" on the content- + // editable, then you won't be able to recover the content anymore. + // + // Because of these issues we believe that it is better to only recover + // content from local storage when you enter editing mode for the first + // time. Otherwise it is better to just keep the last editing state from + // the same session. + if (!editing || this._newContent) { + return; + } let content; if (this.storageKey) { @@ -111,12 +132,15 @@ }, _computeSaveDisabled(disabled, content, newContent) { - return disabled || (content === newContent); + return disabled || !newContent || content === newContent; }, _handleSave(e) { e.preventDefault(); this.fire('editable-content-save', {content: this._newContent}); + // It would be nice, if we would set this._newContent = undefined here, + // but we can only do that when we are sure that the save operation has + // succeeded. }, _handleCancel(e) { diff --git a/polygerrit-ui/app/elements/shared/gr-editable-content/gr-editable-content_test.html b/polygerrit-ui/app/elements/shared/gr-editable-content/gr-editable-content_test.html index cc44d9b6d0..ca500cbd21 100644 --- a/polygerrit-ui/app/elements/shared/gr-editable-content/gr-editable-content_test.html +++ b/polygerrit-ui/app/elements/shared/gr-editable-content/gr-editable-content_test.html @@ -62,11 +62,11 @@ limitations under the License. MockInteractions.tap(element.$$('gr-button:not([primary])')); }); - test('enabling editing updates edit field contents', () => { + test('enabling editing keeps old content', () => { element.content = 'current content'; - element._newContent = 'stale content'; + element._newContent = 'old content'; element.editing = true; - assert.equal(element._newContent, 'current content'); + assert.equal(element._newContent, 'old content'); }); test('disabling editing does not update edit field contents', () => { diff --git a/tools/bzl/pkg_war.bzl b/tools/bzl/pkg_war.bzl index ab753bda69..c9ac0fe5a0 100644 --- a/tools/bzl/pkg_war.bzl +++ b/tools/bzl/pkg_war.bzl @@ -23,6 +23,7 @@ LIBS = [ "//lib/bouncycastle:bcprov", "//lib/bouncycastle:bcpg", "//lib/log:impl-log4j", + "//prolog:gerrit-prolog-common", "//resources:log4j-config", ]