Merge branch 'stable-2.5'

* stable-2.5:
  Create ref for patch set that is created when a change is cherry-picked
  Add missing mail template examples to site init
  Fix: Projects created outside of Gerrit could not be cloned.
  Remove red background for outdated dependency after rebase
  Don't remove dashes from approval category name.
  Add `--is-draft` argument on patchset-created hook
  Add change topic in hook arguments
  Update the Gerrit 2.5 release notes for rc1
diff --git a/ReleaseNotes/ReleaseNotes-2.5.txt b/ReleaseNotes/ReleaseNotes-2.5.txt
index 53369b0..8cb8e11 100644
--- a/ReleaseNotes/ReleaseNotes-2.5.txt
+++ b/ReleaseNotes/ReleaseNotes-2.5.txt
@@ -230,6 +230,10 @@
 * link:../Documentation/dev-plugins.html#getting-started[Maven
   archetype for creating gerrit plugin projects]
 
+* Enables the use of session management in Jetty
++
+This enables plugins to make use of servlet sessions.
+
 REST API
 ~~~~~~~~
 Gerrit now supports a REST like API available over HTTP. The API is
@@ -529,6 +533,9 @@
 This allows to see the branches of the `All-Projects` project in the
 web UI.
 
+* Show for each project in the project list a link to the repository
+  browser (e.g. GitWeb).
+
 * Move the project listing menu items to a new top-level item
 +
 Finding the project listing was very opaque to end users. Nobody
@@ -651,6 +658,9 @@
   link:../Documentation/cmd-set-account.html[SSH command to manage
   accounts]
 
+* On link:../Documentation/cmd-create-account.html[account creation] a
+  password for HTTP can be specified.
+
 * link:../Documentation/cmd-set-project.html[SSH command to manage
   project settings]
 
