Merge changes from topic 'notedb-diff-fixes'

* changes:
  ChangeRebuilderImpl: Ensure first event creates change
  BatchUpdate: Prevent lastUpdatedOn from going backwards
  TestNotesMigration: Always set values in setFromEnv
  ChangeBundle: Handle empty topic on the ReviewDb side
  ChangeBundle: Ignore null originalSubject in ReviewDb changes
  NoteDb: Fix conversion of PatchSet.pushCertificate field
diff --git a/Documentation/BUCK b/Documentation/BUCK
index 62c0e07..ea95063 100644
--- a/Documentation/BUCK
+++ b/Documentation/BUCK
@@ -49,13 +49,6 @@
   out = 'js_licenses.txt',
 )
 
-genrule(
-  name = 'doc.css',
-  srcs = ['doc.css.in'],
-  cmd = 'cp $SRCS $OUT',
-  out = 'doc.css',
-)
-
 python_binary(
   name = 'gen_licenses',
   main = 'gen_licenses.py',
diff --git a/Documentation/asciidoc.defs b/Documentation/asciidoc.defs
index 2caf725..1cf0790 100644
--- a/Documentation/asciidoc.defs
+++ b/Documentation/asciidoc.defs
@@ -35,7 +35,7 @@
   for attribute in attributes:
     asciidoc.extend(['-a', attribute])
   asciidoc.append('$SRCS')
-  newsrcs = [":doc.css"]
+  newsrcs = []
   for src in srcs:
     fn = src
     # We have two cases: regular source files and generated files.
@@ -59,8 +59,6 @@
       out = ex,
     )
 
-    # The new AsciiDoctor requires both the css file and include files are under
-    # the same directory. Luckily Buck allows us to use :target as SRCS now.
     newsrcs.append(':%s' % ex)
 
   genrule(
@@ -105,7 +103,6 @@
         'images/*.jpg',
         'images/*.png',
       ]) + [
-        ':doc.css',
         '//gerrit-prettify:prettify.min.css',
         '//gerrit-prettify:prettify.min.js',
       ],
diff --git a/Documentation/config.defs b/Documentation/config.defs
index 380080f..7f814d3 100644
--- a/Documentation/config.defs
+++ b/Documentation/config.defs
@@ -15,7 +15,7 @@
     'tilde="~"',
     'last-update-label!',
     'source-highlighter=prettify',
-    'stylesheet=doc.css',
+    'stylesheet=DEFAULT',
     'linkcss=true',
     'prettifydir=.',
     'revnumber="%s"' % revision,
diff --git a/Documentation/doc.css.in b/Documentation/doc.css.in
deleted file mode 100644
index e09e426..0000000
--- a/Documentation/doc.css.in
+++ /dev/null
@@ -1,80 +0,0 @@
-body {
-  margin: 1em auto;
-  width: 900px;
-}
-
-#toctitle {
-  margin-top: 0.5em;
-  font-weight: bold;
-}
-
-h1, h2, h3, h4, h5, h6, #toctitle {
-  color: #527bbd;
-  font-family: sans-serif;
-}
-
-h1, h2, h3 {
-  border-bottom: 2px solid silver;
-}
-
-h1 {
-  margin-top: 1.5em;
-}
-
-p {
-  margin: 0.5em 0 0.5em 0;
-}
-li p {
-  margin: 0.2em 0 0.2em 0;
-}
-
-#license > .content,
-.listingblock > .content {
-  border: 2px solid silver;
-  background: #ebebeb;
-  color: darkgreen;
-  padding: 2px;
-  overflow: auto;
-}
-
-#license > .content pre,
-.listingblock > .content pre {
-  background: none;
-  border: 0 solid silver;
-  padding: 0 0 0 0;
-}
-
-dl dt {
-  margin-top: 1em;
-}
-
-table.tableblock {
-  border-collapse: collapse;
-}
-
-table.tableblock,
-th.tableblock,
-td.tableblock {
-  border: 1px solid #EEE;
-}
-
-div.title {
-  color: #527bbd;
-  font-family: Arial,Helvetica,sans-serif;
-  font-weight: bold;
-  text-align: left;
-}
-
-.listingblock div.title {
-  margin-top: 1.0em;
-  margin-bottom: 0.5em;
-}
-
-div.admonitionblock {
-  margin-top: 1em;
-}
-
-div.admonitionblock td.content {
-  padding-left: 0.5em;
-  border-left: 3px solid #dddddd;
-}
diff --git a/Documentation/replace_macros.py b/Documentation/replace_macros.py
index fec4a58..0930572 100755
--- a/Documentation/replace_macros.py
+++ b/Documentation/replace_macros.py
@@ -60,9 +60,32 @@
 SEARCH_BOX = """
 
 ++++
-<div style="position:absolute; right:20px; top:20px;">
-<input type="text" id="docSearch" size="70" />
-<button type="button" id="searchBox">Search</button>
+<div style="
+  position:fixed;
+  top:0px;
+  right:0px;
+  text-align:
+  right;
+  padding-top:2px;
+  padding-right:0.5em;
+  padding-bottom:2px;">
+<input size="40"
+  style="line-height: 0.75em;font-size: 0.75em;"
+  id="docSearch"
+  type="text">
+<button style="
+  background:none!important;
+  border:none;
+  padding:0!important;
+  vertical-align:bottom;
+  font-family:'Open Sans','DejaVu Sans',sans-serif;
+  font-size:0.8em;
+  color:#1d4b8f;
+  text-decoration:none;"
+  type="button"
+  id="searchBox">
+  Search
+</button>
 <script type="text/javascript">
 var f = function() {
   window.location = '../#/Documentation/' +
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 4440219..dc3ff6e 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
@@ -1212,7 +1212,6 @@
       //TODO(dpursehouse): validate hashtags
     }
 
-    @Inject
     MagicBranchInput(ReceiveCommand cmd, LabelTypes labelTypes,
         NotesMigration notesMigration) {
       this.cmd = cmd;
diff --git a/lib/asciidoctor/java/AsciiDoctor.java b/lib/asciidoctor/java/AsciiDoctor.java
index 4b9ba37..667f274 100644
--- a/lib/asciidoctor/java/AsciiDoctor.java
+++ b/lib/asciidoctor/java/AsciiDoctor.java
@@ -28,6 +28,7 @@
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
+import java.io.FilenameFilter;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -148,6 +149,15 @@
         renderInput(options, new File(inputFile));
         zipFile(out, outName, zip);
       }
+
+      File[] cssFiles = tmpdir.listFiles(new FilenameFilter() {
+        public boolean accept(File dir, String name) {
+          return name.endsWith(".css");
+        }
+      });
+      for (File css : cssFiles) {
+        zipFile(css, css.getName(), zip);
+      }
     }
   }