Merge changes Ie7cfeb18,I5186e24a,Ibbc0e35c

* changes:
  Revert "Enable plugins to add REST views for /plugins/<plugin-id>/"
  Use Collections.addAll to copy all parents to mergedParents
  Correct KEY_Branch constant to be KEY_BRANCH
This commit is contained in:
Shawn Pearce
2016-09-02 22:59:44 +00:00
committed by Gerrit Code Review
4 changed files with 3 additions and 38 deletions

View File

@@ -29,7 +29,6 @@ import com.google.gerrit.httpd.restapi.AccountsRestApiServlet;
import com.google.gerrit.httpd.restapi.ChangesRestApiServlet;
import com.google.gerrit.httpd.restapi.ConfigRestApiServlet;
import com.google.gerrit.httpd.restapi.GroupsRestApiServlet;
import com.google.gerrit.httpd.restapi.PluginsRestApiServlet;
import com.google.gerrit.httpd.restapi.ProjectsRestApiServlet;
import com.google.gerrit.httpd.rpc.doc.QueryDocumentationFilter;
import com.google.gerrit.reviewdb.client.Change;
@@ -104,7 +103,6 @@ class UrlModule extends ServletModule {
serveRegex("^/(?:a/)?changes/(.*)$").with(ChangesRestApiServlet.class);
serveRegex("^/(?:a/)?config/(.*)$").with(ConfigRestApiServlet.class);
serveRegex("^/(?:a/)?groups/(.*)?$").with(GroupsRestApiServlet.class);
serveRegex("^/(?:a/)?plugins/(.*)?$").with(PluginsRestApiServlet.class);
serveRegex("^/(?:a/)?projects/(.*)?$").with(ProjectsRestApiServlet.class);
filter("/Documentation/").through(QueryDocumentationFilter.class);

View File

@@ -1,31 +0,0 @@
// Copyright (C) 2016 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.httpd.restapi;
import com.google.gerrit.server.plugins.PluginsCollection;
import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.Singleton;
@Singleton
public class PluginsRestApiServlet extends RestApiServlet {
private static final long serialVersionUID = 1L;
@Inject
PluginsRestApiServlet(RestApiServlet.Globals globals,
Provider<PluginsCollection> plugins) {
super(globals, plugins);
}
}

View File

@@ -151,7 +151,7 @@ public class ProjectConfig extends VersionedMetaData implements ValidationError.
private static final String KEY_COPY_ALL_SCORES_IF_NO_CHANGE = "copyAllScoresIfNoChange";
private static final String KEY_VALUE = "value";
private static final String KEY_CAN_OVERRIDE = "canOverride";
private static final String KEY_Branch = "branch";
private static final String KEY_BRANCH = "branch";
private static final Set<String> LABEL_FUNCTIONS = ImmutableSet.of(
"MaxWithBlock", "AnyWithBlock", "MaxNoBlock", "NoBlock", "NoOp", "PatchSetLock");
@@ -805,7 +805,7 @@ public class ProjectConfig extends VersionedMetaData implements ValidationError.
label.setCanOverride(
rc.getBoolean(LABEL, name, KEY_CAN_OVERRIDE,
LabelType.DEF_CAN_OVERRIDE));
label.setRefPatterns(getStringListOrNull(rc, LABEL, name, KEY_Branch));
label.setRefPatterns(getStringListOrNull(rc, LABEL, name, KEY_BRANCH));
labelSections.put(name, label);
}
}

View File

@@ -1689,9 +1689,7 @@ public class ReceiveCommits {
Collection<Ref> existingRefs = existing.get(c);
if (rejectImplicitMerges) {
for (RevCommit p : c.getParents()) {
mergedParents.add(p);
}
Collections.addAll(mergedParents, c.getParents());
mergedParents.remove(c);
}