@@ -748,6 +758,10 @@
 author ...` were replaced with `invalid author` and `invalid
 committer`.
 
+* Describe that the `prohibited by Gerrit` error is returned if pushing
+  a tag fails because the tagger is somebody else and the `Forge
+  Committer` access right is not assigned.
+
 Dev
 ^^^
 
@@ -784,6 +798,12 @@
 
 Other
 ^^^^^
+* Add link:../Documentation/prolog-cookbook.html[Cookbook for Prolog
+  submit rules]
++
+A new document providing a step by step introduction into implementing
+specific submit policies using Prolog based submit rules was added.
+
 * Describe link:../Documentation/refs-notes-review.html[
   `refs/notes/review` and its contents]
 
@@ -1007,6 +1027,15 @@
 
 * Abstract group systems into GroupBackend interface
 
+* link:https://code.google.com/p/gerrit/issues/detail?id=548[issue 548]:
+  Make commands to download patch sets
+  link:../Documentation/config-gerrit.html#download.command[configurable]
++
+For patch sets on the ChangeScreen different commands for downloading
+the patch sets are offered. For some installations not all commands are
+needed. Allow Gerrit administrators to configure which download
+commands should be offered.
+
 * Add more link:../Documentation/config-gerrit.html#theme[theme color
   options]
 +
@@ -1399,6 +1428,19 @@
 in the "Depends On" and "Needed By" lists for all users, and when there
 was no user logged in.
 
+* link:http://code.google.com/p/gerrit/issues/detail?id=1558[issue 1558]:
+  Create a draft patch set when a draft patch set is rebased
++
+Rebasing a draft patch set created a non-draft patch set. It was
+unexpected that rebasing a draft patch set published the modifications
+done in the draft patch set.
+
+* link:http://code.google.com/p/gerrit/issues/detail?id=1176[issue 1176]:
+  Fix disappearance of download command in Firefox
++
+Clicking on the download command for a patch set in Firefox made the
+download command disappear.
+
 * Fix disappearance of action buttons when selecting the last patch set
 as `Old Version History`
 
@@ -1423,7 +1465,15 @@
 correct data and return it. When this happens don't NPE, just
 claim the change is not reviewed.
 
-* Fix displaying of comments on deleted files
+* link:https://code.google.com/p/gerrit/issues/detail?id=1555[issue 1555]:
+  Fix displaying of file diff if draft patch has been deleted
++
+Displaying any file diff for a patch set failed if the change had any
+gaps in its patch set history. Patch sets can be missing, if they
+have been drafts and were deleted.
+
+* link:https://code.google.com/p/gerrit/issues/detail?id=856[issue 856]:
+  Fix displaying of comments on deleted files
 +
 Published and draft comments that are posted on deleted files were not
 loaded and displayed.
@@ -1519,6 +1569,22 @@
 access rights. Go back to the old message that says "prohibited
 by Gerrit".
 
+* Fix reject message if pushing tag is rejected because tagger is
+  somebody else
++
+Pushing a tag that has somebody else as tagger requires the `Forge
+Committer` access right. If this access right was missing Gerrit
+was rejecting the push with "can not create new references". This error
+message was misleading because the user may have thought that the
+`Create Reference` access right was missing which was actually assigned.
++
+The same reject message was also returned on push of an annotated tag
+if the `Push Annotated Tag` access right was missing. Also in this case
+the error message was not ideal.
++
+Go back to the old more generic message which says `prohibited by
+Gerrit`.
+
 * link:http://code.google.com/p/gerrit/issues/detail?id=1437[issue 1437]:
   Send event to stream when draft change is published
 +
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeTable.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeTable.java
index 0d6820d..ef4ef52 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeTable.java
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeTable.java
@@ -208,6 +208,7 @@
       s += " (" + c.getStatus().name() + ")";
     }
     if (changeRowFormatter != null) {
+      removeChangeStyle(row, changeRowFormatter);
       final String rowStyle = changeRowFormatter.getRowStyle(c);
       if (rowStyle != null) {
         table.getRowFormatter().addStyleName(row, rowStyle);
@@ -226,6 +227,19 @@
     setRowItem(row, c);
   }
 
+  private void removeChangeStyle(int row,
+      final ChangeRowFormatter changeRowFormatter) {
+    final ChangeInfo oldChange = getRowItem(row);
+    if (oldChange == null) {
+      return;
+    }
+
+    final String oldRowStyle = changeRowFormatter.getRowStyle(oldChange);
+    if (oldRowStyle != null) {
+      table.getRowFormatter().removeStyleName(row, oldRowStyle);
+    }
+  }
+
   private AccountLink link(final Account.Id id) {
     return AccountLink.link(accountCache, id);
   }
diff --git a/gerrit-reviewdb/src/main/java/com/google/gerrit/reviewdb/client/ApprovalCategory.java b/gerrit-reviewdb/src/main/java/com/google/gerrit/reviewdb/client/ApprovalCategory.java
index bb25265..7d61975 100644
--- a/gerrit-reviewdb/src/main/java/com/google/gerrit/reviewdb/client/ApprovalCategory.java
+++ b/gerrit-reviewdb/src/main/java/com/google/gerrit/reviewdb/client/ApprovalCategory.java
@@ -105,7 +105,8 @@
         char c = name.charAt(i);
         if (('0' <= c && c <= '9') //
             || ('a' <= c && c <= 'z') //
-            || ('A' <= c && c <= 'Z')) {
+            || ('A' <= c && c <= 'Z') //
+            || (c == '-')) {
           r.append(c);
         } else if (c == ' ') {
           r.append('-');
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/git/MergeOp.java b/gerrit-server/src/main/java/com/google/gerrit/server/git/MergeOp.java
index 5b78c7b..26fd2ea 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/git/MergeOp.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/git/MergeOp.java
@@ -976,6 +976,17 @@
       }
     }
 
+    final RefUpdate ru = repo.updateRef(ps.getRefName());
+    ru.setExpectedOldObjectId(ObjectId.zeroId());
+    ru.setNewObjectId(newCommit);
+    ru.disableRefLog();
+    if (ru.update(rw) != RefUpdate.Result.NEW) {
+      throw new IOException(String.format(
+          "Failed to create ref %s in %s: %s", ps.getRefName(),
+          n.change.getDest().getParentKey().get(), ru.getResult()));
+    }
+    replication.fire(n.change.getProject(), ru.getName());
+
     newCommit.copyFrom(n);
     newCommit.statusCode = CommitMergeStatus.CLEAN_PICK;
     commits.put(newCommit.patchsetId.getParentKey(), newCommit);