Merge "Modify app/BUILD: bower_components to fetch map files too"
diff --git a/Documentation/config-gerrit.txt b/Documentation/config-gerrit.txt
index f64d693..aa45329 100644
--- a/Documentation/config-gerrit.txt
+++ b/Documentation/config-gerrit.txt
@@ -1145,42 +1145,23 @@
[[change]]
=== Section change
-[[change.largeChange]]change.largeChange::
-+
-Number of changed lines from which on a change is considered as a large
-change. The number of changed lines of a change is the sum of the lines
-that were inserted and deleted in the change.
-+
-The specified value is used to visualize the change sizes in the Web UI
-in change tables and user dashboards.
-+
-By default 500.
-
-[[change.updateDelay]]change.updateDelay::
-+
-How often in seconds the web interface should poll for updates to the
-currently open change. The poller relies on the client's browser
-cache to use If-Modified-Since and respect `304 Not Modified` HTTP
-responses. This allows for fast polls, often under 8 milliseconds.
-+
-With a configured 30 second delay a server with 4900 active users will
-typically need to dedicate 1 CPU to the update check. 4900 users
-divided by an average delay of 30 seconds is 163 requests arriving per
-second. If requests are served at \~6 ms response time, 1 CPU is
-necessary to keep up with the update request traffic. On a smaller
-user base of 500 active users, the default 30 second delay is only 17
-requests per second and requires ~10% CPU.
-+
-If 0 the update polling is disabled.
-+
-Default is 5 minutes.
-
[[change.allowBlame]]change.allowBlame::
+
Allow blame on side by side diff. If set to false, blame cannot be used.
+
Default is true.
+[[change.allowDrafts]]change.allowDrafts::
++
+Legacy support for drafts workflow. If set to true, pushing a new change
+with draft option will create a private change. Pushing with draft option
+to an existing change will create change edit.
++
+Enabling this option allows to push to the `refs/drafts/branch`. When
+disabled any push to `refs/drafts/branch` will be rejected.
++
+Default is false.
+
[[change.api.allowedIdentifier]]change.api.allowedIdentifier::
+
Change identifier(s) that are allowed on the API. See
@@ -1193,14 +1174,12 @@
+
Default is `ALL`.
-[[change.allowDrafts]]change.allowDrafts::
+[[change.api.excludeMergeableInChangeInfo]]change.api.excludeMergeableInChangeInfo::
+
-Legacy support for drafts workflow. If set to true, pushing a new change
-with draft option will create a private change. Pushing with draft option
-to an existing change will create change edit.
-+
-Enabling this option allows to push to the `refs/drafts/branch`. When
-disabled any push to `refs/drafts/branch` will be rejected.
+If true, the mergeability bit in
+link:rest-api-changes.html#change-info[ChangeInfo] will never be set. It can
+be requested separately through the
+link:rest-api-changes.html#get-mergeable[get-mergeable] endpoint.
+
Default is false.
@@ -1219,14 +1198,47 @@
+
Default is true.
-[[change.api.excludeMergeableInChangeInfo]]change.api.excludeMergeableInChangeInfo::
+[[change.disablePrivateChanges]]change.disablePrivateChanges::
+
-If true, the mergeability bit in
-link:rest-api-changes.html#change-info[ChangeInfo] will never be set. It can
-be requested separately through the
-link:rest-api-changes.html#get-mergeable[get-mergeable] endpoint.
+If set to true, users are not allowed to create private changes.
+
-Default is false.
+The default is false.
+
+[[change.largeChange]]change.largeChange::
++
+Number of changed lines from which on a change is considered as a large
+change. The number of changed lines of a change is the sum of the lines
+that were inserted and deleted in the change.
++
+The specified value is used to visualize the change sizes in the Web UI
+in change tables and user dashboards.
++
+By default 500.
+
+[[change.replyLabel]]change.replyLabel::
++
+Label name for the reply button. In the user interface an ellipsis (…)
+is appended.
++
+Default is "Reply". In the user interface it becomes "Reply…".
+
+[[change.replyTooltip]]change.replyTooltip::
++
+Tooltip for the reply button. In the user interface a note about the
+keyboard shortcut is appended.
++
+Default is "Reply and score". In the user interface it becomes "Reply
+and score (Shortcut: a)".
+
+[[change.robotCommentSizeLimit]]change.robotCommentSizeLimit::
++
+Maximum allowed size of a robot comment that will be accepted. Robot comments
+which exceed the indicated size will be rejected on addition. The specified
+value is interpreted as the maximum size in bytes of the JSON representation of
+the robot comment. Common unit suffixes of 'k', 'm', or 'g' are supported.
+Zero or negative values allow robot comments of unlimited size.
++
+The default limit is 1024kB.
[[change.showAssigneeInChangesTable]]change.showAssigneeInChangesTable::
+
@@ -1235,6 +1247,14 @@
+
Default is false.
+[[change.strictLabels]]change.strictLabels::
++
+Reject invalid label votes: invalid labels or invalid values. This
+configuration option is provided for backwards compaitbility and may
+be removed in future gerrit versions.
++
+Default is false.
+
[[change.submitLabel]]change.submitLabel::
+
Label name for the submit button.
@@ -1268,13 +1288,6 @@
Default is "Submit all ${topicSize} changes of the same topic (${submitSize}
changes including ancestors and other changes related by topic)".
-[[change.submitWholeTopic]]change.submitWholeTopic::
-+
-Determines if the submit button submits the whole topic instead of
-just the current change.
-+
-Default is false.
-
[[change.submitTopicLabel]]change.submitTopicLabel::
+
If `change.submitWholeTopic` is set and a change has a topic,
@@ -1295,44 +1308,31 @@
(${submitSize} changes including ancestors and other
changes related by topic)".
-[[change.replyLabel]]change.replyLabel::
+[[change.submitWholeTopic]]change.submitWholeTopic::
+
-Label name for the reply button. In the user interface an ellipsis (…)
-is appended.
-+
-Default is "Reply". In the user interface it becomes "Reply…".
-
-[[change.replyTooltip]]change.replyTooltip::
-+
-Tooltip for the reply button. In the user interface a note about the
-keyboard shortcut is appended.
-+
-Default is "Reply and score". In the user interface it becomes "Reply
-and score (Shortcut: a)".
-
-[[change.robotCommentSizeLimit]]change.robotCommentSizeLimit::
-+
-Maximum allowed size of a robot comment that will be accepted. Robot comments
-which exceed the indicated size will be rejected on addition. The specified
-value is interpreted as the maximum size in bytes of the JSON representation of
-the robot comment. Common unit suffixes of 'k', 'm', or 'g' are supported.
-Zero or negative values allow robot comments of unlimited size.
-+
-The default limit is 1024kB.
-
-[[change.strictLabels]]change.strictLabels::
-+
-Reject invalid label votes: invalid labels or invalid values. This
-configuration option is provided for backwards compaitbility and may
-be removed in future gerrit versions.
+Determines if the submit button submits the whole topic instead of
+just the current change.
+
Default is false.
-[[change.disablePrivateChanges]]change.disablePrivateChanges::
+[[change.updateDelay]]change.updateDelay::
+
-If set to true, users are not allowed to create private changes.
+How often in seconds the web interface should poll for updates to the
+currently open change. The poller relies on the client's browser
+cache to use If-Modified-Since and respect `304 Not Modified` HTTP
+responses. This allows for fast polls, often under 8 milliseconds.
+
-The default is false.
+With a configured 30 second delay a server with 4900 active users will
+typically need to dedicate 1 CPU to the update check. 4900 users
+divided by an average delay of 30 seconds is 163 requests arriving per
+second. If requests are served at \~6 ms response time, 1 CPU is
+necessary to keep up with the update request traffic. On a smaller
+user base of 500 active users, the default 30 second delay is only 17
+requests per second and requires ~10% CPU.
++
+If 0 the update polling is disabled.
++
+Default is 5 minutes.
[[changeCleanup]]
=== Section changeCleanup
diff --git a/java/com/google/gerrit/server/notedb/ChangeUpdate.java b/java/com/google/gerrit/server/notedb/ChangeUpdate.java
index 3b8deea..ad0f8ef 100644
--- a/java/com/google/gerrit/server/notedb/ChangeUpdate.java
+++ b/java/com/google/gerrit/server/notedb/ChangeUpdate.java
@@ -49,7 +49,6 @@
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Table;
import com.google.common.collect.TreeBasedTable;
-import com.google.gerrit.common.UsedAt;
import com.google.gerrit.common.data.SubmitRecord;
import com.google.gerrit.mail.Address;
import com.google.gerrit.reviewdb.client.Account;
@@ -102,10 +101,6 @@
*/
public class ChangeUpdate extends AbstractChangeUpdate {
public interface Factory {
- @Deprecated
- @UsedAt(UsedAt.Project.GOOGLE) // TODO(dborowitz): Remove usage, then delete method.
- ChangeUpdate create(ChangeNotes notes, CurrentUser user);
-
ChangeUpdate create(ChangeNotes notes, CurrentUser user, Date when);
@VisibleForTesting
@@ -161,30 +156,6 @@
ProjectCache projectCache,
@Assisted ChangeNotes notes,
@Assisted CurrentUser user,
- ChangeNoteUtil noteUtil) {
- this(
- serverIdent,
- updateManagerFactory,
- draftUpdateFactory,
- robotCommentUpdateFactory,
- deleteCommentRewriterFactory,
- projectCache,
- notes,
- user,
- serverIdent.getWhen(),
- noteUtil);
- }
-
- @AssistedInject
- private ChangeUpdate(
- @GerritPersonIdent PersonIdent serverIdent,
- NoteDbUpdateManager.Factory updateManagerFactory,
- ChangeDraftUpdate.Factory draftUpdateFactory,
- RobotCommentUpdate.Factory robotCommentUpdateFactory,
- DeleteCommentRewriter.Factory deleteCommentRewriterFactory,
- ProjectCache projectCache,
- @Assisted ChangeNotes notes,
- @Assisted CurrentUser user,
@Assisted Date when,
ChangeNoteUtil noteUtil) {
this(
diff --git a/java/com/google/gwtorm/server/OrmDuplicateKeyException.java b/java/com/google/gwtorm/server/OrmDuplicateKeyException.java
index 24e6d8b..c2840f5 100644
--- a/java/com/google/gwtorm/server/OrmDuplicateKeyException.java
+++ b/java/com/google/gwtorm/server/OrmDuplicateKeyException.java
@@ -15,13 +15,14 @@
package com.google.gwtorm.server;
/** Indicates one or more entities were concurrently inserted with the same key. */
-@SuppressWarnings("serial")
public class OrmDuplicateKeyException extends OrmException {
- public OrmDuplicateKeyException(final String msg) {
+ private static final long serialVersionUID = 1L;
+
+ public OrmDuplicateKeyException(String msg) {
super(msg);
}
- public OrmDuplicateKeyException(final String msg, final Throwable why) {
+ public OrmDuplicateKeyException(String msg, Throwable why) {
super(msg, why);
}
}
diff --git a/java/com/google/gwtorm/server/OrmException.java b/java/com/google/gwtorm/server/OrmException.java
index 24325b0..c25a1d9 100644
--- a/java/com/google/gwtorm/server/OrmException.java
+++ b/java/com/google/gwtorm/server/OrmException.java
@@ -15,17 +15,18 @@
package com.google.gwtorm.server;
/** Any data store read or write error. */
-@SuppressWarnings("serial")
public class OrmException extends Exception {
- public OrmException(final String message) {
+ private static final long serialVersionUID = 1L;
+
+ public OrmException(String message) {
super(message);
}
- public OrmException(final String message, final Throwable why) {
+ public OrmException(String message, Throwable why) {
super(message, why);
}
- public OrmException(final Throwable why) {
+ public OrmException(Throwable why) {
super(why);
}
}
diff --git a/java/com/google/gwtorm/server/OrmRuntimeException.java b/java/com/google/gwtorm/server/OrmRuntimeException.java
index e3fbc4c..84d1faf 100644
--- a/java/com/google/gwtorm/server/OrmRuntimeException.java
+++ b/java/com/google/gwtorm/server/OrmRuntimeException.java
@@ -15,17 +15,18 @@
package com.google.gwtorm.server;
/** Any data store read or write error. */
-@SuppressWarnings("serial")
public class OrmRuntimeException extends RuntimeException {
- public OrmRuntimeException(final String message) {
+ private static final long serialVersionUID = 1L;
+
+ public OrmRuntimeException(String message) {
super(message);
}
- public OrmRuntimeException(final String message, final Throwable why) {
+ public OrmRuntimeException(String message, Throwable why) {
super(message, why);
}
- public OrmRuntimeException(final Throwable why) {
+ public OrmRuntimeException(Throwable why) {
super(why);
}
}
diff --git a/javatests/com/google/gerrit/server/update/BatchUpdateTest.java b/javatests/com/google/gerrit/server/update/BatchUpdateTest.java
index 2ae0a5f..cca844e 100644
--- a/javatests/com/google/gerrit/server/update/BatchUpdateTest.java
+++ b/javatests/com/google/gerrit/server/update/BatchUpdateTest.java
@@ -14,7 +14,7 @@
package com.google.gerrit.server.update;
-import static org.junit.Assert.assertEquals;
+import static com.google.common.truth.Truth.assertThat;
import com.google.gerrit.reviewdb.client.Project;
import com.google.gerrit.server.CurrentUser;
@@ -51,8 +51,8 @@
@Test
public void addRefUpdateFromFastForwardCommit() throws Exception {
- final RevCommit masterCommit = repo.branch("master").commit().create();
- final RevCommit branchCommit = repo.branch("branch").commit().parent(masterCommit).create();
+ RevCommit masterCommit = repo.branch("master").commit().create();
+ RevCommit branchCommit = repo.branch("branch").commit().parent(masterCommit).create();
try (BatchUpdate bu = batchUpdateFactory.create(project, user.get(), TimeUtil.nowTs())) {
bu.addRepoOnlyOp(
@@ -65,7 +65,7 @@
bu.execute();
}
- assertEquals(
- repo.getRepository().exactRef("refs/heads/master").getObjectId(), branchCommit.getId());
+ assertThat(repo.getRepository().exactRef("refs/heads/master").getObjectId())
+ .isEqualTo(branchCommit.getId());
}
}
diff --git a/plugins/codemirror-editor b/plugins/codemirror-editor
index 65f3cba..3baf62e 160000
--- a/plugins/codemirror-editor
+++ b/plugins/codemirror-editor
@@ -1 +1 @@
-Subproject commit 65f3cbac2174c7aad65a3d7c9325a66871ae5752
+Subproject commit 3baf62e1f12bea107598777a3881455cf39fd8ab
diff --git a/polygerrit-ui/app/elements/diff/gr-diff-processor/gr-diff-processor.js b/polygerrit-ui/app/elements/diff/gr-diff-processor/gr-diff-processor.js
index a9268a7..957a17a 100644
--- a/polygerrit-ui/app/elements/diff/gr-diff-processor/gr-diff-processor.js
+++ b/polygerrit-ui/app/elements/diff/gr-diff-processor/gr-diff-processor.js
@@ -45,6 +45,19 @@
*/
const MAX_GROUP_SIZE = 120;
+ /**
+ * Converts the API's `DiffContent`s to `GrDiffGroup`s for rendering.
+ *
+ * This includes a number of tasks:
+ * - adding a group for the "File" pseudo line that file-level comments can
+ * be attached to
+ * - replacing unchanged parts of the diff that are outside the user's
+ * context setting and do not have comments with a group representing the
+ * "expand context" widget. This may require splitting a `DiffContent` so
+ * that the part that is within the context or has comments is shown, while
+ * the rest is not.
+ * - splitting large `DiffContent`s to allow more granular async rendering
+ */
Polymer({
is: 'gr-diff-processor',
diff --git a/polygerrit-ui/app/elements/diff/gr-diff/gr-diff-group.js b/polygerrit-ui/app/elements/diff/gr-diff/gr-diff-group.js
index 88fcd0e..dd69724 100644
--- a/polygerrit-ui/app/elements/diff/gr-diff/gr-diff-group.js
+++ b/polygerrit-ui/app/elements/diff/gr-diff/gr-diff-group.js
@@ -20,11 +20,20 @@
// Prevent redefinition.
if (window.GrDiffGroup) { return; }
+ /**
+ * A chunk of the diff that should be rendered together.
+ */
function GrDiffGroup(type, opt_lines) {
this.type = type;
+
+ /** @type{!Array<!GrDiffLine>} */
this.lines = [];
+ /** @type{!Array<!GrDiffLine>} */
this.adds = [];
+ /** @type{!Array<!GrDiffLine>} */
this.removes = [];
+
+ /** @type{boolean|undefined} */
this.dueToRebase = undefined;
this.lineRange = {
@@ -40,8 +49,13 @@
GrDiffGroup.prototype.element = null;
GrDiffGroup.Type = {
+ /** Unchanged context. */
BOTH: 'both',
+
+ /** A widget used to show more context. */
CONTEXT_CONTROL: 'contextControl',
+
+ /** Added, removed or modified chunk. */
DELTA: 'delta',
};
diff --git a/tools/eclipse/project.py b/tools/eclipse/project.py
index 24d4733..46aeb31 100755
--- a/tools/eclipse/project.py
+++ b/tools/eclipse/project.py
@@ -222,7 +222,10 @@
p = path.join(s, 'java')
if path.exists(p):
- classpathentry('src', p, out=out)
+ classpathentry('src', p, out=out + '/main')
+ p = path.join(s, 'javatests')
+ if path.exists(p):
+ classpathentry('src', p, out=out + '/test')
continue
for env in ['main', 'test']: