Merge branch 'stable-2.11'

* stable-2.11:
  Update 2.11 release notes
  Fix minor bugs in ChangeHookRunner
  RebaseDialog: Organize imports
  Force javac to use -encoding UTF-8
  Fix NullPointerException when executing query with --comments option
  Remove '--recheck-mergeable' option in 2.11 release notes
  ReceiveCommits: Fix NPE when pushing to refs/changes/n
  ChangeControl: Optimize creation by not re-reading changes

Change-Id: Iab97e14b80b1867f785034544ecb33bb39aab2ef
This commit is contained in:
David Pursehouse
2015-02-26 10:00:48 +09:00
7 changed files with 57 additions and 10 deletions

View File

@@ -14,7 +14,7 @@ Important Notes
*WARNING:* This release contains schema changes. To upgrade:
----
java -jar gerrit.war init -d site_path
java -jar gerrit.war reindex --recheck-mergeable -d site_path
java -jar gerrit.war reindex -d site_path
----
*WARNING:* Upgrading to 2.11.x requires the server be first upgraded to 2.8 (or
@@ -556,6 +556,19 @@ link:https://gerrit-documentation.storage.googleapis.com/Documentation/2.11/conf
the documentation], if more than one `footer` token was specified in the
`trackingid` section, only the first was used.
* Treat empty
link:https://gerrit-documentation.storage.googleapis.com/Documentation/2.11/config-gerrit.html#hooks[
`hooks.*`] values as missing, rather than trying to execute the hooks
directory.
* Fix `changed-merged` hook configuration.
+
Contrary to the
link:https://gerrit-documentation.storage.googleapis.com/Documentation/2.11/config-gerrit.html#hooks[
documentation], the changed-merged hook configuration value was being
read from `hooks.changeMerged`. Fix to use `hooks.changeMergedHook` as
documented.
Web UI
~~~~~~

View File

@@ -201,6 +201,18 @@ public abstract class AbstractPushForReview extends AbstractDaemonTest {
assertThat(cr.all.get(0).value.intValue()).is(2);
}
@Test
public void testPushNewPatchsetToRefsChanges() throws GitAPIException,
IOException, OrmException {
PushOneCommit.Result r = pushTo("refs/for/master");
r.assertOkStatus();
PushOneCommit push =
pushFactory.create(db, admin.getIdent(), PushOneCommit.SUBJECT,
"b.txt", "anotherContent", r.getChangeId());
r = push.to(git, "refs/changes/" + r.getChange().change().getId().get());
r.assertOkStatus();
}
@Test
public void testPushForMasterWithApprovals_MissingLabel() throws GitAPIException,
IOException {

View File

@@ -21,8 +21,8 @@ import com.google.gerrit.client.changes.Util;
import com.google.gerrit.client.rpc.GerritCallback;
import com.google.gerrit.client.rpc.Natives;
import com.google.gerrit.reviewdb.client.Change;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.CheckBox;
import com.google.gwt.user.client.ui.SuggestBox;
import com.google.gwt.user.client.ui.SuggestOracle.Suggestion;

View File

@@ -14,6 +14,7 @@
package com.google.gerrit.common;
import com.google.common.base.Strings;
import com.google.common.collect.Sets;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import com.google.gerrit.common.data.ContributorAgreement;
@@ -263,7 +264,7 @@ public class ChangeHookRunner implements ChangeHooks, EventDispatcher,
draftPublishedHook = sitePath.resolve(new File(hooksPath, getValue(config, "hooks", "draftPublishedHook", "draft-published")).getPath());
commentAddedHook = sitePath.resolve(new File(hooksPath, getValue(config, "hooks", "commentAddedHook", "comment-added")).getPath());
changeMergedHook = sitePath.resolve(new File(hooksPath, getValue(config, "hooks", "changeMergedHook", "change-merged")).getPath());
mergeFailedHook = sitePath.resolve(new File(hooksPath, getValue(config, "hooks", "mergeFailed", "merge-failed")).getPath());
mergeFailedHook = sitePath.resolve(new File(hooksPath, getValue(config, "hooks", "mergeFailedHook", "merge-failed")).getPath());
changeAbandonedHook = sitePath.resolve(new File(hooksPath, getValue(config, "hooks", "changeAbandonedHook", "change-abandoned")).getPath());
changeRestoredHook = sitePath.resolve(new File(hooksPath, getValue(config, "hooks", "changeRestoredHook", "change-restored")).getPath());
refUpdatedHook = sitePath.resolve(new File(hooksPath, getValue(config, "hooks", "refUpdatedHook", "ref-updated")).getPath());
@@ -300,7 +301,7 @@ public class ChangeHookRunner implements ChangeHooks, EventDispatcher,
*/
private String getValue(final Config config, final String section, final String setting, final String fallback) {
final String result = config.getString(section, null, setting);
return (result == null) ? fallback : result;
return Strings.isNullOrEmpty(result) ? fallback : result;
}
/**

View File

@@ -2038,7 +2038,7 @@ public class ReceiveCommits {
@Override
public PatchSet.Id call() throws OrmException, IOException, NoSuchChangeException {
try {
if (magicBranch.edit) {
if (magicBranch != null && magicBranch.edit) {
return upsertEdit();
} else if (caller == Thread.currentThread()) {
return insertPatchSet(db);

View File

@@ -596,7 +596,7 @@ public class ChangeData {
public List<ChangeMessage> messages()
throws OrmException {
if (messages == null) {
messages = cmUtil.byChange(db, notes);
messages = cmUtil.byChange(db, notes());
}
return messages;
}

View File

@@ -20,18 +20,38 @@ include_defs('//tools/java_doc.defs')
include_defs('//tools/java_sources.defs')
import copy
# Add AutoValue support to java_library.
# Set defaults on java rules:
# - Add AutoValue annotation processing support.
# - Treat source files as UTF-8.
_buck_java_library = java_library
def java_library(*args, **kwargs):
_set_auto_value(kwargs)
_munge_args(kwargs)
_buck_java_library(*args, **kwargs)
# Add AutoValue support to java_test.
_buck_java_test = java_test
def java_test(*args, **kwargs):
_set_auto_value(kwargs)
_munge_args(kwargs)
_buck_java_test(*args, **kwargs)
# Munge kwargs to set Gerrit-specific defaults.
def _munge_args(kwargs):
_set_auto_value(kwargs)
_set_extra_arguments(kwargs)
def _set_extra_arguments(kwargs):
ext = 'extra_arguments'
if ext not in kwargs:
kwargs[ext] = []
extra_args = kwargs[ext]
for arg in extra_args:
if arg.startswith('-encoding'):
return
extra_args.extend(['-encoding', 'UTF-8'])
def _set_auto_value(kwargs):
apk = 'annotation_processors'
if apk not in kwargs:
@@ -47,6 +67,7 @@ def _set_auto_value(kwargs):
aps.extend(AUTO_VALUE_PROCESSORS)
apds.extend(AUTO_VALUE_PROCESSOR_DEPS)
def genantlr(
name,
srcs,