Merge "Support 'conflicts:<change>' operator to find changes with same files"
diff --git a/.buckversion b/.buckversion
index 62fc368..e39bcf8 100644
--- a/.buckversion
+++ b/.buckversion
@@ -1 +1 @@
-3fd3ea153c5444df2376de8ee87594a52a45bf52
+274acb17e9b6dc9ee60bc1371c47a7f49640c24c
diff --git a/.gitmodules b/.gitmodules
index 24cff1a..6476c4c 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,20 +1,20 @@
[submodule "plugins/commit-message-length-validator"]
path = plugins/commit-message-length-validator
- url = https://gerrit.googlesource.com/plugins/commit-message-length-validator
+ url = ../plugins/commit-message-length-validator
[submodule "plugins/cookbook-plugin"]
path = plugins/cookbook-plugin
- url = https://gerrit.googlesource.com/plugins/cookbook-plugin
+ url = ../plugins/cookbook-plugin
[submodule "plugins/download-commands"]
path = plugins/download-commands
- url = https://gerrit.googlesource.com/plugins/download-commands
+ url = ../plugins/download-commands
[submodule "plugins/replication"]
path = plugins/replication
- url = https://gerrit.googlesource.com/plugins/replication
+ url = ../plugins/replication
[submodule "plugins/reviewnotes"]
path = plugins/reviewnotes
- url = https://gerrit.googlesource.com/plugins/reviewnotes
+ url = ../plugins/reviewnotes
diff --git a/Documentation/access-control.txt b/Documentation/access-control.txt
index db806cc..3fe6a60 100644
--- a/Documentation/access-control.txt
+++ b/Documentation/access-control.txt
@@ -425,7 +425,7 @@
[[category_create]]
-Create reference
+Create Reference
~~~~~~~~~~~~~~~~
The create reference category controls whether it is possible to
@@ -1336,3 +1336,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/cmd-apropos.txt b/Documentation/cmd-apropos.txt
index a24548d..29ce9fa 100644
--- a/Documentation/cmd-apropos.txt
+++ b/Documentation/cmd-apropos.txt
@@ -61,3 +61,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/cmd-ban-commit.txt b/Documentation/cmd-ban-commit.txt
index fb4a2ac9..fcdad5c 100644
--- a/Documentation/cmd-ban-commit.txt
+++ b/Documentation/cmd-ban-commit.txt
@@ -58,3 +58,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/cmd-cherry-pick.txt b/Documentation/cmd-cherry-pick.txt
index 15a8524..1275d20ea 100644
--- a/Documentation/cmd-cherry-pick.txt
+++ b/Documentation/cmd-cherry-pick.txt
@@ -45,3 +45,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/cmd-create-account.txt b/Documentation/cmd-create-account.txt
index 3ecb764..f22b4df 100644
--- a/Documentation/cmd-create-account.txt
+++ b/Documentation/cmd-create-account.txt
@@ -81,3 +81,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/cmd-create-group.txt b/Documentation/cmd-create-group.txt
index 8dc6dcc..1102a6d 100644
--- a/Documentation/cmd-create-group.txt
+++ b/Documentation/cmd-create-group.txt
@@ -92,3 +92,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/cmd-create-project.txt b/Documentation/cmd-create-project.txt
index e3ad834..da7820f 100644
--- a/Documentation/cmd-create-project.txt
+++ b/Documentation/cmd-create-project.txt
@@ -201,3 +201,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/cmd-flush-caches.txt b/Documentation/cmd-flush-caches.txt
index bc6fac5..050b433 100644
--- a/Documentation/cmd-flush-caches.txt
+++ b/Documentation/cmd-flush-caches.txt
@@ -104,3 +104,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/cmd-gc.txt b/Documentation/cmd-gc.txt
index 07b899a..50710e2 100644
--- a/Documentation/cmd-gc.txt
+++ b/Documentation/cmd-gc.txt
@@ -70,3 +70,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/cmd-gsql.txt b/Documentation/cmd-gsql.txt
index 3c1fd31..4efbb2a 100644
--- a/Documentation/cmd-gsql.txt
+++ b/Documentation/cmd-gsql.txt
@@ -65,3 +65,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/cmd-hook-commit-msg.txt b/Documentation/cmd-hook-commit-msg.txt
index c0c1e6c..c3ad1ac 100644
--- a/Documentation/cmd-hook-commit-msg.txt
+++ b/Documentation/cmd-hook-commit-msg.txt
@@ -117,6 +117,7 @@
GERRIT
------
-
-
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/cmd-index.txt b/Documentation/cmd-index.txt
index 650b0bb..a274dec 100644
--- a/Documentation/cmd-index.txt
+++ b/Documentation/cmd-index.txt
@@ -183,3 +183,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/cmd-kill.txt b/Documentation/cmd-kill.txt
index f09053e..94371f0 100644
--- a/Documentation/cmd-kill.txt
+++ b/Documentation/cmd-kill.txt
@@ -28,3 +28,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/cmd-ls-groups.txt b/Documentation/cmd-ls-groups.txt
index 17ebba1..0713947 100644
--- a/Documentation/cmd-ls-groups.txt
+++ b/Documentation/cmd-ls-groups.txt
@@ -156,3 +156,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/cmd-ls-members.txt b/Documentation/cmd-ls-members.txt
index 9814ff2..d5f127f 100644
--- a/Documentation/cmd-ls-members.txt
+++ b/Documentation/cmd-ls-members.txt
@@ -62,3 +62,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/cmd-ls-projects.txt b/Documentation/cmd-ls-projects.txt
index 26530bd..5cd416d1 100644
--- a/Documentation/cmd-ls-projects.txt
+++ b/Documentation/cmd-ls-projects.txt
@@ -154,3 +154,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/cmd-ls-user-refs.txt b/Documentation/cmd-ls-user-refs.txt
index 25a99d1..26a083c 100644
--- a/Documentation/cmd-ls-user-refs.txt
+++ b/Documentation/cmd-ls-user-refs.txt
@@ -53,3 +53,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/cmd-plugin-enable.txt b/Documentation/cmd-plugin-enable.txt
index da651ca..ad1736d 100644
--- a/Documentation/cmd-plugin-enable.txt
+++ b/Documentation/cmd-plugin-enable.txt
@@ -42,3 +42,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/cmd-plugin-install.txt b/Documentation/cmd-plugin-install.txt
index 719c2bc..61663a6 100644
--- a/Documentation/cmd-plugin-install.txt
+++ b/Documentation/cmd-plugin-install.txt
@@ -71,3 +71,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/cmd-plugin-ls.txt b/Documentation/cmd-plugin-ls.txt
index 6cce83c..5e651b7 100644
--- a/Documentation/cmd-plugin-ls.txt
+++ b/Documentation/cmd-plugin-ls.txt
@@ -42,3 +42,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/cmd-plugin-reload.txt b/Documentation/cmd-plugin-reload.txt
index 3932e30..a4490a8 100644
--- a/Documentation/cmd-plugin-reload.txt
+++ b/Documentation/cmd-plugin-reload.txt
@@ -46,3 +46,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/cmd-plugin-remove.txt b/Documentation/cmd-plugin-remove.txt
index ab8f95b..f9c0eea 100644
--- a/Documentation/cmd-plugin-remove.txt
+++ b/Documentation/cmd-plugin-remove.txt
@@ -43,3 +43,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/cmd-query.txt b/Documentation/cmd-query.txt
index f7a784f..249b7f9 100644
--- a/Documentation/cmd-query.txt
+++ b/Documentation/cmd-query.txt
@@ -160,3 +160,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/cmd-receive-pack.txt b/Documentation/cmd-receive-pack.txt
index 92bb65e..239d2f5 100644
--- a/Documentation/cmd-receive-pack.txt
+++ b/Documentation/cmd-receive-pack.txt
@@ -88,3 +88,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/cmd-rename-group.txt b/Documentation/cmd-rename-group.txt
index e810727..624ac9b 100644
--- a/Documentation/cmd-rename-group.txt
+++ b/Documentation/cmd-rename-group.txt
@@ -44,3 +44,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/cmd-review.txt b/Documentation/cmd-review.txt
index 70213da..3038ead 100644
--- a/Documentation/cmd-review.txt
+++ b/Documentation/cmd-review.txt
@@ -134,3 +134,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/cmd-set-account.txt b/Documentation/cmd-set-account.txt
index f9855cd..19eb468 100644
--- a/Documentation/cmd-set-account.txt
+++ b/Documentation/cmd-set-account.txt
@@ -94,3 +94,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/cmd-set-members.txt b/Documentation/cmd-set-members.txt
index 7524893..d7da2eb 100644
--- a/Documentation/cmd-set-members.txt
+++ b/Documentation/cmd-set-members.txt
@@ -80,3 +80,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/cmd-set-project-parent.txt b/Documentation/cmd-set-project-parent.txt
index 1e7e6c5..5664890 100644
--- a/Documentation/cmd-set-project-parent.txt
+++ b/Documentation/cmd-set-project-parent.txt
@@ -71,3 +71,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/cmd-set-project.txt b/Documentation/cmd-set-project.txt
index af20006..df694a0 100644
--- a/Documentation/cmd-set-project.txt
+++ b/Documentation/cmd-set-project.txt
@@ -117,3 +117,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/cmd-set-reviewers.txt b/Documentation/cmd-set-reviewers.txt
index 32fd35e..81b493d 100644
--- a/Documentation/cmd-set-reviewers.txt
+++ b/Documentation/cmd-set-reviewers.txt
@@ -87,3 +87,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/cmd-show-caches.txt b/Documentation/cmd-show-caches.txt
index d426508..8c64b05 100644
--- a/Documentation/cmd-show-caches.txt
+++ b/Documentation/cmd-show-caches.txt
@@ -83,3 +83,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/cmd-show-connections.txt b/Documentation/cmd-show-connections.txt
index ab9fadf..154e1c2 100644
--- a/Documentation/cmd-show-connections.txt
+++ b/Documentation/cmd-show-connections.txt
@@ -88,3 +88,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/cmd-show-queue.txt b/Documentation/cmd-show-queue.txt
index 4ab3097..7364d2d 100644
--- a/Documentation/cmd-show-queue.txt
+++ b/Documentation/cmd-show-queue.txt
@@ -90,3 +90,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/cmd-stream-events.txt b/Documentation/cmd-stream-events.txt
index 10689b6..746b3ea 100644
--- a/Documentation/cmd-stream-events.txt
+++ b/Documentation/cmd-stream-events.txt
@@ -52,6 +52,7 @@
Note that any field may be missing in the JSON messages, so consumers of
this JSON stream should deal with that appropriately.
+[[events]]
Events
~~~~~~
Patchset Created
@@ -171,3 +172,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/cmd-suexec.txt b/Documentation/cmd-suexec.txt
index 78fc361..7b128fa 100644
--- a/Documentation/cmd-suexec.txt
+++ b/Documentation/cmd-suexec.txt
@@ -67,3 +67,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/cmd-test-submit-rule.txt b/Documentation/cmd-test-submit-rule.txt
index ae68b80..466182c 100644
--- a/Documentation/cmd-test-submit-rule.txt
+++ b/Documentation/cmd-test-submit-rule.txt
@@ -66,3 +66,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/cmd-test-submit-type.txt b/Documentation/cmd-test-submit-type.txt
index f6d5fba..2b8790c 100644
--- a/Documentation/cmd-test-submit-type.txt
+++ b/Documentation/cmd-test-submit-type.txt
@@ -51,3 +51,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/cmd-version.txt b/Documentation/cmd-version.txt
index aa08848..806e28a 100644
--- a/Documentation/cmd-version.txt
+++ b/Documentation/cmd-version.txt
@@ -46,3 +46,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/config-auto-site-initialization.txt b/Documentation/config-auto-site-initialization.txt
index 4c204fd..6111d5d 100644
--- a/Documentation/config-auto-site-initialization.txt
+++ b/Documentation/config-auto-site-initialization.txt
@@ -80,3 +80,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/config-cla.txt b/Documentation/config-cla.txt
index 6404d4e..fa28e7b 100644
--- a/Documentation/config-cla.txt
+++ b/Documentation/config-cla.txt
@@ -80,3 +80,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/config-contact.txt b/Documentation/config-contact.txt
index 4d8851f..6c59d2a 100644
--- a/Documentation/config-contact.txt
+++ b/Documentation/config-contact.txt
@@ -213,3 +213,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/config-gerrit.txt b/Documentation/config-gerrit.txt
index 814472a..a2dbb9c 100644
--- a/Documentation/config-gerrit.txt
+++ b/Documentation/config-gerrit.txt
@@ -3030,3 +3030,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/config-gitweb.txt b/Documentation/config-gitweb.txt
index 711174f..3e9cb96 100644
--- a/Documentation/config-gitweb.txt
+++ b/Documentation/config-gitweb.txt
@@ -282,3 +282,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/config-hooks.txt b/Documentation/config-hooks.txt
index e232c0c..8fb6e82 100644
--- a/Documentation/config-hooks.txt
+++ b/Documentation/config-hooks.txt
@@ -169,3 +169,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/config-labels.txt b/Documentation/config-labels.txt
index c08d484..ba3d482 100644
--- a/Documentation/config-labels.txt
+++ b/Documentation/config-labels.txt
@@ -315,3 +315,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/config-login-register.txt b/Documentation/config-login-register.txt
index 867f0d4..d3911d7 100644
--- a/Documentation/config-login-register.txt
+++ b/Documentation/config-login-register.txt
@@ -141,3 +141,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/config-mail.txt b/Documentation/config-mail.txt
index 3b8bffa..ca9253ee 100644
--- a/Documentation/config-mail.txt
+++ b/Documentation/config-mail.txt
@@ -211,3 +211,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/config-project-config.txt b/Documentation/config-project-config.txt
index 8529b67..3267c45 100644
--- a/Documentation/config-project-config.txt
+++ b/Documentation/config-project-config.txt
@@ -223,3 +223,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/config-reverseproxy.txt b/Documentation/config-reverseproxy.txt
index 064fe2e..563b322 100644
--- a/Documentation/config-reverseproxy.txt
+++ b/Documentation/config-reverseproxy.txt
@@ -147,3 +147,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/config-sso.txt b/Documentation/config-sso.txt
index e915ffb..1d8d2d6 100644
--- a/Documentation/config-sso.txt
+++ b/Documentation/config-sso.txt
@@ -179,3 +179,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/config-themes.txt b/Documentation/config-themes.txt
index c102381..5eb8094 100644
--- a/Documentation/config-themes.txt
+++ b/Documentation/config-themes.txt
@@ -140,3 +140,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/config-validation.txt b/Documentation/config-validation.txt
index 1b09d19..7ef646b 100644
--- a/Documentation/config-validation.txt
+++ b/Documentation/config-validation.txt
@@ -40,3 +40,6 @@
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/database-setup.txt b/Documentation/database-setup.txt
index 3800473..1f48f53 100644
--- a/Documentation/database-setup.txt
+++ b/Documentation/database-setup.txt
@@ -113,3 +113,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/dev-buck.txt b/Documentation/dev-buck.txt
index 15c145a..750911e 100644
--- a/Documentation/dev-buck.txt
+++ b/Documentation/dev-buck.txt
@@ -374,3 +374,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/dev-contributing.txt b/Documentation/dev-contributing.txt
index edc072d..24fc266 100644
--- a/Documentation/dev-contributing.txt
+++ b/Documentation/dev-contributing.txt
@@ -288,3 +288,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/dev-design.txt b/Documentation/dev-design.txt
index 3cb58b1..06dd95d 100644
--- a/Documentation/dev-design.txt
+++ b/Documentation/dev-design.txt
@@ -739,3 +739,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/dev-eclipse.txt b/Documentation/dev-eclipse.txt
index d2fc8f0..eeee5a3 100644
--- a/Documentation/dev-eclipse.txt
+++ b/Documentation/dev-eclipse.txt
@@ -102,3 +102,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/dev-inspector.txt b/Documentation/dev-inspector.txt
index 485ad7b..925f74c 100644
--- a/Documentation/dev-inspector.txt
+++ b/Documentation/dev-inspector.txt
@@ -300,3 +300,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/dev-plugins.txt b/Documentation/dev-plugins.txt
index 11f7721..f3e4247 100644
--- a/Documentation/dev-plugins.txt
+++ b/Documentation/dev-plugins.txt
@@ -191,6 +191,29 @@
}
----
+A plugin can get its canonical web URL injected at runtime:
+
+[source,java]
+----
+public class MyClass {
+
+ private final String url;
+
+ @Inject
+ public MyClass(@PluginCanonicalWebUrl String url) {
+ this.url = url;
+ }
+
+ [...]
+}
+----
+
+The URL is composed of the server's canonical web URL and the plugin's
+name, i.e. `http://review.example.com:8080/plugin-name`.
+
+The canonical web URL may be injected into any .jar plugin regardless of
+whether or not the plugin provides an HTTP servlet.
+
[[reload_method]]
Reload Method
~~~~~~~~~~~~~
@@ -323,6 +346,12 @@
notifications of these events by implementing the corresponding
listeners.
+* `com.google.gerrit.common.ChangeListener`:
++
+Allows to listen to change events. These are the same
+link:cmd-stream-events.html#events[events] that are also streamed by
+the link:cmd-stream-events.html[gerrit stream-events] command.
+
* `com.google.gerrit.extensions.events.LifecycleListener`:
+
Gerrit server startup and shutdown
@@ -450,6 +479,17 @@
If a plugin needs global configuration, this configuration should be
stored in a `plugin` subsection in the `gerrit.config` file.
+This approach of storing the plugin configuration is only suitable for
+plugins that have a simple configuration that only consists of
+key-value pairs. With this approach it is not possible to have
+subsections in the plugin configuration. Plugins that require a complex
+configuration need to store their configuration in their own
+configuration file where they can make use of subsections. On the other
+hand storing the plugin configuration in a 'plugin' subsection in the
+`gerrit.config` file has the advantage that administrators have all
+configuration parameters in one file, instead of having one
+configuration file per plugin.
+
To avoid conflicts with other plugins, it is recommended that plugins
only use the `plugin` subsection with their own name. For example the
`helloworld` plugin should store its configuration in the
@@ -471,7 +511,7 @@
[...]
-String language = cfg.get("helloworld")
+String language = cfg.getFromGerritConfig("helloworld")
.getString("language", "English");
----
@@ -485,6 +525,17 @@
only for certain projects), this configuration should be stored in a
`plugin` subsection in the project's `project.config` file.
+This approach of storing the plugin configuration is only suitable for
+plugins that have a simple configuration that only consists of
+key-value pairs. With this approach it is not possible to have
+subsections in the plugin configuration. Plugins that require a complex
+configuration need to store their configuration in their own
+configuration file where they can make use of subsections. On the other
+hand storing the plugin configuration in a 'plugin' subsection in the
+`project.config` file has the advantage that project owners have all
+configuration parameters in one file, instead of having one
+configuration file per plugin.
+
To avoid conflicts with other plugins, it is recommended that plugins
only use the `plugin` subsection with their own name. For example the
`helloworld` plugin should store its configuration in the
@@ -506,7 +557,7 @@
[...]
-boolean enabled = cfg.get(project, "helloworld")
+boolean enabled = cfg.getFromProjectConfig(project, "helloworld")
.getBoolean("enabled", false);
----
@@ -520,7 +571,7 @@
[...]
-boolean enabled = cfg.getWithInheritance(project, "helloworld")
+boolean enabled = cfg.getFromProjectConfigWithInheritance(project, "helloworld")
.getBoolean("enabled", false);
----
@@ -1166,3 +1217,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/dev-readme.txt b/Documentation/dev-readme.txt
index 728c8dc..d961f70 100644
--- a/Documentation/dev-readme.txt
+++ b/Documentation/dev-readme.txt
@@ -246,3 +246,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/dev-release-deploy-config.txt b/Documentation/dev-release-deploy-config.txt
index 9c98fff..6ea32b7 100644
--- a/Documentation/dev-release-deploy-config.txt
+++ b/Documentation/dev-release-deploy-config.txt
@@ -132,3 +132,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/dev-release-subproject.txt b/Documentation/dev-release-subproject.txt
index 956bd29..b9a39be 100644
--- a/Documentation/dev-release-subproject.txt
+++ b/Documentation/dev-release-subproject.txt
@@ -107,3 +107,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/dev-release.txt b/Documentation/dev-release.txt
index f9d0d0e..b9b9ff0 100644
--- a/Documentation/dev-release.txt
+++ b/Documentation/dev-release.txt
@@ -359,3 +359,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/dev-rest-api.txt b/Documentation/dev-rest-api.txt
index 0175a62..24b60f0 100644
--- a/Documentation/dev-rest-api.txt
+++ b/Documentation/dev-rest-api.txt
@@ -87,3 +87,5 @@
------
Part of link:index.html[Gerrit Code Review]
+SEARCHBOX
+---------
diff --git a/Documentation/error-branch-not-found.txt b/Documentation/error-branch-not-found.txt
index bd8d090..a8b1741 100644
--- a/Documentation/error-branch-not-found.txt
+++ b/Documentation/error-branch-not-found.txt
@@ -32,3 +32,6 @@
GERRIT
------
Part of link:error-messages.html[Gerrit Error Messages]
+
+SEARCHBOX
+---------
diff --git a/Documentation/error-change-closed.txt b/Documentation/error-change-closed.txt
index 3244fb3..e466c2e 100644
--- a/Documentation/error-change-closed.txt
+++ b/Documentation/error-change-closed.txt
@@ -39,3 +39,6 @@
GERRIT
------
Part of link:error-messages.html[Gerrit Error Messages]
+
+SEARCHBOX
+---------
diff --git a/Documentation/error-change-does-not-belong-to-project.txt b/Documentation/error-change-does-not-belong-to-project.txt
index e747881..db16261 100644
--- a/Documentation/error-change-does-not-belong-to-project.txt
+++ b/Documentation/error-change-does-not-belong-to-project.txt
@@ -14,3 +14,6 @@
GERRIT
------
Part of link:error-messages.html[Gerrit Error Messages]
+
+SEARCHBOX
+---------
diff --git a/Documentation/error-change-not-found.txt b/Documentation/error-change-not-found.txt
index b6df13b..e578ef5 100644
--- a/Documentation/error-change-not-found.txt
+++ b/Documentation/error-change-not-found.txt
@@ -13,3 +13,6 @@
GERRIT
------
Part of link:error-messages.html[Gerrit Error Messages]
+
+SEARCHBOX
+---------
diff --git a/Documentation/error-change-upload-blocked.txt b/Documentation/error-change-upload-blocked.txt
index 6bad02e..3b413bd2 100644
--- a/Documentation/error-change-upload-blocked.txt
+++ b/Documentation/error-change-upload-blocked.txt
@@ -39,3 +39,6 @@
GERRIT
------
Part of link:error-messages.html[Gerrit Error Messages]
+
+SEARCHBOX
+---------
diff --git a/Documentation/error-commit-already-exists.txt b/Documentation/error-commit-already-exists.txt
index dc32c4c1..6a2170a 100644
--- a/Documentation/error-commit-already-exists.txt
+++ b/Documentation/error-commit-already-exists.txt
@@ -12,3 +12,6 @@
GERRIT
------
Part of link:error-messages.html[Gerrit Error Messages]
+
+SEARCHBOX
+---------
diff --git a/Documentation/error-contains-banned-commit.txt b/Documentation/error-contains-banned-commit.txt
index 8a30c44..f6ac30d 100644
--- a/Documentation/error-contains-banned-commit.txt
+++ b/Documentation/error-contains-banned-commit.txt
@@ -19,3 +19,6 @@
GERRIT
------
Part of link:error-messages.html[Gerrit Error Messages]
+
+SEARCHBOX
+---------
diff --git a/Documentation/error-has-duplicates.txt b/Documentation/error-has-duplicates.txt
index b5175c0..4eac779 100644
--- a/Documentation/error-has-duplicates.txt
+++ b/Documentation/error-has-duplicates.txt
@@ -22,3 +22,6 @@
GERRIT
------
Part of link:error-messages.html[Gerrit Error Messages]
+
+SEARCHBOX
+---------
diff --git a/Documentation/error-invalid-author.txt b/Documentation/error-invalid-author.txt
index c484776..7067cde 100644
--- a/Documentation/error-invalid-author.txt
+++ b/Documentation/error-invalid-author.txt
@@ -143,3 +143,6 @@
GERRIT
------
Part of link:error-messages.html[Gerrit Error Messages]
+
+SEARCHBOX
+---------
diff --git a/Documentation/error-invalid-changeid-line.txt b/Documentation/error-invalid-changeid-line.txt
index 9235266..a1d7f15 100644
--- a/Documentation/error-invalid-changeid-line.txt
+++ b/Documentation/error-invalid-changeid-line.txt
@@ -29,3 +29,6 @@
GERRIT
------
Part of link:error-messages.html[Gerrit Error Messages]
+
+SEARCHBOX
+---------
diff --git a/Documentation/error-invalid-committer.txt b/Documentation/error-invalid-committer.txt
index 447064e..e27961f 100644
--- a/Documentation/error-invalid-committer.txt
+++ b/Documentation/error-invalid-committer.txt
@@ -108,3 +108,6 @@
GERRIT
------
Part of link:error-messages.html[Gerrit Error Messages]
+
+SEARCHBOX
+---------
diff --git a/Documentation/error-messages.txt b/Documentation/error-messages.txt
index 58e9e02..18aa12a 100644
--- a/Documentation/error-messages.txt
+++ b/Documentation/error-messages.txt
@@ -47,3 +47,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/error-missing-changeid.txt b/Documentation/error-missing-changeid.txt
index edbc63b..833e6ac 100644
--- a/Documentation/error-missing-changeid.txt
+++ b/Documentation/error-missing-changeid.txt
@@ -70,3 +70,6 @@
GERRIT
------
Part of link:error-messages.html[Gerrit Error Messages]
+
+SEARCHBOX
+---------
diff --git a/Documentation/error-multiple-changeid-lines.txt b/Documentation/error-multiple-changeid-lines.txt
index 9fa2b91..9b094d4 100644
--- a/Documentation/error-multiple-changeid-lines.txt
+++ b/Documentation/error-multiple-changeid-lines.txt
@@ -29,3 +29,6 @@
GERRIT
------
Part of link:error-messages.html[Gerrit Error Messages]
+
+SEARCHBOX
+---------
diff --git a/Documentation/error-no-changes-made.txt b/Documentation/error-no-changes-made.txt
index d0e1d4f..4987b16 100644
--- a/Documentation/error-no-changes-made.txt
+++ b/Documentation/error-no-changes-made.txt
@@ -19,3 +19,6 @@
GERRIT
------
Part of link:error-messages.html[Gerrit Error Messages]
+
+SEARCHBOX
+---------
diff --git a/Documentation/error-no-common-ancestry.txt b/Documentation/error-no-common-ancestry.txt
index 615da71..174e52b 100644
--- a/Documentation/error-no-common-ancestry.txt
+++ b/Documentation/error-no-common-ancestry.txt
@@ -18,3 +18,6 @@
GERRIT
------
Part of link:error-messages.html[Gerrit Error Messages]
+
+SEARCHBOX
+---------
diff --git a/Documentation/error-no-new-changes.txt b/Documentation/error-no-new-changes.txt
index 8e409ef..20357a4 100644
--- a/Documentation/error-no-new-changes.txt
+++ b/Documentation/error-no-new-changes.txt
@@ -49,3 +49,6 @@
GERRIT
------
Part of link:error-messages.html[Gerrit Error Messages]
+
+SEARCHBOX
+---------
diff --git a/Documentation/error-non-fast-forward.txt b/Documentation/error-non-fast-forward.txt
index 6604e10..f9b2caa 100644
--- a/Documentation/error-non-fast-forward.txt
+++ b/Documentation/error-non-fast-forward.txt
@@ -57,3 +57,6 @@
GERRIT
------
Part of link:error-messages.html[Gerrit Error Messages]
+
+SEARCHBOX
+---------
diff --git a/Documentation/error-not-a-gerrit-administrator.txt b/Documentation/error-not-a-gerrit-administrator.txt
index b771af6..98dd64c 100644
--- a/Documentation/error-not-a-gerrit-administrator.txt
+++ b/Documentation/error-not-a-gerrit-administrator.txt
@@ -12,3 +12,6 @@
GERRIT
------
Part of link:error-messages.html[Gerrit Error Messages]
+
+SEARCHBOX
+---------
diff --git a/Documentation/error-not-allowed-to-upload-merges.txt b/Documentation/error-not-allowed-to-upload-merges.txt
index 515eef5..fd2f10c 100644
--- a/Documentation/error-not-allowed-to-upload-merges.txt
+++ b/Documentation/error-not-allowed-to-upload-merges.txt
@@ -19,3 +19,6 @@
GERRIT
------
Part of link:error-messages.html[Gerrit Error Messages]
+
+SEARCHBOX
+---------
diff --git a/Documentation/error-not-permitted-to-create.txt b/Documentation/error-not-permitted-to-create.txt
index 9c07fd1..f41b645 100644
--- a/Documentation/error-not-permitted-to-create.txt
+++ b/Documentation/error-not-permitted-to-create.txt
@@ -14,3 +14,6 @@
GERRIT
------
Part of link:error-messages.html[Gerrit Error Messages]
+
+SEARCHBOX
+---------
diff --git a/Documentation/error-not-signed-off-by.txt b/Documentation/error-not-signed-off-by.txt
index bd1f40d..a3d6bbd 100644
--- a/Documentation/error-not-signed-off-by.txt
+++ b/Documentation/error-not-signed-off-by.txt
@@ -29,3 +29,6 @@
GERRIT
------
Part of link:error-messages.html[Gerrit Error Messages]
+
+SEARCHBOX
+---------
diff --git a/Documentation/error-not-valid-ref.txt b/Documentation/error-not-valid-ref.txt
index 128e796..5bba8e6 100644
--- a/Documentation/error-not-valid-ref.txt
+++ b/Documentation/error-not-valid-ref.txt
@@ -44,3 +44,6 @@
GERRIT
------
Part of link:error-messages.html[Gerrit Error Messages]
+
+SEARCHBOX
+---------
diff --git a/Documentation/error-permission-denied.txt b/Documentation/error-permission-denied.txt
index 2ec0a3f..a97161f 100644
--- a/Documentation/error-permission-denied.txt
+++ b/Documentation/error-permission-denied.txt
@@ -60,3 +60,6 @@
GERRIT
------
Part of link:error-messages.html[Gerrit Error Messages]
+
+SEARCHBOX
+---------
diff --git a/Documentation/error-prohibited-by-gerrit.txt b/Documentation/error-prohibited-by-gerrit.txt
index bad2b3c..2a65ea2 100644
--- a/Documentation/error-prohibited-by-gerrit.txt
+++ b/Documentation/error-prohibited-by-gerrit.txt
@@ -39,3 +39,6 @@
GERRIT
------
Part of link:error-messages.html[Gerrit Error Messages]
+
+SEARCHBOX
+---------
diff --git a/Documentation/error-project-not-found.txt b/Documentation/error-project-not-found.txt
index 3fc0141..29af5f8 100644
--- a/Documentation/error-project-not-found.txt
+++ b/Documentation/error-project-not-found.txt
@@ -32,3 +32,6 @@
GERRIT
------
Part of link:error-messages.html[Gerrit Error Messages]
+
+SEARCHBOX
+---------
diff --git a/Documentation/error-push-fails-due-to-commit-message.txt b/Documentation/error-push-fails-due-to-commit-message.txt
index 172d64f..046789e 100644
--- a/Documentation/error-push-fails-due-to-commit-message.txt
+++ b/Documentation/error-push-fails-due-to-commit-message.txt
@@ -39,3 +39,6 @@
GERRIT
------
Part of link:error-messages.html[Gerrit Error Messages]
+
+SEARCHBOX
+---------
diff --git a/Documentation/error-squash-commits-first.txt b/Documentation/error-squash-commits-first.txt
index 2181c52..9434363 100644
--- a/Documentation/error-squash-commits-first.txt
+++ b/Documentation/error-squash-commits-first.txt
@@ -106,3 +106,6 @@
GERRIT
------
Part of link:error-messages.html[Gerrit Error Messages]
+
+SEARCHBOX
+---------
diff --git a/Documentation/error-upload-denied.txt b/Documentation/error-upload-denied.txt
index 5dec8ab..6de94b4 100644
--- a/Documentation/error-upload-denied.txt
+++ b/Documentation/error-upload-denied.txt
@@ -17,3 +17,6 @@
GERRIT
------
Part of link:error-messages.html[Gerrit Error Messages]
+
+SEARCHBOX
+---------
diff --git a/Documentation/i18n-readme.txt b/Documentation/i18n-readme.txt
index 2135598..46abaad 100644
--- a/Documentation/i18n-readme.txt
+++ b/Documentation/i18n-readme.txt
@@ -22,3 +22,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/images/intro-quick-central-gerrit.png b/Documentation/images/intro-quick-central-gerrit.png
index 61b9638..8717176 100644
--- a/Documentation/images/intro-quick-central-gerrit.png
+++ b/Documentation/images/intro-quick-central-gerrit.png
Binary files differ
diff --git a/Documentation/images/intro-quick-central-repo.png b/Documentation/images/intro-quick-central-repo.png
index 84ffeb0..8400b5e 100644
--- a/Documentation/images/intro-quick-central-repo.png
+++ b/Documentation/images/intro-quick-central-repo.png
Binary files differ
diff --git a/Documentation/index.txt b/Documentation/index.txt
index 9b8acc4..9435e6d 100644
--- a/Documentation/index.txt
+++ b/Documentation/index.txt
@@ -91,3 +91,6 @@
* link:http://code.google.com/p/gerrit/issues/list[Issue Tracking]
* link:http://code.google.com/p/gerrit/source/checkout[Source Code]
* link:http://code.google.com/p/gerrit/wiki/Background[A History of Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/install-j2ee.txt b/Documentation/install-j2ee.txt
index 5ba8cb1..dd9657c 100644
--- a/Documentation/install-j2ee.txt
+++ b/Documentation/install-j2ee.txt
@@ -117,3 +117,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/install-quick.txt b/Documentation/install-quick.txt
index f1bd25c..741de35 100644
--- a/Documentation/install-quick.txt
+++ b/Documentation/install-quick.txt
@@ -232,3 +232,6 @@
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/install.txt b/Documentation/install.txt
index e7bf50e..8e836f8 100644
--- a/Documentation/install.txt
+++ b/Documentation/install.txt
@@ -120,8 +120,19 @@
review_site/bin/gerrit.sh restart
====
-('Optional') Link the gerrit.sh script into rc3.d so the daemon
-automatically starts and stops with the operating system:
+('Optional') Configure the daemon to automatically start and stop
+with the operating system.
+
+Uncomment the following 3 lines in the `'$site_path/bin/gerrit.sh'`
+script:
+
+====
+ chkconfig: 3 99 99
+ description: Gerrit Code Review
+ processname: gerrit
+====
+
+Then link the `gerrit.sh` script into `rc3.d`:
====
sudo ln -snf `pwd`/review_site/bin/gerrit.sh /etc/init.d/gerrit
@@ -183,3 +194,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/intro-change-screen.txt b/Documentation/intro-change-screen.txt
index 2913336..d1c7adb 100644
--- a/Documentation/intro-change-screen.txt
+++ b/Documentation/intro-change-screen.txt
@@ -214,3 +214,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/intro-quick.txt b/Documentation/intro-quick.txt
index ae2e7e7..cd3374b 100644
--- a/Documentation/intro-quick.txt
+++ b/Documentation/intro-quick.txt
@@ -390,3 +390,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/js-api.txt b/Documentation/js-api.txt
index 2e97ac4..0e470e7 100644
--- a/Documentation/js-api.txt
+++ b/Documentation/js-api.txt
@@ -636,3 +636,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/json.txt b/Documentation/json.txt
index 9278cde..73dbd92 100644
--- a/Documentation/json.txt
+++ b/Documentation/json.txt
@@ -276,3 +276,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/pgm-LocalUsernamesToLowerCase.txt b/Documentation/pgm-LocalUsernamesToLowerCase.txt
index 9189fee..f1d21f89 100644
--- a/Documentation/pgm-LocalUsernamesToLowerCase.txt
+++ b/Documentation/pgm-LocalUsernamesToLowerCase.txt
@@ -66,3 +66,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/pgm-ScanTrackingIds.txt b/Documentation/pgm-ScanTrackingIds.txt
index f9494d4..9e38032 100644
--- a/Documentation/pgm-ScanTrackingIds.txt
+++ b/Documentation/pgm-ScanTrackingIds.txt
@@ -57,3 +57,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/pgm-daemon.txt b/Documentation/pgm-daemon.txt
index 4b920ea..18bd293 100644
--- a/Documentation/pgm-daemon.txt
+++ b/Documentation/pgm-daemon.txt
@@ -126,3 +126,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/pgm-gsql.txt b/Documentation/pgm-gsql.txt
index 37fbb74..a805036 100644
--- a/Documentation/pgm-gsql.txt
+++ b/Documentation/pgm-gsql.txt
@@ -54,3 +54,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/pgm-index.txt b/Documentation/pgm-index.txt
index 987b4ac..a25a1ab 100644
--- a/Documentation/pgm-index.txt
+++ b/Documentation/pgm-index.txt
@@ -44,3 +44,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/pgm-init.txt b/Documentation/pgm-init.txt
index 3d6cb73..8e48b30 100644
--- a/Documentation/pgm-init.txt
+++ b/Documentation/pgm-init.txt
@@ -62,3 +62,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/pgm-prolog-shell.txt b/Documentation/pgm-prolog-shell.txt
index 3189e90..7b273f5 100644
--- a/Documentation/pgm-prolog-shell.txt
+++ b/Documentation/pgm-prolog-shell.txt
@@ -55,3 +55,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/pgm-reindex.txt b/Documentation/pgm-reindex.txt
index 2b44f6b..f55c093 100644
--- a/Documentation/pgm-reindex.txt
+++ b/Documentation/pgm-reindex.txt
@@ -39,3 +39,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/pgm-rulec.txt b/Documentation/pgm-rulec.txt
index 6d0a632..356f555 100644
--- a/Documentation/pgm-rulec.txt
+++ b/Documentation/pgm-rulec.txt
@@ -52,3 +52,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/project-setup.txt b/Documentation/project-setup.txt
index 36d3c60..9b6f6d9 100644
--- a/Documentation/project-setup.txt
+++ b/Documentation/project-setup.txt
@@ -134,3 +134,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/prolog-change-facts.txt b/Documentation/prolog-change-facts.txt
index e21da02..071984b 100644
--- a/Documentation/prolog-change-facts.txt
+++ b/Documentation/prolog-change-facts.txt
@@ -101,3 +101,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/prolog-cookbook.txt b/Documentation/prolog-cookbook.txt
index b1710a2..54f6910 100644
--- a/Documentation/prolog-cookbook.txt
+++ b/Documentation/prolog-cookbook.txt
@@ -1062,3 +1062,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/replace_macros.py b/Documentation/replace_macros.py
index 1680a47..1f23cbe 100755
--- a/Documentation/replace_macros.py
+++ b/Documentation/replace_macros.py
@@ -22,6 +22,7 @@
PAT_GET = re.compile(r'^get::([^ \t\n]*)')
PAT_TITLE = re.compile(r'^\.(.*)')
PAT_STARS = re.compile(r'^\*\*\*\*')
+PAT_SEARCHBOX = re.compile(r'^SEARCHBOX')
GERRIT_UPLINK = """
@@ -56,6 +57,29 @@
"""
+SEARCH_BOX = """
+
+++++
+<div style="position:absolute; right:20px; top:20px;">
+<input type="text" id="docSearch" size="70" />
+<button type="button" id="searchBox">Search</button>
+<script type="text/javascript">
+var f = function() {
+ window.location = '../#/Documentation/' +
+ encodeURIComponent(document.getElementById("docSearch").value);
+}
+document.getElementById("searchBox").onclick = f;
+document.getElementById("docSearch").onkeypress = function(e) {
+ if (13 == (e.keyCode ? e.keyCode : e.which)) {
+ f();
+ }
+}
+</script>
+</div>
+++++
+
+"""
+
opts = OptionParser()
opts.add_option('-o', '--out', help='output file')
opts.add_option('-s', '--src', help='source file')
@@ -73,6 +97,10 @@
# Case of "GERRIT\n------" at the footer
out_file.write(GERRIT_UPLINK)
last_line = ''
+ elif PAT_SEARCHBOX.match(line):
+ # Case of 'SEARCHBOX\n---------'
+ out_file.write(SEARCH_BOX)
+ last_line = ''
elif PAT_INCLUDE.match(line):
# Case of 'include::<filename>'
match = PAT_INCLUDE.match(line)
diff --git a/Documentation/rest-api-access.txt b/Documentation/rest-api-access.txt
index 6c786e4..b49f787 100644
--- a/Documentation/rest-api-access.txt
+++ b/Documentation/rest-api-access.txt
@@ -378,3 +378,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/rest-api-accounts.txt b/Documentation/rest-api-accounts.txt
index 02bb549..90d4e2d 100644
--- a/Documentation/rest-api-accounts.txt
+++ b/Documentation/rest-api-accounts.txt
@@ -1250,3 +1250,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/rest-api-changes.txt b/Documentation/rest-api-changes.txt
index 9404d00..9ed8be0 100644
--- a/Documentation/rest-api-changes.txt
+++ b/Documentation/rest-api-changes.txt
@@ -3371,3 +3371,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/rest-api-config.txt b/Documentation/rest-api-config.txt
index 4f25aa8..e9c1739 100644
--- a/Documentation/rest-api-config.txt
+++ b/Documentation/rest-api-config.txt
@@ -219,3 +219,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/rest-api-documentation.txt b/Documentation/rest-api-documentation.txt
index db7dc35..9030fac 100644
--- a/Documentation/rest-api-documentation.txt
+++ b/Documentation/rest-api-documentation.txt
@@ -149,3 +149,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/rest-api-groups.txt b/Documentation/rest-api-groups.txt
index 6289e5a..e96607c 100644
--- a/Documentation/rest-api-groups.txt
+++ b/Documentation/rest-api-groups.txt
@@ -1239,3 +1239,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/rest-api-plugins.txt b/Documentation/rest-api-plugins.txt
index 0c69f7d..f5b6809 100644
--- a/Documentation/rest-api-plugins.txt
+++ b/Documentation/rest-api-plugins.txt
@@ -277,3 +277,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/rest-api-projects.txt b/Documentation/rest-api-projects.txt
index 35db183..1ac232a 100644
--- a/Documentation/rest-api-projects.txt
+++ b/Documentation/rest-api-projects.txt
@@ -1515,3 +1515,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/rest-api.txt b/Documentation/rest-api.txt
index 788f222..bedf218 100644
--- a/Documentation/rest-api.txt
+++ b/Documentation/rest-api.txt
@@ -171,3 +171,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/user-changeid.txt b/Documentation/user-changeid.txt
index c13faa6..ca60819 100644
--- a/Documentation/user-changeid.txt
+++ b/Documentation/user-changeid.txt
@@ -169,3 +169,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/user-dashboards.txt b/Documentation/user-dashboards.txt
index 0945153..1c5162a 100644
--- a/Documentation/user-dashboards.txt
+++ b/Documentation/user-dashboards.txt
@@ -169,3 +169,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/user-notify.txt b/Documentation/user-notify.txt
index 558dcb5..dd7d4bd 100644
--- a/Documentation/user-notify.txt
+++ b/Documentation/user-notify.txt
@@ -145,3 +145,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/user-search.txt b/Documentation/user-search.txt
index 73640a0..87ea1cd 100644
--- a/Documentation/user-search.txt
+++ b/Documentation/user-search.txt
@@ -462,3 +462,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/user-signedoffby.txt b/Documentation/user-signedoffby.txt
index 56858bf..c5ae135 100644
--- a/Documentation/user-signedoffby.txt
+++ b/Documentation/user-signedoffby.txt
@@ -175,3 +175,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/user-submodules.txt b/Documentation/user-submodules.txt
index 6aab43f..fbf45d7 100644
--- a/Documentation/user-submodules.txt
+++ b/Documentation/user-submodules.txt
@@ -187,3 +187,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/Documentation/user-upload.txt b/Documentation/user-upload.txt
index cbb152c3..0569630 100644
--- a/Documentation/user-upload.txt
+++ b/Documentation/user-upload.txt
@@ -445,3 +445,6 @@
GERRIT
------
Part of link:index.html[Gerrit Code Review]
+
+SEARCHBOX
+---------
diff --git a/ReleaseNotes/ReleaseNotes-2.8.txt b/ReleaseNotes/ReleaseNotes-2.8.txt
index 575bdce..27ed297 100644
--- a/ReleaseNotes/ReleaseNotes-2.8.txt
+++ b/ReleaseNotes/ReleaseNotes-2.8.txt
@@ -65,6 +65,29 @@
* Documentation is now built with Buck and link:http://asciidoctor.org[Asciidoctor].
+Indexing and Search
+~~~~~~~~~~~~~~~~~~~
+
+Gerrit can be configured to use a
+link:https://gerrit-documentation.storage.googleapis.com/Documentation/2.8/config-gerrit.html#index[
+secondary index] with Lucene or Solr.
+
+Existing search operations use the secondary index, when enabled, to increase
+performance and reduce resource usage.
+
+The following additional search operations are possible when secondary indexing
+is enabled:
+
+* New
+link:https://gerrit-documentation.storage.googleapis.com/Documentation/2.8/user-search.html#comment[
+`comment` search operator].
+
+* The link:https://gerrit-documentation.storage.googleapis.com/Documentation/2.8/user-search.html#file[
+`file` operator] can be used to find changes on the specified file.
+
+* Regular expressions are allowed in `file` searches.
+
+
Configuration
~~~~~~~~~~~~~
@@ -712,7 +735,7 @@
Upgrades
--------
-* Update JGit to 3.0.0.201306101825-r.41-g84d2738
+* Update JGit to 3.1.0.201310021548-r
* Update gwtorm to 1.7
* Update guice to 4.0-beta
* Update guava to 15.0
diff --git a/contrib/themes/spotify/static/background-gradient.png b/contrib/themes/spotify/static/background-gradient.png
index b40f35b..3b9422e 100644
--- a/contrib/themes/spotify/static/background-gradient.png
+++ b/contrib/themes/spotify/static/background-gradient.png
Binary files differ
diff --git a/contrib/themes/spotify/static/logo.png b/contrib/themes/spotify/static/logo.png
index bfe1fce..c231031 100644
--- a/contrib/themes/spotify/static/logo.png
+++ b/contrib/themes/spotify/static/logo.png
Binary files differ
diff --git a/gerrit-acceptance-tests/BUCK b/gerrit-acceptance-tests/BUCK
index 11311e8..6b6a18e 100644
--- a/gerrit-acceptance-tests/BUCK
+++ b/gerrit-acceptance-tests/BUCK
@@ -8,6 +8,7 @@
'//gerrit-extension-api:api',
'//gerrit-launcher:launcher',
'//gerrit-httpd:httpd',
+ '//gerrit-pgm:init-base',
'//gerrit-pgm:pgm',
'//gerrit-reviewdb:server',
'//gerrit-server:server',
@@ -30,6 +31,7 @@
'//lib/guice:guice',
'//lib/jgit:jgit',
'//lib/jgit:junit',
+ '//lib/mina:sshd',
],
export_deps = True,
visibility = [
diff --git a/gerrit-cache-h2/src/main/java/com/google/gerrit/server/cache/h2/H2CacheImpl.java b/gerrit-cache-h2/src/main/java/com/google/gerrit/server/cache/h2/H2CacheImpl.java
index 1f120ed7..4aca42b 100644
--- a/gerrit-cache-h2/src/main/java/com/google/gerrit/server/cache/h2/H2CacheImpl.java
+++ b/gerrit-cache-h2/src/main/java/com/google/gerrit/server/cache/h2/H2CacheImpl.java
@@ -28,6 +28,7 @@
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Timestamp;
+import java.sql.Types;
import java.util.Calendar;
import java.util.Map;
import java.util.concurrent.ArrayBlockingQueue;
@@ -268,7 +269,7 @@
}
void set(PreparedStatement ps, int col, K value) throws SQLException {
- ps.setObject(col, value);
+ ps.setObject(col, value, Types.JAVA_OBJECT);
}
Funnel<K> funnel() {
@@ -489,7 +490,7 @@
}
try {
keyType.set(c.put, 1, key);
- c.put.setObject(2, holder.value);
+ c.put.setObject(2, holder.value, Types.JAVA_OBJECT);
c.put.setTimestamp(3, new Timestamp(holder.created));
c.put.setTimestamp(4, TimeUtil.nowTs());
c.put.executeUpdate();
diff --git a/gerrit-common/src/main/java/com/google/gerrit/common/PageLinks.java b/gerrit-common/src/main/java/com/google/gerrit/common/PageLinks.java
index 05425a5..9e64aae 100644
--- a/gerrit-common/src/main/java/com/google/gerrit/common/PageLinks.java
+++ b/gerrit-common/src/main/java/com/google/gerrit/common/PageLinks.java
@@ -94,6 +94,10 @@
return PROJECTS + name.get() + DASHBOARDS + id;
}
+ public static String toProjectDefaultDashboard(Project.NameKey name) {
+ return PROJECTS + name.get() + DASHBOARDS + "default";
+ }
+
public static String projectQuery(Project.NameKey proj) {
return op("project", proj.get());
}
diff --git a/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/annotations/PluginCanonicalWebUrl.java b/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/annotations/PluginCanonicalWebUrl.java
new file mode 100644
index 0000000..fd14429
--- /dev/null
+++ b/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/annotations/PluginCanonicalWebUrl.java
@@ -0,0 +1,42 @@
+// Copyright (C) 2013 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package com.google.gerrit.extensions.annotations;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import com.google.inject.BindingAnnotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation applied to a String containing the plugin canonical web URL.
+ * <p>
+ * A plugin or extension may receive this string by Guice injection to discover
+ * the canonical web URL under which the plugin is available:
+ *
+ * <pre>
+ * @Inject
+ * MyType(@PluginCanonicalWebUrl String myUrl) {
+ * ...
+ * }
+ * </pre>
+ */
+@Target({ElementType.PARAMETER, ElementType.FIELD})
+@Retention(RUNTIME)
+@BindingAnnotation
+public @interface PluginCanonicalWebUrl {
+}
diff --git a/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/config/DownloadScheme.java b/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/config/DownloadScheme.java
index 20eda97..d81657a 100644
--- a/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/config/DownloadScheme.java
+++ b/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/config/DownloadScheme.java
@@ -30,9 +30,7 @@
public abstract boolean isAuthRequired();
/** @return whether this scheme supports authentication */
- public boolean isAuthSupported() {
- return isAuthRequired();
- }
+ public abstract boolean isAuthSupported();
/** @return whether the download scheme is enabled */
public abstract boolean isEnabled();
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/Dispatcher.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/Dispatcher.java
index 40e5252..7b5389e 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/Dispatcher.java
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/Dispatcher.java
@@ -71,6 +71,7 @@
import com.google.gerrit.client.dashboards.DashboardInfo;
import com.google.gerrit.client.dashboards.DashboardList;
import com.google.gerrit.client.diff.SideBySide2;
+import com.google.gerrit.client.documentation.DocScreen;
import com.google.gerrit.client.groups.GroupApi;
import com.google.gerrit.client.groups.GroupInfo;
import com.google.gerrit.client.patches.PatchScreen;
@@ -201,6 +202,9 @@
if (matchPrefix("/q/", token)) {
query(token);
+ } else if (matchPrefix("/Documentation/", token)) {
+ docSearch(token);
+
} else if (matchPrefix("/c/", token)) {
change(token);
@@ -884,4 +888,12 @@
}
}
}
+
+ private static void docSearch(final String token) {
+ GWT.runAsync(new AsyncSplit(token) {
+ public void onSuccess() {
+ Gerrit.display(token, new DocScreen(skip(token)));
+ }
+ });
+ }
}
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/account/AccountConstants.properties b/gerrit-gwtui/src/main/java/com/google/gerrit/client/account/AccountConstants.properties
index 333dcfa..0aeeac6 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/account/AccountConstants.properties
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/account/AccountConstants.properties
@@ -77,14 +77,14 @@
Confirm the default path <em>.ssh/id_rsa</em>\
</li>\
<li>\
- Enter a passphrase (recommended) or leave it blank.<br>\
- Remember this passphrase, as you will need it to unlock the<br>\
+ Enter a passphrase (recommended) or leave it blank.<br />\
+ Remember this passphrase, as you will need it to unlock the<br />\
key whenever you use it.\
</li>\
<li>\
- Open <em>~/.ssh/id_rsa.pub</em> and copy & paste the contents into<br>\
- the box below, then click on "Add".<br>\
- Note that <em>id_rsa.pub</em> is your public key and can be shared,<br>\
+ Open <em>~/.ssh/id_rsa.pub</em> and copy & paste the contents into<br />\
+ the box below, then click on "Add".<br />\
+ Note that <em>id_rsa.pub</em> is your public key and can be shared,<br />\
while <em>id_rsa</em> is your private key and should be kept secret.\
</li>\
<\ol>
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/ProjectListScreen.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/ProjectListScreen.java
index 331afee..da88034 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/ProjectListScreen.java
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/ProjectListScreen.java
@@ -102,9 +102,11 @@
protected void initColumnHeaders() {
super.initColumnHeaders();
if (Gerrit.getGitwebLink() != null) {
- table.setText(0, 3, Util.C.projectRepoBrowser());
+ table.setText(0, ProjectsTable.C_REPO_BROWSER,
+ Util.C.projectRepoBrowser());
table.getFlexCellFormatter().
- addStyleName(0, 3, Gerrit.RESOURCES.css().dataHeader());
+ addStyleName(0, ProjectsTable.C_REPO_BROWSER,
+ Gerrit.RESOURCES.css().dataHeader());
}
}
@@ -122,7 +124,8 @@
super.insert(row, k);
if (Gerrit.getGitwebLink() != null) {
table.getFlexCellFormatter().
- addStyleName(row, 3, Gerrit.RESOURCES.css().dataCell());
+ addStyleName(row, ProjectsTable.C_REPO_BROWSER,
+ Gerrit.RESOURCES.css().dataCell());
}
}
@@ -131,11 +134,12 @@
FlowPanel fp = new FlowPanel();
fp.add(new ProjectSearchLink(k.name_key()));
fp.add(new HighlightingInlineHyperlink(k.name(), link(k), subname));
- table.setWidget(row, 1, fp);
- table.setText(row, 2, k.description());
+ table.setWidget(row, ProjectsTable.C_NAME, fp);
+ table.setText(row, ProjectsTable.C_DESCRIPTION, k.description());
GitwebLink l = Gerrit.getGitwebLink();
if (l != null) {
- table.setWidget(row, 3, new Anchor(l.getLinkName(), false, l.toProject(k
+ table.setWidget(row, ProjectsTable.C_REPO_BROWSER,
+ new Anchor(l.getLinkName(), false, l.toProject(k
.name_key())));
}
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/deleteHover.png b/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/deleteHover.png
index 839e8ef..9fde3fa 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/deleteHover.png
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/deleteHover.png
Binary files differ
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/deleteNormal.png b/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/deleteNormal.png
index ffddb6f..47a1195 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/deleteNormal.png
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/deleteNormal.png
Binary files differ
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/editText.png b/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/editText.png
index 188e1c1..2927275 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/editText.png
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/editText.png
Binary files differ
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/undoNormal.png b/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/undoNormal.png
index 8b0fef9..b780f75 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/undoNormal.png
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/undoNormal.png
Binary files differ
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen2.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen2.java
index 5f6b4e9..a1c7a0c 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen2.java
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen2.java
@@ -59,6 +59,7 @@
import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.NativeEvent;
import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.KeyPressEvent;
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.shared.HandlerRegistration;
@@ -72,6 +73,7 @@
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HTMLPanel;
+import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.ToggleButton;
import com.google.gwtexpui.clippy.client.CopyableLabel;
import com.google.gwtexpui.globalkey.client.GlobalKey;
@@ -135,6 +137,7 @@
@UiField Element changeIdText;
@UiField Element ownerText;
@UiField Element statusText;
+ @UiField Image projectQuery;
@UiField InlineHyperlink projectLink;
@UiField InlineHyperlink branchLink;
@UiField Element submitActionText;
@@ -284,13 +287,17 @@
new DownloadAction(info, revision, style, headerLine, download);
}
- private void initProjectLink(ChangeInfo info) {
+ private void initProjectLinks(final ChangeInfo info) {
+ projectQuery.addDomHandler(new ClickHandler() {
+ @Override
+ public void onClick(ClickEvent event) {
+ Gerrit.display(
+ PageLinks.toProjectDefaultDashboard(info.project_name_key()));
+ }
+ }, ClickEvent.getType());
projectLink.setText(info.project());
projectLink.setTargetHistoryToken(
- PageLinks.toChangeQuery(
- PageLinks.projectQuery(
- info.project_name_key(),
- info.status())));
+ PageLinks.toProject(info.project_name_key()));
}
private void initBranchLink(ChangeInfo info) {
@@ -649,7 +656,7 @@
initIncludedInAction(info);
initRevisionsAction(info, revision);
initDownloadAction(info, revision);
- initProjectLink(info);
+ initProjectLinks(info);
initBranchLink(info);
actions.display(info, revision);
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen2.ui.xml b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen2.ui.xml
index a58cd09..ce8a062 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen2.ui.xml
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen2.ui.xml
@@ -20,6 +20,7 @@
xmlns:g='urn:import:com.google.gwt.user.client.ui'
xmlns:x='urn:import:com.google.gerrit.client.ui'
xmlns:clippy='urn:import:com.google.gwtexpui.clippy.client'>
+ <ui:with field='ico' type='com.google.gerrit.client.GerritResources'/>
<ui:with field='res' type='com.google.gerrit.client.change.Resources'/>
<ui:style type='com.google.gerrit.client.change.ChangeScreen2.Style'>
@eval textColor com.google.gerrit.client.Gerrit.getTheme().textColor;
@@ -133,6 +134,11 @@
float: right;
}
+ .queryProject {
+ float: left;
+ cursor: pointer;
+ }
+
.infoColumn {
width: 440px;
padding-right: 10px;
@@ -168,6 +174,7 @@
color: #444;
vertical-align: top;
text-align: left;
+ padding-top: 3px;
padding-right: 5px;
white-space: nowrap;
}
@@ -317,8 +324,15 @@
</tr>
<tr>
<th><ui:msg>Project</ui:msg></th>
- <td><x:InlineHyperlink ui:field='projectLink'
+ <td><g:Image
+ ui:field='projectQuery'
+ resource='{ico.queryIcon}'
+ styleName='{style.queryProject}'
title='Search for changes on this project'>
+ <ui:attribute name='title'/>
+ </g:Image>
+ <x:InlineHyperlink ui:field='projectLink'
+ title='Go to project'>
<ui:attribute name='title'/>
</x:InlineHyperlink>
</td>
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ReplyBox.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ReplyBox.java
index c8eb13a..75ca6b3 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ReplyBox.java
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ReplyBox.java
@@ -56,6 +56,8 @@
import java.util.TreeSet;
class ReplyBox extends Composite {
+ private static final String CODE_REVIEW = "Code-Review";
+
interface Binder extends UiBinder<HTMLPanel, ReplyBox> {}
private static final Binder uiBinder = GWT.create(Binder.class);
@@ -67,7 +69,7 @@
private final PatchSet.Id psId;
private final String revision;
private ReviewInput in = ReviewInput.create();
- private List<Runnable> lgtm;
+ private Runnable lgtm;
@UiField Styles style;
@UiField NpTextArea message;
@@ -91,7 +93,6 @@
UIObject.setVisible(labelsParent, false);
} else {
Collections.sort(names);
- lgtm = new ArrayList<Runnable>(names.size());
renderLabels(names, all, permitted);
}
}
@@ -118,11 +119,7 @@
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
- if (message.getValue().startsWith("LGTM")) {
- for (Runnable r : lgtm) {
- r.run();
- }
- }
+ lgtm.run();
}
});
}
@@ -236,8 +233,8 @@
}
}
- if (!group.isEmpty()) {
- lgtm.add(new Runnable() {
+ if (CODE_REVIEW.equalsIgnoreCase(id) && !group.isEmpty()) {
+ lgtm = new Runnable() {
@Override
public void run() {
for (int i = 0; i < group.size() - 1; i++) {
@@ -245,7 +242,7 @@
}
group.get(group.size() - 1).setValue(true, true);
}
- });
+ };
}
}
@@ -269,12 +266,14 @@
b.setStyleName(style.label_name());
labelsTable.setWidget(row, 0, b);
- lgtm.add(new Runnable() {
- @Override
- public void run() {
- b.setValue(true, true);
- }
- });
+ if (CODE_REVIEW.equalsIgnoreCase(id)) {
+ lgtm = new Runnable() {
+ @Override
+ public void run() {
+ b.setValue(true, true);
+ }
+ };
+ }
}
private static boolean isCheckBox(Set<Short> values) {
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/remove_reviewer.png b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/remove_reviewer.png
index 9e494dd..5a3e6f0 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/remove_reviewer.png
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/remove_reviewer.png
Binary files differ
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/star_filled.png b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/star_filled.png
index 39bddb1..db1e24e 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/star_filled.png
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/star_filled.png
Binary files differ
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/removeReviewerNormal.png b/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/removeReviewerNormal.png
index 839e8ef..9fde3fa 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/removeReviewerNormal.png
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/removeReviewerNormal.png
Binary files differ
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/removeReviewerPressed.png b/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/removeReviewerPressed.png
index 2e509ec..e46f0aa 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/removeReviewerPressed.png
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/removeReviewerPressed.png
Binary files differ
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/documentation/DocConstants.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/documentation/DocConstants.java
new file mode 100644
index 0000000..f6b7a9d
--- /dev/null
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/documentation/DocConstants.java
@@ -0,0 +1,25 @@
+// Copyright (C) 2013 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package com.google.gerrit.client.documentation;
+
+import com.google.gwt.i18n.client.Constants;
+
+public interface DocConstants extends Constants {
+ String keyReloadSearch();
+
+ String docItemHelp();
+ String docTableColumnTitle();
+ String docTableNone();
+}
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/documentation/DocConstants.properties b/gerrit-gwtui/src/main/java/com/google/gerrit/client/documentation/DocConstants.properties
new file mode 100644
index 0000000..b48c507
--- /dev/null
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/documentation/DocConstants.properties
@@ -0,0 +1,5 @@
+keyReloadSearch = Reload documentation list
+
+docItemHelp = documentation
+docTableColumnTitle = Title
+docTableNone = (None)
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/documentation/DocInfo.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/documentation/DocInfo.java
new file mode 100644
index 0000000..6235186
--- /dev/null
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/documentation/DocInfo.java
@@ -0,0 +1,31 @@
+// Copyright (C) 2013 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package com.google.gerrit.client.documentation;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.core.client.JavaScriptObject;
+
+public class DocInfo extends JavaScriptObject {
+
+ public final native String title() /*-{ return this.title; }-*/;
+ public final native String url() /*-{ return this.url; }-*/;
+
+ protected DocInfo() {
+ }
+
+ public final String getFullUrl() {
+ return GWT.getHostPageBaseURL() + url();
+ }
+}
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/documentation/DocMessages.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/documentation/DocMessages.java
new file mode 100644
index 0000000..df62b92
--- /dev/null
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/documentation/DocMessages.java
@@ -0,0 +1,22 @@
+// Copyright (C) 2013 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package com.google.gerrit.client.documentation;
+
+import com.google.gwt.i18n.client.Messages;
+
+public interface DocMessages extends Messages {
+ String docQueryWindowTitle(String query);
+ String docQueryPageTitle(String query);
+}
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/documentation/DocMessages.properties b/gerrit-gwtui/src/main/java/com/google/gerrit/client/documentation/DocMessages.properties
new file mode 100644
index 0000000..8810a4a
--- /dev/null
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/documentation/DocMessages.properties
@@ -0,0 +1,2 @@
+docQueryWindowTitle = {0}
+docQueryPageTitle = Search for {0} in documentation
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/documentation/DocScreen.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/documentation/DocScreen.java
new file mode 100644
index 0000000..0a87d29
--- /dev/null
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/documentation/DocScreen.java
@@ -0,0 +1,78 @@
+// Copyright (C) 2013 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package com.google.gerrit.client.documentation;
+
+import com.google.gerrit.client.rpc.GerritCallback;
+import com.google.gerrit.client.rpc.RestApi;
+import com.google.gerrit.client.ui.Screen;
+import com.google.gwt.core.client.JsArray;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.google.gwtorm.client.KeyUtil;
+
+public class DocScreen extends Screen {
+ private static final String URI = "/Documentation/";
+
+ private DocTable table;
+ private final String query;
+
+ public DocScreen(String query) {
+ this.query = KeyUtil.decode(query);
+ }
+
+ @Override
+ protected void onInitUI() {
+ super.onInitUI();
+
+ table = new DocTable();
+ table.setSavePointerId(query);
+ add(table);
+
+ setWindowTitle(Util.M.docQueryWindowTitle(query));
+ setPageTitle(Util.M.docQueryPageTitle(query));
+ }
+
+ @Override
+ protected void onLoad() {
+ super.onLoad();
+ doQuery();
+ }
+
+ @Override
+ public void registerKeys() {
+ super.registerKeys();
+ table.setRegisterKeys(true);
+ }
+
+ private AsyncCallback<JsArray<DocInfo>> loadCallback() {
+ return new GerritCallback<JsArray<DocInfo>>() {
+ @Override
+ public void onSuccess(JsArray<DocInfo> result) {
+ displayResults(result);
+ display();
+ }
+ };
+ }
+
+ private void displayResults(JsArray<DocInfo> result) {
+ table.display(result);
+ table.finishDisplay();
+ }
+
+ private void doQuery() {
+ RestApi call = new RestApi(URI);
+ call.addParameterRaw("q", KeyUtil.encode(query));
+ call.get(loadCallback());
+ }
+}
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/documentation/DocTable.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/documentation/DocTable.java
new file mode 100644
index 0000000..f176372
--- /dev/null
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/documentation/DocTable.java
@@ -0,0 +1,125 @@
+// Copyright (C) 2013 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package com.google.gerrit.client.documentation;
+
+import com.google.gerrit.client.Gerrit;
+import com.google.gerrit.client.ui.NavigationTable;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.core.client.JsArray;
+import com.google.gwt.user.client.Window;
+import com.google.gwt.user.client.ui.Anchor;
+import com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter;
+import com.google.gwt.user.client.ui.HTMLTable.Cell;
+import com.google.gwt.user.client.ui.HTMLTable.CellFormatter;
+
+class DocTable extends NavigationTable<DocInfo> {
+ private static final int C_TITLE = 1;
+
+ private int rows = 0;
+ private int dataBeginRow = 0;
+
+ public DocTable() {
+ super(Util.C.docItemHelp());
+
+ table.setText(0, C_TITLE, Util.C.docTableColumnTitle());
+
+ FlexCellFormatter fmt = table.getFlexCellFormatter();
+ fmt.addStyleName(0, C_TITLE, Gerrit.RESOURCES.css().dataHeader());
+
+ table.addClickHandler(new ClickHandler() {
+ @Override
+ public void onClick(ClickEvent event) {
+ Cell cell = table.getCellForEvent(event);
+ if (cell == null) {
+ return;
+ }
+ if (getRowItem(cell.getRowIndex()) != null) {
+ movePointerTo(cell.getRowIndex());
+ }
+ }
+ });
+ }
+
+ @Override
+ protected Object getRowItemKey(DocInfo item) {
+ return item.url();
+ }
+
+ @Override
+ protected void onOpenRow(int row) {
+ DocInfo d = getRowItem(row);
+ Window.Location.assign(d.getFullUrl());
+ }
+
+ private void insertNoneRow(int row) {
+ table.insertRow(row);
+ table.setText(row, 0, Util.C.docTableNone());
+ FlexCellFormatter fmt = table.getFlexCellFormatter();
+ fmt.setStyleName(row, 0, Gerrit.RESOURCES.css().emptySection());
+ }
+
+ private void insertDocRow(int row) {
+ table.insertRow(row);
+ applyDataRowStyle(row);
+ }
+
+ @Override
+ protected void applyDataRowStyle(int row) {
+ super.applyDataRowStyle(row);
+ CellFormatter fmt = table.getCellFormatter();
+ fmt.addStyleName(row, C_TITLE, Gerrit.RESOURCES.css().dataCell());
+ fmt.addStyleName(row, C_TITLE, Gerrit.RESOURCES.css().cSUBJECT());
+ }
+
+ private void populateDocRow(int row, DocInfo d) {
+ table.setWidget(row, C_TITLE, new DocLink(d));
+ setRowItem(row, d);
+ }
+
+ public void display(JsArray<DocInfo> docList) {
+ int sz = docList != null ? docList.length() : 0;
+ boolean hadData = rows > 0;
+
+ if (hadData) {
+ while (sz < rows) {
+ table.removeRow(dataBeginRow);
+ rows--;
+ }
+ } else {
+ table.removeRow(dataBeginRow);
+ }
+
+ if (sz == 0) {
+ insertNoneRow(dataBeginRow);
+ return;
+ }
+
+ while (rows < sz) {
+ insertDocRow(dataBeginRow + rows);
+ rows++;
+ }
+ for (int i = 0; i < sz; i++) {
+ populateDocRow(dataBeginRow + i, docList.get(i));
+ }
+ }
+
+ public static class DocLink extends Anchor {
+ public DocLink(DocInfo d) {
+ super(com.google.gerrit.client.changes.Util.cropSubject(d.title()));
+ setHref(d.getFullUrl());
+ }
+ }
+}
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/documentation/Util.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/documentation/Util.java
new file mode 100644
index 0000000..273ead8
--- /dev/null
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/documentation/Util.java
@@ -0,0 +1,22 @@
+// Copyright (C) 2013 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package com.google.gerrit.client.documentation;
+
+import com.google.gwt.core.client.GWT;
+
+public class Util {
+ public static final DocConstants C = GWT.create(DocConstants.class);
+ public static final DocMessages M = GWT.create(DocMessages.class);
+}
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/downloadIcon.png b/gerrit-gwtui/src/main/java/com/google/gerrit/client/downloadIcon.png
index 22ff495..1a6520e 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/downloadIcon.png
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/downloadIcon.png
Binary files differ
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/draftComments.png b/gerrit-gwtui/src/main/java/com/google/gerrit/client/draftComments.png
index 31c770f..276912a 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/draftComments.png
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/draftComments.png
Binary files differ
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/editText.png b/gerrit-gwtui/src/main/java/com/google/gerrit/client/editText.png
index 188e1c1..2927275 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/editText.png
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/editText.png
Binary files differ
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/gerrit.css b/gerrit-gwtui/src/main/java/com/google/gerrit/client/gerrit.css
index 5e604fb..48cabe7 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/gerrit.css
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/gerrit.css
@@ -661,7 +661,7 @@
.patchContentTable td {
padding-top: 0;
padding-bottom: 0;
- font-size: 8pt;
+ font-size: 9pt;
font-family: mono-font;
}
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/greenCheck.png b/gerrit-gwtui/src/main/java/com/google/gerrit/client/greenCheck.png
index cd70687..207c0e7 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/greenCheck.png
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/greenCheck.png
Binary files differ
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/queryIcon.png b/gerrit-gwtui/src/main/java/com/google/gerrit/client/queryIcon.png
index 5aace51..5ebf2cb 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/queryIcon.png
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/queryIcon.png
Binary files differ
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/redNot.png b/gerrit-gwtui/src/main/java/com/google/gerrit/client/redNot.png
index 4e83a8f..99834fd 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/redNot.png
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/redNot.png
Binary files differ
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/ProjectSearchLink.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/ProjectSearchLink.java
index 0ae29bf..dc2c73d 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/ProjectSearchLink.java
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/ProjectSearchLink.java
@@ -24,7 +24,7 @@
public class ProjectSearchLink extends InlineHyperlink {
public ProjectSearchLink(Project.NameKey projectName) {
- super(" ", PageLinks.toProjectDashboard(projectName, "default"));
+ super(" ", PageLinks.toProjectDefaultDashboard(projectName));
setTitle(Util.C.projectListQueryLink());
final Image image = new Image(Gerrit.RESOURCES.queryIcon());
DOM.insertBefore(getElement(), image.getElement(),
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/ProjectsTable.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/ProjectsTable.java
index 052878b..a99348d 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/ProjectsTable.java
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/ProjectsTable.java
@@ -25,6 +25,9 @@
import java.util.List;
public class ProjectsTable extends NavigationTable<ProjectInfo> {
+ public static final int C_NAME = 1;
+ public static final int C_DESCRIPTION = 2;
+ public static final int C_REPO_BROWSER = 3;
public ProjectsTable() {
super(Util.C.projectItemHelp());
@@ -32,12 +35,12 @@
}
protected void initColumnHeaders() {
- table.setText(0, 1, Util.C.projectName());
- table.setText(0, 2, Util.C.projectDescription());
+ table.setText(0, C_NAME, Util.C.projectName());
+ table.setText(0, C_DESCRIPTION, Util.C.projectDescription());
final FlexCellFormatter fmt = table.getFlexCellFormatter();
- fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().dataHeader());
- fmt.addStyleName(0, 2, Gerrit.RESOURCES.css().dataHeader());
+ fmt.addStyleName(0, C_NAME, Gerrit.RESOURCES.css().dataHeader());
+ fmt.addStyleName(0, C_DESCRIPTION, Gerrit.RESOURCES.css().dataHeader());
}
@Override
@@ -75,16 +78,16 @@
applyDataRowStyle(row);
final FlexCellFormatter fmt = table.getFlexCellFormatter();
- fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().dataCell());
- fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().projectNameColumn());
- fmt.addStyleName(row, 2, Gerrit.RESOURCES.css().dataCell());
+ fmt.addStyleName(row, C_NAME, Gerrit.RESOURCES.css().dataCell());
+ fmt.addStyleName(row, C_NAME, Gerrit.RESOURCES.css().projectNameColumn());
+ fmt.addStyleName(row, C_DESCRIPTION, Gerrit.RESOURCES.css().dataCell());
populate(row, k);
}
protected void populate(final int row, final ProjectInfo k) {
- table.setText(row, 1, k.name());
- table.setText(row, 2, k.description());
+ table.setText(row, C_NAME, k.name());
+ table.setText(row, C_DESCRIPTION, k.description());
setRowItem(row, k);
}
diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/CookieBase64.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/CookieBase64.java
index 3bcdcd2..fab9f1b 100644
--- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/CookieBase64.java
+++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/CookieBase64.java
@@ -33,8 +33,9 @@
}
private static int fill(final char[] out, int o, final char f, final int l) {
- for (char c = f; c <= l; c++)
+ for (char c = f; c <= l; c++) {
out[o++] = c;
+ }
return o;
}
diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/GerritConfigProvider.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/GerritConfigProvider.java
index 2980159..79aca6d 100644
--- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/GerritConfigProvider.java
+++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/GerritConfigProvider.java
@@ -136,7 +136,7 @@
config.setReportBugUrl(null);
}
- config.setGitBasicAuth(authConfig.isGitBasichAuth());
+ config.setGitBasicAuth(authConfig.isGitBasicAuth());
final Set<Account.FieldName> fields = new HashSet<Account.FieldName>();
for (final Account.FieldName n : Account.FieldName.values()) {
diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/GitOverHttpModule.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/GitOverHttpModule.java
index 6ca9949..4f4c783 100644
--- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/GitOverHttpModule.java
+++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/GitOverHttpModule.java
@@ -34,7 +34,7 @@
Class<? extends Filter> authFilter;
if (authConfig.isTrustContainerAuth()) {
authFilter = ContainerAuthFilter.class;
- } else if (authConfig.isGitBasichAuth()) {
+ } else if (authConfig.isGitBasicAuth()) {
authFilter = ProjectBasicAuthFilter.class;
} else {
authFilter = ProjectDigestFilter.class;
diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/project/ReviewProjectAccess.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/project/ReviewProjectAccess.java
index 3681888..27a02d9 100644
--- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/project/ReviewProjectAccess.java
+++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/project/ReviewProjectAccess.java
@@ -14,6 +14,7 @@
package com.google.gerrit.httpd.rpc.project;
+import com.google.gerrit.common.ChangeHooks;
import com.google.gerrit.common.Nullable;
import com.google.gerrit.common.data.AccessSection;
import com.google.gerrit.reviewdb.client.AccountGroup;
@@ -34,6 +35,7 @@
import com.google.gerrit.server.git.MetaDataUpdate;
import com.google.gerrit.server.git.ProjectConfig;
import com.google.gerrit.server.index.ChangeIndexer;
+import com.google.gerrit.server.mail.CreateChangeSender;
import com.google.gerrit.server.patch.PatchSetInfoFactory;
import com.google.gerrit.server.project.ChangeControl;
import com.google.gerrit.server.project.ProjectControl;
@@ -45,6 +47,8 @@
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.revwalk.RevCommit;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.util.ArrayList;
@@ -52,6 +56,9 @@
import java.util.List;
public class ReviewProjectAccess extends ProjectAccessHandler<Change.Id> {
+ private static final Logger log =
+ LoggerFactory.getLogger(ReviewProjectAccess.class);
+
interface Factory {
ReviewProjectAccess create(@Assisted Project.NameKey projectName,
@Nullable @Assisted ObjectId base,
@@ -65,6 +72,8 @@
private final Provider<PostReviewers> reviewersProvider;
private final ChangeControl.GenericFactory changeFactory;
private final ChangeIndexer indexer;
+ private final ChangeHooks hooks;
+ private final CreateChangeSender.Factory createChangeSenderFactory;
@Inject
ReviewProjectAccess(final ProjectControl.Factory projectControlFactory,
@@ -73,7 +82,8 @@
IdentifiedUser user, PatchSetInfoFactory patchSetInfoFactory,
Provider<PostReviewers> reviewersProvider,
ChangeControl.GenericFactory changeFactory,
- ChangeIndexer indexer,
+ ChangeIndexer indexer, ChangeHooks hooks,
+ CreateChangeSender.Factory createChangeSenderFactory,
@Assisted Project.NameKey projectName,
@Nullable @Assisted ObjectId base,
@@ -87,6 +97,8 @@
this.reviewersProvider = reviewersProvider;
this.changeFactory = changeFactory;
this.indexer = indexer;
+ this.hooks = hooks;
+ this.createChangeSenderFactory = createChangeSenderFactory;
}
@Override
@@ -122,12 +134,22 @@
insertAncestors(ps.getId(), commit);
db.patchSets().insert(Collections.singleton(ps));
db.changes().insert(Collections.singleton(change));
- addProjectOwnersAsReviewers(change);
db.commit();
} finally {
db.rollback();
}
indexer.index(change);
+ hooks.doPatchsetCreatedHook(change, ps, db);
+ try {
+ CreateChangeSender cm =
+ createChangeSenderFactory.create(change);
+ cm.setFrom(change.getOwner());
+ cm.setPatchSet(ps, info);
+ cm.send();
+ } catch (Exception err) {
+ log.error("Cannot send email for new change " + change.getId(), err);
+ }
+ addProjectOwnersAsReviewers(change);
return changeId;
}
diff --git a/gerrit-patch-jgit/BUCK b/gerrit-patch-jgit/BUCK
index 18890ac..1e0953f 100644
--- a/gerrit-patch-jgit/BUCK
+++ b/gerrit-patch-jgit/BUCK
@@ -30,3 +30,15 @@
],
visibility = ['PUBLIC'],
)
+
+java_test(
+ name = 'jgit_patch_tests',
+ srcs = glob(['src/test/java/**/*.java']),
+ deps = [
+ ':server',
+ '//lib/jgit:jgit',
+ '//lib:junit',
+ ],
+ source_under_test = [':server'],
+ visibility = ['//tools/eclipse:classpath'],
+)
diff --git a/gerrit-patch-jgit/src/main/java/org/eclipse/jgit/internal/storage/file/WindowCacheStatAccessor.java b/gerrit-patch-jgit/src/main/java/org/eclipse/jgit/internal/storage/file/WindowCacheStatAccessor.java
index f241daa..1e94050 100644
--- a/gerrit-patch-jgit/src/main/java/org/eclipse/jgit/internal/storage/file/WindowCacheStatAccessor.java
+++ b/gerrit-patch-jgit/src/main/java/org/eclipse/jgit/internal/storage/file/WindowCacheStatAccessor.java
@@ -14,8 +14,6 @@
package org.eclipse.jgit.internal.storage.file;
-import org.eclipse.jgit.internal.storage.file.WindowCache;
-
// Hack to obtain visibility to package level methods only.
// These aren't yet part of the public JGit API.
diff --git a/gerrit-patch-jgit/src/test/java/org/eclipse/jgit/diff/EditDeserializerTest.java b/gerrit-patch-jgit/src/test/java/org/eclipse/jgit/diff/EditDeserializerTest.java
new file mode 100644
index 0000000..d4bb26f
--- /dev/null
+++ b/gerrit-patch-jgit/src/test/java/org/eclipse/jgit/diff/EditDeserializerTest.java
@@ -0,0 +1,25 @@
+// Copyright (C) 2013 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.eclipse.jgit.diff;
+
+import junit.framework.TestCase;
+
+import org.eclipse.jgit.diff.EditDeserializer;
+
+public class EditDeserializerTest extends TestCase {
+ public void testDiffDeserializer() {
+ assertNotNull("edit deserializer", new EditDeserializer());
+ }
+}
diff --git a/gerrit-pgm/BUCK b/gerrit-pgm/BUCK
index d3a8408..8915353 100644
--- a/gerrit-pgm/BUCK
+++ b/gerrit-pgm/BUCK
@@ -68,7 +68,10 @@
'//lib:gwtorm',
],
compile_deps = ['//gerrit-launcher:launcher'],
- visibility = ['//gerrit-war:'],
+ visibility = [
+ '//gerrit-war:',
+ '//gerrit-acceptance-tests/...',
+ ],
)
java_library2(
diff --git a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/http/jetty/HiddenErrorHandler.java b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/http/jetty/HiddenErrorHandler.java
index e086e6a..9fd8929 100644
--- a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/http/jetty/HiddenErrorHandler.java
+++ b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/http/jetty/HiddenErrorHandler.java
@@ -65,8 +65,9 @@
private static byte[] message(AbstractHttpConnection conn) {
String msg = conn.getResponse().getReason();
- if (msg == null)
+ if (msg == null) {
msg = HttpStatus.getMessage(conn.getResponse().getStatus());
+ }
return msg.getBytes(Charsets.ISO_8859_1);
}
diff --git a/gerrit-plugin-gwt-archetype/src/main/resources/archetype-resources/src/main/java/public/gwt-hello-gadgets-igoogle-thumb.png b/gerrit-plugin-gwt-archetype/src/main/resources/archetype-resources/src/main/java/public/gwt-hello-gadgets-igoogle-thumb.png
index e970774..d45c63f 100644
--- a/gerrit-plugin-gwt-archetype/src/main/resources/archetype-resources/src/main/java/public/gwt-hello-gadgets-igoogle-thumb.png
+++ b/gerrit-plugin-gwt-archetype/src/main/resources/archetype-resources/src/main/java/public/gwt-hello-gadgets-igoogle-thumb.png
Binary files differ
diff --git a/gerrit-plugin-gwt-archetype/src/main/resources/archetype-resources/src/main/java/public/gwt-hello-gadgets-igoogle.png b/gerrit-plugin-gwt-archetype/src/main/resources/archetype-resources/src/main/java/public/gwt-hello-gadgets-igoogle.png
index c041149..5c9009a 100644
--- a/gerrit-plugin-gwt-archetype/src/main/resources/archetype-resources/src/main/java/public/gwt-hello-gadgets-igoogle.png
+++ b/gerrit-plugin-gwt-archetype/src/main/resources/archetype-resources/src/main/java/public/gwt-hello-gadgets-igoogle.png
Binary files differ
diff --git a/gerrit-plugin-gwtui/pom.xml b/gerrit-plugin-gwtui/pom.xml
new file mode 100644
index 0000000..948f13e
--- /dev/null
+++ b/gerrit-plugin-gwtui/pom.xml
@@ -0,0 +1,161 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (C) 2012 The Android Open Source Project
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>com.google.gerrit</groupId>
+ <artifactId>gerrit-plugin-gwtui</artifactId>
+ <version>2.9-SNAPSHOT</version>
+ <name>Gerrit Code Review - Plugin GWT UI</name>
+
+ <description>
+ API for UI plugins to build with GWT and integrate with Gerrit
+ </description>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-user</artifactId>
+ <version>2.5.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-dev</artifactId>
+ <version>2.5.1</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>gwt-maven-plugin</artifactId>
+ <versionRange>[2.5.0,)</versionRange>
+ <goals>
+ <goal>resources</goal>
+ <goal>compile</goal>
+ <goal>i18n</goal>
+ <goal>generateAsync</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <execute />
+ </action>
+ </pluginExecution>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <versionRange>[2.1.1,)</versionRange>
+ <goals>
+ <goal>exploded</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <execute />
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>gwt-maven-plugin</artifactId>
+ <configuration>
+ <module>com.google.gerrit.Plugin</module>
+ <disableClassMetadata>true</disableClassMetadata>
+ <disableCastChecking>true</disableCastChecking>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>resources</goal>
+ <goal>compile</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unpack-sources</id>
+ <phase>package</phase>
+ <configuration>
+ <tasks>
+ <unzip src="${project.build.directory}/${project.artifactId}-${project.version}-sources.jar" dest="${project.build.directory}/unpack_sources" />
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <sourcepath>${project.build.directory}/unpack_sources</sourcepath>
+ <encoding>ISO-8859-1</encoding>
+ <quiet>true</quiet>
+ <detectOfflineLinks>false</detectOfflineLinks>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ <phase>package</phase>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+</project>
+
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/DefaultFileExtensionRegistry.java b/gerrit-server/src/main/java/com/google/gerrit/server/DefaultFileExtensionRegistry.java
new file mode 100644
index 0000000..15062ac
--- /dev/null
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/DefaultFileExtensionRegistry.java
@@ -0,0 +1,104 @@
+// Copyright (C) 2013 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package com.google.gerrit.server;
+
+import com.google.common.collect.ImmutableMap;
+
+import eu.medsea.mimeutil.MimeType;
+import eu.medsea.mimeutil.MimeUtil;
+import eu.medsea.mimeutil.detector.MimeDetector;
+
+import java.io.File;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Collection;
+import java.util.Collections;
+
+public class DefaultFileExtensionRegistry extends MimeDetector {
+ private static final MimeType INI = newMimeType("text/x-ini", 2);
+ private static final MimeType PYTHON = newMimeType("text/x-python", 2);
+
+ private static final ImmutableMap<String, MimeType> TYPES = ImmutableMap.of(
+ ".gitmodules", INI,
+ "project.config", INI,
+ "BUCK", PYTHON,
+ "defs", newMimeType(PYTHON.toString(), 1),
+ "go", newMimeType("text/x-go", 1));
+
+ private static MimeType newMimeType(String type, final int specificity) {
+ return new MimeType(type) {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public int getSpecificity() {
+ return specificity;
+ }
+ };
+ }
+
+ static {
+ for (MimeType type : TYPES.values()) {
+ MimeUtil.addKnownMimeType(type);
+ }
+ }
+
+ @Override
+ public String getDescription() {
+ return getClass().getName();
+ }
+
+ @Override
+ protected Collection<MimeType> getMimeTypesFileName(String name) {
+ int s = name.lastIndexOf('/');
+ if (s >= 0) {
+ name = name.substring(s + 1);
+ }
+
+ MimeType type = TYPES.get(name);
+ if (type != null) {
+ return Collections.singletonList(type);
+ }
+
+ int d = name.lastIndexOf('.');
+ if (0 < d) {
+ type = TYPES.get(name.substring(d + 1));
+ if (type != null) {
+ return Collections.singletonList(type);
+ }
+ }
+
+ return Collections.emptyList();
+ }
+
+ @Override
+ protected Collection<MimeType> getMimeTypesFile(File file) {
+ return getMimeTypesFileName(file.getName());
+ }
+
+ @Override
+ protected Collection<MimeType> getMimeTypesURL(URL url) {
+ return getMimeTypesFileName(url.getPath());
+ }
+
+ @Override
+ protected Collection<MimeType> getMimeTypesInputStream(InputStream arg0) {
+ return Collections.emptyList();
+ }
+
+ @Override
+ protected Collection<MimeType> getMimeTypesByteArray(byte[] arg0) {
+ return Collections.emptyList();
+ }
+}
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/MimeUtilFileTypeRegistry.java b/gerrit-server/src/main/java/com/google/gerrit/server/MimeUtilFileTypeRegistry.java
index b271d6a..ff46b00 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/MimeUtilFileTypeRegistry.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/MimeUtilFileTypeRegistry.java
@@ -54,13 +54,13 @@
if (HostPlatform.isWin32()) {
register("eu.medsea.mimeutil.detector.WindowsRegistryMimeDetector");
}
+ register(DefaultFileExtensionRegistry.class.getName());
}
private void register(String name) {
mimeUtil.registerMimeDetector(name);
}
-
/**
* Get specificity of mime types with generic types forced to low values
*
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/change/ChangeJson.java b/gerrit-server/src/main/java/com/google/gerrit/server/change/ChangeJson.java
index f64e424..6373e6e 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/change/ChangeJson.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/change/ChangeJson.java
@@ -551,10 +551,10 @@
Maps.newHashMapWithExpectedSize(labels.size());
if (detailed) {
- for (String name : labels.keySet()) {
+ for (Map.Entry<String, LabelInfo> entry : labels.entrySet()) {
ApprovalInfo ai = approvalInfo(accountId, 0, null);
- byLabel.put(name, ai);
- labels.get(name).addApproval(ai);
+ byLabel.put(entry.getKey(), ai);
+ entry.getValue().addApproval(ai);
}
}
for (PatchSetApproval psa : current.get(accountId)) {
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/change/ChangeResource.java b/gerrit-server/src/main/java/com/google/gerrit/server/change/ChangeResource.java
index 87910bf..b0562a9 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/change/ChangeResource.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/change/ChangeResource.java
@@ -57,6 +57,7 @@
Hasher h = Hashing.md5().newHasher()
.putLong(getChange().getLastUpdatedOn().getTime())
.putInt(getChange().getRowVersion())
+ .putBoolean(user.getStarredChanges().contains(getChange().getId()))
.putInt(user.isIdentifiedUser()
? ((IdentifiedUser) user).getAccountId().get()
: 0);
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/change/PostReview.java b/gerrit-server/src/main/java/com/google/gerrit/server/change/PostReview.java
index 367087c..30eca7b 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/change/PostReview.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/change/PostReview.java
@@ -121,8 +121,8 @@
public CommentRange range;
}
- static class Output {
- Map<String, Short> labels;
+ public static class Output {
+ public Map<String, Short> labels;
}
private final Provider<ReviewDb> db;
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/config/AuthConfig.java b/gerrit-server/src/main/java/com/google/gerrit/server/config/AuthConfig.java
index 0b414f2..6d01e7c5 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/config/AuthConfig.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/config/AuthConfig.java
@@ -197,7 +197,7 @@
}
/** Whether git-over-http should use Gerrit basic authentication scheme. */
- public boolean isGitBasichAuth() {
+ public boolean isGitBasicAuth() {
return gitBasicAuth;
}
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/config/PluginConfigFactory.java b/gerrit-server/src/main/java/com/google/gerrit/server/config/PluginConfigFactory.java
index 90b6d2f..294d8a5 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/config/PluginConfigFactory.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/config/PluginConfigFactory.java
@@ -37,12 +37,49 @@
this.projectStateFactory = projectStateFactory;
}
- public PluginConfig get(String pluginName) {
+ /**
+ * Returns the configuration for the specified plugin that is stored in the
+ * 'gerrit.config' file.
+ *
+ * The returned plugin configuration provides access to all parameters of the
+ * 'gerrit.config' file that are set in the 'plugin' subsection of the
+ * specified plugin.
+ *
+ * E.g.:
+ * [plugin "my-plugin"]
+ * myKey = myValue
+ *
+ * @param pluginName the name of the plugin for which the configuration should
+ * be returned
+ * @return the plugin configuration from the 'gerrit.config' file
+ */
+ public PluginConfig getFromGerritConfig(String pluginName) {
return new PluginConfig(pluginName, cfg);
}
- public PluginConfig get(Project.NameKey projectName, String pluginName)
- throws NoSuchProjectException {
+ /**
+ * Returns the configuration for the specified plugin that is stored in the
+ * 'project.config' file of the specified project.
+ *
+ * The returned plugin configuration provides access to all parameters of the
+ * 'project.config' file that are set in the 'plugin' subsection of the
+ * specified plugin.
+ *
+ * E.g.:
+ * [plugin "my-plugin"]
+ * myKey = myValue
+ *
+ * @param projectName the name of the project for which the plugin
+ * configuration should be returned
+ * @param pluginName the name of the plugin for which the configuration should
+ * be returned
+ * @return the plugin configuration from the 'project.config' file of the
+ * specified project
+ * @throws NoSuchProjectException thrown if the specified project does not
+ * exist
+ */
+ public PluginConfig getFromProjectConfig(Project.NameKey projectName,
+ String pluginName) throws NoSuchProjectException {
ProjectState projectState = projectCache.get(projectName);
if (projectState == null) {
throw new NoSuchProjectException(projectName);
@@ -50,8 +87,45 @@
return projectState.getConfig().getPluginConfig(pluginName);
}
- public PluginConfig getWithInheritance(Project.NameKey projectName,
- String pluginName) throws NoSuchProjectException {
- return get(projectName, pluginName).withInheritance(projectStateFactory);
+ /**
+ * Returns the configuration for the specified plugin that is stored in the
+ * 'project.config' file of the specified project. Parameters which are not
+ * set in the 'project.config' of this project are inherited from the parent
+ * project's 'project.config' files.
+ *
+ * The returned plugin configuration provides access to all parameters of the
+ * 'project.config' file that are set in the 'plugin' subsection of the
+ * specified plugin.
+ *
+ * E.g.:
+ * child project:
+ * [plugin "my-plugin"]
+ * myKey = childValue
+ *
+ * parent project:
+ * [plugin "my-plugin"]
+ * myKey = parentValue
+ * anotherKey = someValue
+ *
+ * return:
+ * [plugin "my-plugin"]
+ * myKey = childValue
+ * anotherKey = someValue
+ *
+ * @param projectName the name of the project for which the plugin
+ * configuration should be returned
+ * @param pluginName the name of the plugin for which the configuration should
+ * be returned
+ * @return the plugin configuration from the 'project.config' file of the
+ * specified project with inherited non-set parameters from the
+ * parent projects
+ * @throws NoSuchProjectException thrown if the specified project does not
+ * exist
+ */
+ public PluginConfig getFromProjectConfigWithInheritance(
+ Project.NameKey projectName, String pluginName)
+ throws NoSuchProjectException {
+ return getFromProjectConfig(projectName, pluginName).withInheritance(
+ projectStateFactory);
}
}
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/documentation/QueryDocumentationExecutor.java b/gerrit-server/src/main/java/com/google/gerrit/server/documentation/QueryDocumentationExecutor.java
index c9d68e8..576ed9f 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/documentation/QueryDocumentationExecutor.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/documentation/QueryDocumentationExecutor.java
@@ -82,6 +82,8 @@
}
try {
Query query = parser.parse(q);
+ // TODO(fishywang): Currently as we don't have much documentation, we just use MAX_VALUE here
+ // and skipped paging. Maybe add paging later.
TopDocs results = searcher.search(query, Integer.MAX_VALUE);
ScoreDoc[] hits = results.scoreDocs;
int totalHits = results.totalHits;
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/git/ReceiveCommits.java b/gerrit-server/src/main/java/com/google/gerrit/server/git/ReceiveCommits.java
index 06e88e4..3800d9a 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/git/ReceiveCommits.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/git/ReceiveCommits.java
@@ -328,7 +328,7 @@
final ChangeCache changeCache,
final ChangeInserter.Factory changeInserterFactory,
final CommitValidators.Factory commitValidatorsFactory,
- @CanonicalWebUrl @Nullable final String canonicalWebUrl,
+ @CanonicalWebUrl final String canonicalWebUrl,
@GerritPersonIdent final PersonIdent gerritIdent,
final TrackingFooters trackingFooters,
final WorkQueue workQueue,
@@ -404,9 +404,10 @@
if (allRefs == null) {
try {
allRefs = rp.getRepository().getRefDatabase().getRefs(ALL);
+ } catch (ServiceMayNotContinueException e) {
+ throw e;
} catch (IOException e) {
- ServiceMayNotContinueException ex =
- new ServiceMayNotContinueException(e.getMessage());
+ ServiceMayNotContinueException ex = new ServiceMayNotContinueException();
ex.initCause(e);
throw ex;
}
@@ -591,22 +592,42 @@
return input.created;
}
});
- if (!Iterables.isEmpty(created) && canonicalWebUrl != null) {
- final String url = canonicalWebUrl;
+ if (!Iterables.isEmpty(created)) {
addMessage("");
addMessage("New Changes:");
for (CreateRequest c : created) {
- StringBuilder m = new StringBuilder()
- .append(" ")
- .append(url)
- .append(c.change.getChangeId());
- if (c.change.getStatus() == Change.Status.DRAFT) {
- m.append(" [DRAFT]");
- }
- addMessage(m.toString());
+ addMessage(formatChangeUrl(canonicalWebUrl, c.change));
}
addMessage("");
}
+
+ Iterable<ReplaceRequest> updated =
+ Iterables.filter(replaceByChange.values(),
+ new Predicate<ReplaceRequest>() {
+ @Override
+ public boolean apply(ReplaceRequest input) {
+ return !input.skip;
+ }
+ });
+ if (!Iterables.isEmpty(updated)) {
+ addMessage("");
+ addMessage("Updated Changes:");
+ for (ReplaceRequest u : updated) {
+ addMessage(formatChangeUrl(canonicalWebUrl, u.change));
+ }
+ addMessage("");
+ }
+ }
+
+ private static String formatChangeUrl(String url, Change change) {
+ StringBuilder m = new StringBuilder()
+ .append(" ")
+ .append(url)
+ .append(change.getChangeId());
+ if (change.getStatus() == Change.Status.DRAFT) {
+ m.append(" [DRAFT]");
+ }
+ return m.toString();
}
private void insertChangesAndPatchSets() {
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/git/ReceiveCommitsAdvertiseRefsHook.java b/gerrit-server/src/main/java/com/google/gerrit/server/git/ReceiveCommitsAdvertiseRefsHook.java
index 530a388..f34ce8b 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/git/ReceiveCommitsAdvertiseRefsHook.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/git/ReceiveCommitsAdvertiseRefsHook.java
@@ -68,9 +68,10 @@
if (oldRefs == null) {
try {
oldRefs = rp.getRepository().getRefDatabase().getRefs(ALL);
+ } catch (ServiceMayNotContinueException e) {
+ throw e;
} catch (IOException e) {
- ServiceMayNotContinueException ex =
- new ServiceMayNotContinueException(e.getMessage());
+ ServiceMayNotContinueException ex = new ServiceMayNotContinueException();
ex.initCause(e);
throw ex;
}
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/git/VisibleRefFilter.java b/gerrit-server/src/main/java/com/google/gerrit/server/git/VisibleRefFilter.java
index 8c65b1a..14aae94 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/git/VisibleRefFilter.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/git/VisibleRefFilter.java
@@ -127,9 +127,10 @@
RevWalk revWalk) throws ServiceMayNotContinueException {
try {
return filter(repository.getRefDatabase().getRefs(RefDatabase.ALL));
+ } catch (ServiceMayNotContinueException e) {
+ throw e;
} catch (IOException e) {
- ServiceMayNotContinueException ex =
- new ServiceMayNotContinueException(e.getMessage());
+ ServiceMayNotContinueException ex = new ServiceMayNotContinueException();
ex.initCause(e);
throw ex;
}
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/index/ChangeField.java b/gerrit-server/src/main/java/com/google/gerrit/server/index/ChangeField.java
index a74ef01..290bd31 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/index/ChangeField.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/index/ChangeField.java
@@ -206,7 +206,9 @@
throws OrmException {
Set<String> revisions = Sets.newHashSet();
for (PatchSet ps : input.patches(args.db)) {
- revisions.add(ps.getRevision().get());
+ if (ps.getRevision() != null) {
+ revisions.add(ps.getRevision().get());
+ }
}
return revisions;
}
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/patch/PatchFile.java b/gerrit-server/src/main/java/com/google/gerrit/server/patch/PatchFile.java
index 6fcf581..81f4352 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/patch/PatchFile.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/patch/PatchFile.java
@@ -31,7 +31,6 @@
import org.eclipse.jgit.treewalk.TreeWalk;
import java.io.IOException;
-import java.nio.charset.CharacterCodingException;
/** State supporting processing of a single {@link Patch} instance. */
public class PatchFile {
@@ -89,7 +88,6 @@
* @throws CorruptEntityException the patch cannot be read.
* @throws IOException the patch or complete file content cannot be read.
* @throws NoSuchEntityException
- * @throws CharacterCodingException the file is not a known character set.
*/
public String getLine(final int file, final int line)
throws CorruptEntityException, IOException, NoSuchEntityException {
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/patch/PatchListCacheImpl.java b/gerrit-server/src/main/java/com/google/gerrit/server/patch/PatchListCacheImpl.java
index 967e6a7..7b7c731 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/patch/PatchListCacheImpl.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/patch/PatchListCacheImpl.java
@@ -90,6 +90,10 @@
throws PatchListNotAvailableException {
final Project.NameKey projectKey = change.getProject();
final ObjectId a = null;
+ if (patchSet.getRevision() == null) {
+ throw new PatchListNotAvailableException(
+ "revision is null for " + patchSet.getId());
+ }
final ObjectId b = ObjectId.fromString(patchSet.getRevision().get());
final Whitespace ws = Whitespace.IGNORE_NONE;
return get(new PatchListKey(projectKey, a, b, ws));
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/patch/PatchListLoader.java b/gerrit-server/src/main/java/com/google/gerrit/server/patch/PatchListLoader.java
index e1294e0..b71d04a 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/patch/PatchListLoader.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/patch/PatchListLoader.java
@@ -311,8 +311,8 @@
MergeFormatter fmt = new MergeFormatter();
Map<String, MergeResult<? extends Sequence>> r = m.getMergeResults();
Map<String, ObjectId> resolved = new HashMap<String, ObjectId>();
- for (String path : r.keySet()) {
- MergeResult<? extends Sequence> p = r.get(path);
+ for (Map.Entry<String, MergeResult<? extends Sequence>> entry : r.entrySet()) {
+ MergeResult<? extends Sequence> p = entry.getValue();
TemporaryBuffer buf = new TemporaryBuffer.LocalFile(10 * 1024 * 1024);
try {
fmt.formatMerge(buf, p, "BASE", oursName, theirsName, "UTF-8");
@@ -320,7 +320,7 @@
InputStream in = buf.openInputStream();
try {
- resolved.put(path, ins.insert(Constants.OBJ_BLOB, buf.length(), in));
+ resolved.put(entry.getKey(), ins.insert(Constants.OBJ_BLOB, buf.length(), in));
} finally {
in.close();
}
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/plugins/CleanupHandle.java b/gerrit-server/src/main/java/com/google/gerrit/server/plugins/CleanupHandle.java
index b04f337..593f2c9 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/plugins/CleanupHandle.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/plugins/CleanupHandle.java
@@ -32,6 +32,7 @@
try {
jarFile.close();
} catch (IOException err) {
+ PluginLoader.log.error("Cannot close " + jarFile.getName(), err);
}
if (!tmpFile.delete() && tmpFile.exists()) {
PluginLoader.log.warn("Cannot delete " + tmpFile.getAbsolutePath()
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/plugins/JarPlugin.java b/gerrit-server/src/main/java/com/google/gerrit/server/plugins/JarPlugin.java
index 6adc677..1568997 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/plugins/JarPlugin.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/plugins/JarPlugin.java
@@ -17,6 +17,7 @@
import com.google.common.base.Strings;
import com.google.common.collect.Lists;
import com.google.gerrit.common.Nullable;
+import com.google.gerrit.extensions.annotations.PluginCanonicalWebUrl;
import com.google.gerrit.extensions.annotations.PluginData;
import com.google.gerrit.extensions.annotations.PluginName;
import com.google.gerrit.extensions.registration.RegistrationHandle;
@@ -59,6 +60,7 @@
private final JarFile jarFile;
private final Manifest manifest;
private final File dataDir;
+ private final String pluginCanonicalWebUrl;
private final ClassLoader classLoader;
private Class<? extends Module> sysModule;
private Class<? extends Module> sshModule;
@@ -71,6 +73,7 @@
private List<ReloadableRegistrationHandle<?>> reloadableHandles;
public JarPlugin(String name,
+ String pluginCanonicalWebUrl,
PluginUser pluginUser,
File srcJar,
FileSnapshot snapshot,
@@ -83,6 +86,7 @@
@Nullable Class<? extends Module> sshModule,
@Nullable Class<? extends Module> httpModule) {
super(name, srcJar, pluginUser, snapshot, apiType);
+ this.pluginCanonicalWebUrl = pluginCanonicalWebUrl;
this.jarFile = jarFile;
this.manifest = manifest;
this.dataDir = dataDir;
@@ -193,6 +197,9 @@
bind(String.class)
.annotatedWith(PluginName.class)
.toInstance(getName());
+ bind(String.class)
+ .annotatedWith(PluginCanonicalWebUrl.class)
+ .toInstance(pluginCanonicalWebUrl);
bind(File.class)
.annotatedWith(PluginData.class)
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/plugins/PluginLoader.java b/gerrit-server/src/main/java/com/google/gerrit/server/plugins/PluginLoader.java
index 7569744..4682d2b 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/plugins/PluginLoader.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/plugins/PluginLoader.java
@@ -14,6 +14,7 @@
package com.google.gerrit.server.plugins;
+import com.google.common.base.CharMatcher;
import com.google.common.base.Joiner;
import com.google.common.base.Objects;
import com.google.common.base.Predicate;
@@ -30,6 +31,7 @@
import com.google.gerrit.extensions.systemstatus.ServerInformation;
import com.google.gerrit.extensions.webui.JavaScriptPlugin;
import com.google.gerrit.server.PluginUser;
+import com.google.gerrit.server.config.CanonicalWebUrl;
import com.google.gerrit.server.config.ConfigUtil;
import com.google.gerrit.server.config.GerritServerConfig;
import com.google.gerrit.server.config.SitePaths;
@@ -86,6 +88,7 @@
private final Queue<Plugin> toCleanup;
private final Provider<PluginCleanerTask> cleaner;
private final PluginScannerThread scanner;
+ private final Provider<String> urlProvider;
@Inject
public PluginLoader(SitePaths sitePaths,
@@ -93,7 +96,8 @@
ServerInformationImpl sii,
PluginUser.Factory puf,
Provider<PluginCleanerTask> pct,
- @GerritServerConfig Config cfg) {
+ @GerritServerConfig Config cfg,
+ @CanonicalWebUrl Provider<String> provider) {
pluginsDir = sitePaths.plugins_dir;
dataDir = sitePaths.data_dir;
tmpDir = sitePaths.tmp_dir;
@@ -106,6 +110,7 @@
toCleanup = Queues.newArrayDeque();
cleanupHandles = Maps.newConcurrentMap();
cleaner = pct;
+ urlProvider = provider;
long checkFrequency = ConfigUtil.getTimeUnit(cfg,
"plugins", null, "checkFrequency",
@@ -344,8 +349,9 @@
syncDisabledPlugins(jars);
Map<String, File> activePlugins = filterDisabled(jars);
- for (String name : activePlugins.keySet()) {
- File jar = activePlugins.get(name);
+ for (Map.Entry<String, File> entry : activePlugins.entrySet()) {
+ String name = entry.getKey();
+ File jar = entry.getValue();
FileSnapshot brokenTime = broken.get(name);
if (brokenTime != null && !brokenTime.isModified(jar)) {
continue;
@@ -504,7 +510,13 @@
Class<? extends Module> sysModule = load(sysName, pluginLoader);
Class<? extends Module> sshModule = load(sshName, pluginLoader);
Class<? extends Module> httpModule = load(httpName, pluginLoader);
- Plugin plugin = new JarPlugin(name, pluginUserFactory.create(name),
+
+ String url = String.format("%s/plugins/%s/",
+ CharMatcher.is('/').trimTrailingFrom(urlProvider.get()),
+ name);
+
+ Plugin plugin = new JarPlugin(name, url,
+ pluginUserFactory.create(name),
srcJar, snapshot,
jarFile, manifest,
new File(dataDir, name), type, pluginLoader,
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/schema/Schema_57.java b/gerrit-server/src/main/java/com/google/gerrit/server/schema/Schema_57.java
index 0edbc06..4b4f5456 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/schema/Schema_57.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/schema/Schema_57.java
@@ -43,6 +43,7 @@
import java.io.IOException;
import java.sql.PreparedStatement;
+import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Collections;
@@ -101,7 +102,17 @@
// Prepare the account_group_includes query
PreparedStatement stmt = ((JdbcSchema) db).getConnection().
- prepareStatement("SELECT * FROM account_group_includes WHERE group_id = ?");
+ prepareStatement("SELECT COUNT(1) FROM account_group_includes WHERE group_id = ?");
+ boolean isAccountGroupEmpty = false;
+ try {
+ stmt.setInt(1, sc.batchUsersGroupId.get());
+ ResultSet rs = stmt.executeQuery();
+ if (rs.next()) {
+ isAccountGroupEmpty = rs.getInt(1) == 0;
+ }
+ } finally {
+ stmt.close();
+ }
for (String name : createGroupList) {
AccountGroup.NameKey key = new AccountGroup.NameKey(name);
@@ -125,10 +136,10 @@
}
AccountGroup batch = db.accountGroups().get(sc.batchUsersGroupId);
- stmt.setInt(1, sc.batchUsersGroupId.get());
+
if (batch != null
&& db.accountGroupMembers().byGroup(sc.batchUsersGroupId).toList().isEmpty()
- && stmt.executeQuery().first() != false) {
+ && !isAccountGroupEmpty) {
// If the batch user group is not used, delete it.
//
db.accountGroups().delete(Collections.singleton(batch));
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/schema/Schema_77.java b/gerrit-server/src/main/java/com/google/gerrit/server/schema/Schema_77.java
index 472bc25..80639d6 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/schema/Schema_77.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/schema/Schema_77.java
@@ -199,51 +199,40 @@
static LegacyLabelTypes getLegacyTypes(ReviewDb db) throws SQLException {
List<LegacyLabelType> types = Lists.newArrayListWithCapacity(2);
- Statement catStmt = null;
- PreparedStatement valStmt = null;
- ResultSet catRs = null;
+ Statement catStmt = ((JdbcSchema) db).getConnection().createStatement();
try {
- catStmt = ((JdbcSchema) db).getConnection().createStatement();
- catRs = catStmt.executeQuery(
+ ResultSet catRs = catStmt.executeQuery(
"SELECT category_id, name, abbreviated_name, function_name, "
+ " copy_min_score"
+ " FROM approval_categories"
+ " ORDER BY position, name");
- valStmt = ((JdbcSchema) db).getConnection().prepareStatement(
- "SELECT value, name"
- + " FROM approval_category_values"
- + " WHERE category_id = ?");
- while (catRs.next()) {
- String id = catRs.getString("category_id");
- valStmt.setString(1, id);
- List<LabelValue> values = Lists.newArrayListWithCapacity(5);
- ResultSet valRs = valStmt.executeQuery();
- try {
+ PreparedStatement valStmt = ((JdbcSchema) db).getConnection().prepareStatement(
+ "SELECT value, name"
+ + " FROM approval_category_values"
+ + " WHERE category_id = ?");
+ try {
+ while (catRs.next()) {
+ String id = catRs.getString("category_id");
+ valStmt.setString(1, id);
+ List<LabelValue> values = Lists.newArrayListWithCapacity(5);
+ ResultSet valRs = valStmt.executeQuery();
while (valRs.next()) {
values.add(new LabelValue(
valRs.getShort("value"), valRs.getString("name")));
}
- } finally {
- valRs.close();
+ LegacyLabelType type =
+ new LegacyLabelType(getLabelName(catRs.getString("name")), values);
+ type.setId(id);
+ type.setAbbreviation(catRs.getString("abbreviated_name"));
+ type.setFunctionName(catRs.getString("function_name"));
+ type.setCopyMinScore("Y".equals(catRs.getString("copy_min_score")));
+ types.add(type);
}
- LegacyLabelType type =
- new LegacyLabelType(getLabelName(catRs.getString("name")), values);
- type.setId(id);
- type.setAbbreviation(catRs.getString("abbreviated_name"));
- type.setFunctionName(catRs.getString("function_name"));
- type.setCopyMinScore("Y".equals(catRs.getString("copy_min_score")));
- types.add(type);
- }
- } finally {
- if (valStmt != null) {
+ } finally {
valStmt.close();
}
- if (catRs != null) {
- catRs.close();
- }
- if (catStmt != null) {
- catStmt.close();
- }
+ } finally {
+ catStmt.close();
}
return new LegacyLabelTypes(types);
}
diff --git a/gerrit-server/src/test/java/com/google/gerrit/server/change/CommentsTest.java b/gerrit-server/src/test/java/com/google/gerrit/server/change/CommentsTest.java
index 18b3c98..6fc08f3 100644
--- a/gerrit-server/src/test/java/com/google/gerrit/server/change/CommentsTest.java
+++ b/gerrit-server/src/test/java/com/google/gerrit/server/change/CommentsTest.java
@@ -186,9 +186,9 @@
assertNotNull(actual);
assertEquals(expected.size(), actual.size());
assertEquals(expected.keySet(), actual.keySet());
- for (String filename : expected.keySet()) {
- List<PatchLineComment> expectedComments = expected.get(filename);
- List<CommentInfo> actualComments = actual.get(filename);
+ for (Map.Entry<String, ArrayList<PatchLineComment>> entry : expected.entrySet()) {
+ List<PatchLineComment> expectedComments = entry.getValue();
+ List<CommentInfo> actualComments = actual.get(entry.getKey());
assertNotNull(actualComments);
assertEquals(expectedComments.size(), actualComments.size());
for (int i = 0; i < expectedComments.size(); i++) {
diff --git a/gerrit-server/src/test/java/com/google/gerrit/server/ioutil/ColumnFormatterTest.java b/gerrit-server/src/test/java/com/google/gerrit/server/ioutil/ColumnFormatterTest.java
index 2d432e6..3b4005c 100644
--- a/gerrit-server/src/test/java/com/google/gerrit/server/ioutil/ColumnFormatterTest.java
+++ b/gerrit-server/src/test/java/com/google/gerrit/server/ioutil/ColumnFormatterTest.java
@@ -14,8 +14,6 @@
package com.google.gerrit.server.ioutil;
-import com.google.gerrit.server.ioutil.ColumnFormatter;
-
import junit.framework.TestCase;
import java.io.PrintWriter;
diff --git a/gerrit-server/src/test/java/com/google/gerrit/server/project/Util.java b/gerrit-server/src/test/java/com/google/gerrit/server/project/Util.java
index a99eba1..c6e621a 100644
--- a/gerrit-server/src/test/java/com/google/gerrit/server/project/Util.java
+++ b/gerrit-server/src/test/java/com/google/gerrit/server/project/Util.java
@@ -54,12 +54,12 @@
import java.util.Set;
public class Util {
- public static AccountGroup.UUID ANONYMOUS = AccountGroup.ANONYMOUS_USERS;
- public static AccountGroup.UUID REGISTERED = AccountGroup.REGISTERED_USERS;
- public static AccountGroup.UUID ADMIN = new AccountGroup.UUID("test.admin");
- public static AccountGroup.UUID DEVS = new AccountGroup.UUID("test.devs");
+ public static final AccountGroup.UUID ANONYMOUS = AccountGroup.ANONYMOUS_USERS;
+ public static final AccountGroup.UUID REGISTERED = AccountGroup.REGISTERED_USERS;
+ public static final AccountGroup.UUID ADMIN = new AccountGroup.UUID("test.admin");
+ public static final AccountGroup.UUID DEVS = new AccountGroup.UUID("test.devs");
- public static LabelType CR = category("Code-Review",
+ public static final LabelType CR = category("Code-Review",
value(2, "Looks good to me, approved"),
value(1, "Looks good to me, but someone else must approve"),
value(0, "No score"),
diff --git a/gerrit-server/src/test/java/com/google/gerrit/server/util/SubmoduleSectionParserTest.java b/gerrit-server/src/test/java/com/google/gerrit/server/util/SubmoduleSectionParserTest.java
index 299a245..ed86031 100644
--- a/gerrit-server/src/test/java/com/google/gerrit/server/util/SubmoduleSectionParserTest.java
+++ b/gerrit-server/src/test/java/com/google/gerrit/server/util/SubmoduleSectionParserTest.java
@@ -200,8 +200,9 @@
expect(bbc.getSubsections("submodule"))
.andReturn(sectionsToReturn.keySet());
- for (final String id : sectionsToReturn.keySet()) {
- final SubmoduleSection section = sectionsToReturn.get(id);
+ for (Map.Entry<String, SubmoduleSection> entry : sectionsToReturn.entrySet()) {
+ String id = entry.getKey();
+ final SubmoduleSection section = entry.getValue();
expect(bbc.getString("submodule", id, "url")).andReturn(section.getUrl());
expect(bbc.getString("submodule", id, "path")).andReturn(
section.getPath());
diff --git a/gerrit-war/src/main/java/com/google/gerrit/httpd/SiteInitializer.java b/gerrit-war/src/main/java/com/google/gerrit/httpd/SiteInitializer.java
index 0948c46..0a9386d 100644
--- a/gerrit-war/src/main/java/com/google/gerrit/httpd/SiteInitializer.java
+++ b/gerrit-war/src/main/java/com/google/gerrit/httpd/SiteInitializer.java
@@ -23,13 +23,14 @@
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
+import java.sql.Statement;
public final class SiteInitializer {
- private static final Logger log = LoggerFactory
+ private static final Logger LOG = LoggerFactory
.getLogger(SiteInitializer.class);
- final String sitePath;
- final String initPath;
+ private final String sitePath;
+ private final String initPath;
SiteInitializer(String sitePath, String initPath) {
this.sitePath = sitePath;
@@ -38,10 +39,9 @@
public void init() {
try {
-
if (sitePath != null) {
File site = new File(sitePath);
- log.info(String.format("Initializing site at %s",
+ LOG.info(String.format("Initializing site at %s",
site.getAbsolutePath()));
new BaseInit(site, false).run();
return;
@@ -53,9 +53,8 @@
if (site == null && initPath != null) {
site = new File(initPath);
}
-
if (site != null) {
- log.info(String.format("Initializing site at %s",
+ LOG.info(String.format("Initializing site at %s",
site.getAbsolutePath()));
new BaseInit(site, new ReviewDbDataSourceProvider(), false).run();
}
@@ -63,7 +62,7 @@
conn.close();
}
} catch (Exception e) {
- log.error("Site init failed", e);
+ LOG.error("Site init failed", e);
throw new RuntimeException(e);
}
}
@@ -74,10 +73,14 @@
private File getSiteFromReviewDb(Connection conn) {
try {
- ResultSet rs = conn.createStatement().executeQuery(
- "select site_path from system_config");
- if (rs.next()) {
- return new File(rs.getString(1));
+ Statement stmt = conn.createStatement();
+ try {
+ ResultSet rs = stmt.executeQuery("SELECT site_path FROM system_config");
+ if (rs.next()) {
+ return new File(rs.getString(1));
+ }
+ } finally {
+ stmt.close();
}
return null;
} catch (SQLException e) {
diff --git a/lib/BUCK b/lib/BUCK
index ade5e95..c9549b3 100644
--- a/lib/BUCK
+++ b/lib/BUCK
@@ -106,8 +106,8 @@
maven_jar(
name = 'jsch',
- id = 'com.jcraft:jsch:0.1.44-1',
- sha1 = '2e9ae08de5a71bd0e0d3ba2558598181bfa71d4e',
+ id = 'com.jcraft:jsch:0.1.50',
+ sha1 = 'fae4a0b1f2a96cb8f58f38da2650814c991cea01',
license = 'jsch',
)
diff --git a/lib/gwt/compiler.py b/lib/gwt/compiler.py
index 32fd91c..f7b478c 100755
--- a/lib/gwt/compiler.py
+++ b/lib/gwt/compiler.py
@@ -54,8 +54,12 @@
'-localWorkers', str(cpu_count()),
] + opt + [module]
-gwt = Popen(cmd, stdout = PIPE, stderr = PIPE)
-out, err = gwt.communicate()
-if gwt.returncode != 0:
- print(out + err, file=stderr)
- exit(gwt.returncode)
+try:
+ gwt = Popen(cmd, stdout=PIPE, stderr=PIPE)
+ out, err = gwt.communicate()
+ if gwt.returncode != 0:
+ print(out + err, file=stderr)
+ exit(gwt.returncode)
+except KeyboardInterrupt:
+ print("Interrupted by user", file=stderr)
+ exit(1)
diff --git a/lib/jgit/BUCK b/lib/jgit/BUCK
index 9f8a5c9..3e481bf 100644
--- a/lib/jgit/BUCK
+++ b/lib/jgit/BUCK
@@ -10,6 +10,7 @@
src_sha1 = 'b4e3d9c9c3da39b72acf72bd913ce9dbee88a9d4',
license = 'jgit',
repository = REPO,
+ unsign = True,
deps = [':ewah'],
exclude = [
'META-INF/eclipse.inf',
diff --git a/lib/maven.defs b/lib/maven.defs
index d49fed6..54840e8 100644
--- a/lib/maven.defs
+++ b/lib/maven.defs
@@ -33,6 +33,7 @@
license,
exclude = [],
exclude_java_sources = False,
+ unsign = False,
deps = [],
sha1 = '', bin_sha1 = '', src_sha1 = '',
repository = MAVEN_CENTRAL,
@@ -73,6 +74,8 @@
cmd.extend(['-x', x])
if exclude_java_sources:
cmd.append('--exclude_java_sources')
+ if unsign:
+ cmd.append('--unsign')
genrule(
name = name + '__download_bin',
diff --git a/plugins/cookbook-plugin b/plugins/cookbook-plugin
index 9fa9da1..1b1aca1 160000
--- a/plugins/cookbook-plugin
+++ b/plugins/cookbook-plugin
@@ -1 +1 @@
-Subproject commit 9fa9da18e4d5c6befc87f2d1f1baec07e2d2b51e
+Subproject commit 1b1aca1dd61c033840bc465fa8646c22f5467f3a
diff --git a/plugins/download-commands b/plugins/download-commands
index 32254d3..fe2bc6b 160000
--- a/plugins/download-commands
+++ b/plugins/download-commands
@@ -1 +1 @@
-Subproject commit 32254d3b75d65aceb485950fbf30d464574e02fc
+Subproject commit fe2bc6be5ef964a5df247a85f82c0155dc2f8876
diff --git a/tools/download_file.py b/tools/download_file.py
index 2fcce3f..8d76a40 100755
--- a/tools/download_file.py
+++ b/tools/download_file.py
@@ -109,6 +109,7 @@
opts.add_option('-v', help='expected content SHA-1')
opts.add_option('-x', action='append', help='file to delete from ZIP')
opts.add_option('--exclude_java_sources', action='store_true')
+opts.add_option('--unsign', action='store_true')
args, _ = opts.parse_args()
root_dir = args.o
@@ -166,7 +167,22 @@
finally:
zf.close()
except (BadZipfile, LargeZipFile) as err:
- print("error opening %s: %s" % (cache_ent, err), file=stderr)
+ print('error opening %s: %s' % (cache_ent, err), file=stderr)
+ exit(1)
+
+if args.unsign:
+ try:
+ zf = ZipFile(cache_ent, 'r')
+ try:
+ for n in zf.namelist():
+ if (n.endswith('.RSA')
+ or n.endswith('.SF')
+ or n.endswith('.LIST')):
+ exclude.append(n)
+ finally:
+ zf.close()
+ except (BadZipfile, LargeZipFile) as err:
+ print('error opening %s: %s' % (cache_ent, err), file=stderr)
exit(1)
safe_mkdirs(path.dirname(args.o))
@@ -174,7 +190,7 @@
try:
shutil.copyfile(cache_ent, args.o)
except (shutil.Error, IOError) as err:
- print("error copying to %s: %s" % (args.o, err), file=stderr)
+ print('error copying to %s: %s' % (args.o, err), file=stderr)
exit(1)
try:
check_call(['zip', '-d', args.o] + exclude)
@@ -188,5 +204,5 @@
try:
shutil.copyfile(cache_ent, args.o)
except (shutil.Error, IOError) as err:
- print("error copying to %s: %s" % (args.o, err), file=stderr)
+ print('error copying to %s: %s' % (args.o, err), file=stderr)
exit(1)
diff --git a/tools/eclipse/BUCK b/tools/eclipse/BUCK
index 264e4eb..0469bf49 100644
--- a/tools/eclipse/BUCK
+++ b/tools/eclipse/BUCK
@@ -9,6 +9,7 @@
'//gerrit-gwtui:ui_tests',
'//gerrit-httpd:httpd_tests',
'//gerrit-main:main_lib',
+ '//gerrit-patch-jgit:jgit_patch_tests',
'//gerrit-server:server__compile',
'//lib/asciidoctor:asciidoc_lib',
'//lib/asciidoctor:doc_indexer_lib',