Improve the error message shown when cherry pick from the UI fails

If the cherry pick fails, the error message is:

  Could not create a merge commit during the cherry pick

This is confusing for users.  Replace it with a simpler message:

  Cherry pick failed

Also correct a minor grammatical error in one of the other cherry
pick related messages.

Change-Id: I8d6d2cbfd59432da7012e2d8845993d7afe50719
Keep status:closed's limit below MySQL Connector/J's hard limit

Since MySQL Connector/J 5.1.21 does not allow limits above 50M rows
and aborts them with

  java.sql.SQLException: setMaxRows() out of range. 2147483647 > 50000000.

we cannot use MAX_VALUE as limit for plain "status:closed" queries. As
50M seems big enough for general use anyways, we use the 50M limit.

Bug: 2392
Change-Id: I70d3446b3fd3a140f7cdd0591803bec5df050484
Split auth check from parsing/adding SSH key

This allows to reuse the code for parsing/adding an SSH key with a
different permission check (e.g. in a plugin).

Change-Id: Ib554c63cab9c039a3a67ff70b4583c353cef10e2
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
Inject Provider<IdentifiedUser> into CreateAccount

Injecting Provider<IdentifiedUser> instead of IdentifiedUser allows to
use CreateAccount in a non request scope context where a current user
is not available. The IdentifiedUser in CreateAccount is not always
needed but only if groups are specified in the input.

Change-Id: I9f455faf8aaee5a8d61f284d758f52dde3b8c8a3
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
Move PostInput from ApprovalTable to Reviewers class

ApprovalTable class is going to be removed with old change screen.
Move the parts we still need for them to stay.

Change-Id: Ia2e4bf7ee09afbe98b41157f39d6f4141fe55788
Automatically link from plugin list screen to plugin settings screens

If a plugin implements a screen for administrating its settings that
is available under "#/x/<plugin-name>/settings" it is automatically
linked from the plugin list screen.

This avoids that each plugin has to register an own menu entry for its
settings screen.

Change-Id: I6d76f5286c936fd412572e484ee45edeb176a98e
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
Merge "Automatically link from plugin list screen to plugin settings screens"
Merge "Move PostInput from ApprovalTable to Reviewers class"
Merge "Keep status:closed's limit below MySQL Connector/J's hard limit" into stable-2.8
Merge branch 'stable-2.8'

* stable-2.8:
  Keep status:closed's limit below MySQL Connector/J's hard limit
  Improve the error message shown when cherry pick from the UI fails

Conflicts:
	gerrit-server/src/main/java/com/google/gerrit/server/query/change/SqlRewriterImpl.java

Change-Id: Ie9c7ab627d1fdda1e6f41e008653952657906482
Merge "Inject Provider<IdentifiedUser> into CreateAccount"
Add newline on commit messages cherry-picked from UI and REST API

If a commit is cherry-picked from the UI or via the REST API, the
trailing newline on the end of the commit message gets lost.

This means that when a commit is cherry picked in the UI, and the
"(cherry picked from commit ...)" line is added, if the resulting
commit is then cherry-picked again from the command line with `-x`,
the next "(cherry picked from commit ...)" line gets appended on
to the end of the line, rather than on a new line.

Make sure a trailing newline is always added on the end of the
commit message of cherry pick commits.

Change-Id: If1102458658dc194034111cbd65b937478002bf1
Merge "Split auth check from parsing/adding SSH key"
Fix IllegalArgumentException when running query with limit:0

Running the query:

  ssh -p 29418 user@review gerrit query status:open limit:0

Causes an exception:

  java.lang.IllegalArgumentException: numHits must be > 0;
  please use TotalHitCountCollector if you just need the total
  hit count

  at org.apache.lucene.search.TopFieldCollector.create(TopFieldCollector.java:1120)

And this results in the query returning "Internal server error".

Add a check to ensure that the limit is always > 0.

Change-Id: I92260c6d6431c7950909c8a8ffceada7e9f690a4
Merge "Add newline on commit messages cherry-picked from UI and REST API" into stable-2.8
Merge branch 'stable-2.8'

* stable-2.8:
  Fix IllegalArgumentException when running query with limit:0
  Add newline on commit messages cherry-picked from UI and REST API