Merge "Enable disabled gwtui tests"
diff --git a/ReleaseNotes/ReleaseNotes-2.8.2.txt b/ReleaseNotes/ReleaseNotes-2.8.2.txt
index 9b72a77..bf21946 100644
--- a/ReleaseNotes/ReleaseNotes-2.8.2.txt
+++ b/ReleaseNotes/ReleaseNotes-2.8.2.txt
@@ -30,7 +30,18 @@
 * Only add "cherry picked from" when cherry picking a merged change.
 +
 The "(cherry picked from commit ...)" line was being added in the commit
-message when cherry picking from closed changes, which included abandoned.
+message when cherry picking from closed changes, which included those that were
+abandoned.
+
+* link:https://code.google.com/p/gerrit/issues/detail?id=2513[Issue 2513]:
+Improve the "This patchset was cherry picked" message.
++
+When cherry-picking a change, the message "This patchset was cherry picked to
+change: <Change-Id>" was added as a message on the change.  This was not very
+useful as the Change-Id is the same on the newly created change.
++
+The message is changed to "This patchset was cherry picked to branch <branch
+name> as commit <SHA1>".
 
 * Fix PUSH permission check for draft changes.
 +
@@ -107,6 +118,12 @@
 plugins to display the wrong vendor information if they had dependency on
 another JAR file that provided a `Implementation-Vendor` value.
 
+* link:https://code.google.com/p/gerrit/issues/detail?id=2498[Issue 2498]:
+Handle null commits when updating submodules.
++
+In some edge cases it was possible that a null commit would exist, and this
+caused a crash when updating submodules.
+
 * Remove dependency on joda time library in gerrit launcher.
 +
 The joda time library was being unnecessarily packaged in the root of
@@ -188,6 +205,19 @@
 of the `patchset-created` event was incorrectly set to the original
 change uploader, rather than the user that performed the rebase.
 
+* Display a warning instead of an error when the intraline diff times out.
++
+Displaying an error was confusing for users and administrators.
+
+* link:https://code.google.com/p/gerrit/issues/detail?id=2514[Issue 2514]:
+Display an error message when commentlink regex is invalid.
++
+If a commentlink was configured with an invalid regular expression, for example
+an expression that is valid in Java but not in JavaScript, the change screen
+failed to load.
++
+Now, an error message will be displayed in the UI.
+
 ssh
 ---
 
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/projects/ConfigInfo.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/projects/ConfigInfo.java
index 5c88655..1d6e6b2 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/projects/ConfigInfo.java
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/projects/ConfigInfo.java
@@ -14,6 +14,7 @@
 
 package com.google.gerrit.client.projects;
 
+import com.google.gerrit.client.ErrorDialog;
 import com.google.gerrit.client.actions.ActionInfo;
 import com.google.gerrit.client.rpc.NativeMap;
 import com.google.gerrit.reviewdb.client.Project;
@@ -87,7 +88,16 @@
       if (cl.link() != null) {
         commentLinks.add(new LinkFindReplace(cl.match(), cl.link()));
       } else {
-        commentLinks.add(new RawFindReplace(cl.match(), cl.html()));
+        try {
+          FindReplace fr = new RawFindReplace(cl.match(), cl.html());
+          commentLinks.add(fr);
+        } catch (RuntimeException e) {
+          int index = e.getMessage().indexOf("at Object");
+          new ErrorDialog("Invalid commentlink configuration: "
+              + (index == -1
+              ? e.getMessage()
+              : e.getMessage().substring(0, index))).center();
+        }
       }
     }
     return commentLinks;
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/change/CherryPickChange.java b/gerrit-server/src/main/java/com/google/gerrit/server/change/CherryPickChange.java
index 45e57fa..3f9d472 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/change/CherryPickChange.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/change/CherryPickChange.java
@@ -244,23 +244,28 @@
           change.getDest().getParentKey().get(), ru.getResult()));
     }
 
-    ins.setMessage(buildChangeMessage(patchSetId, change)).insert();
+    ins.setMessage(buildChangeMessage(patchSetId, change, cherryPickCommit))
+        .insert();
 
     return change.getId();
   }
 
-  private ChangeMessage buildChangeMessage(PatchSet.Id patchSetId, Change dest)
-      throws OrmException {
+  private ChangeMessage buildChangeMessage(PatchSet.Id patchSetId, Change dest,
+      RevCommit cherryPickCommit) throws OrmException {
     ChangeMessage cmsg = new ChangeMessage(
         new ChangeMessage.Key(
             patchSetId.getParentKey(), ChangeUtil.messageUUID(db)),
         currentUser.getAccountId(), TimeUtil.nowTs(), patchSetId);
-    StringBuilder msgBuf = new StringBuilder();
-    msgBuf.append("Patch Set ").append(patchSetId.get())
-          .append(": Cherry Picked");
-    msgBuf.append("\n\n");
-    msgBuf.append("This patchset was cherry picked to change: ")
-          .append(dest.getKey().get());
+    String destBranchName = dest.getDest().get();
+    StringBuilder msgBuf = new StringBuilder("Patch Set ")
+        .append(patchSetId.get())
+        .append(": Cherry Picked")
+        .append("\n\n")
+        .append("This patchset was cherry picked to branch ")
+        .append(destBranchName.substring(
+            destBranchName.indexOf("refs/heads/") + "refs/heads/".length()))
+        .append(" as commit ")
+        .append(cherryPickCommit.getId().getName());
     cmsg.setMessage(msgBuf.toString());
     return cmsg;
   }
diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/PluginReloadCommand.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/PluginReloadCommand.java
index 8449160..4157515 100644
--- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/PluginReloadCommand.java
+++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/PluginReloadCommand.java
@@ -41,6 +41,9 @@
 
   @Override
   protected void run() throws UnloggedFailure {
+    if (!loader.isRemoteAdminEnabled()) {
+      throw die("remote plugin administration is disabled");
+    }
     if (names == null || names.isEmpty()) {
       loader.rescan();
     } else {