summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Pursehouse <dpursehouse@collab.net>2020-03-16 09:03:06 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2020-03-16 09:03:06 +0000
commite10a77b9a7e48180abae82da942d5c6f139e15c0 (patch)
tree865cdba90f468a829d90d02c84c3aa25081876fb
parentde8e841b9cbfa088b51e9b8678b0680fd2f71aee (diff)
parentfbdf9c1ae9c3fb6c6e10d4f4b56191c42dcf9e47 (diff)
Merge "Merge branch 'stable-3.0' into stable-3.1" into stable-3.1
-rw-r--r--Documentation/prolog-change-facts.txt3
-rw-r--r--java/gerrit/PRED_commit_parent_count_1.java51
-rw-r--r--javatests/com/google/gerrit/elasticsearch/ElasticContainer.java2
m---------plugins/codemirror-editor0
m---------plugins/delete-project0
m---------plugins/gitiles0
m---------plugins/replication0
m---------plugins/webhooks0
-rw-r--r--tools/bzl/javadoc.bzl2
9 files changed, 56 insertions, 2 deletions
diff --git a/Documentation/prolog-change-facts.txt b/Documentation/prolog-change-facts.txt
index 2fb13e918a..ac69616c43 100644
--- a/Documentation/prolog-change-facts.txt
+++ b/Documentation/prolog-change-facts.txt
@@ -48,6 +48,9 @@ of them we must use a qualified name like `gerrit:change_branch(X)`.
|`commit_message/1` |`commit_message('Fix bug X').`
|Commit message as string atom
+|`commit_parent_count/1` |`commit_parent_count(1).`
+ |Number of parent commits of a commit. Can be used to detect merge commits
+
|`commit_stats/3` |`commit_stats(5,20,50).`
|Number of files modified, number of insertions and the number of deletions.
diff --git a/java/gerrit/PRED_commit_parent_count_1.java b/java/gerrit/PRED_commit_parent_count_1.java
new file mode 100644
index 0000000000..81589dd8eb
--- /dev/null
+++ b/java/gerrit/PRED_commit_parent_count_1.java
@@ -0,0 +1,51 @@
+// Copyright (C) 2020 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 gerrit;
+
+import com.google.gerrit.server.rules.StoredValues;
+import com.googlecode.prolog_cafe.exceptions.PrologException;
+import com.googlecode.prolog_cafe.lang.IntegerTerm;
+import com.googlecode.prolog_cafe.lang.Operation;
+import com.googlecode.prolog_cafe.lang.Predicate;
+import com.googlecode.prolog_cafe.lang.Prolog;
+import com.googlecode.prolog_cafe.lang.Term;
+import org.eclipse.jgit.revwalk.RevCommit;
+
+/**
+ * Prolog fact for the number of parents of a given commit
+ *
+ * <pre>
+ * 'commit_parent_count'(-Count)
+ * </pre>
+ */
+public class PRED_commit_parent_count_1 extends Predicate.P1 {
+ public PRED_commit_parent_count_1(Term a1, Operation n) {
+ arg1 = a1;
+ cont = n;
+ }
+
+ @Override
+ public Operation exec(Prolog engine) throws PrologException {
+ engine.setB0();
+ Term a1 = arg1.dereference();
+
+ RevCommit commit = StoredValues.COMMIT.get(engine);
+
+ if (!a1.unify(new IntegerTerm(commit.getParentCount()), engine.trail)) {
+ return engine.fail();
+ }
+ return cont;
+ }
+}
diff --git a/javatests/com/google/gerrit/elasticsearch/ElasticContainer.java b/javatests/com/google/gerrit/elasticsearch/ElasticContainer.java
index 96041a14aa..dd3e36478d 100644
--- a/javatests/com/google/gerrit/elasticsearch/ElasticContainer.java
+++ b/javatests/com/google/gerrit/elasticsearch/ElasticContainer.java
@@ -53,7 +53,7 @@ public class ElasticContainer extends ElasticsearchContainer {
case V6_7:
return "blacktop/elasticsearch:6.7.2";
case V6_8:
- return "blacktop/elasticsearch:6.8.6";
+ return "blacktop/elasticsearch:6.8.7";
case V7_0:
return "blacktop/elasticsearch:7.0.1";
case V7_1:
diff --git a/plugins/codemirror-editor b/plugins/codemirror-editor
-Subproject 92ce310ecf717133601b9e824c38bc5e5eafecb
+Subproject 59942b1adf1c949f3633f60ac42f67fae03b325
diff --git a/plugins/delete-project b/plugins/delete-project
-Subproject 0ae632098fec9d60932e53a8816ae434f28bc59
+Subproject 4e74ff291292ea3416802c532a1b9a3c54026ae
diff --git a/plugins/gitiles b/plugins/gitiles
-Subproject 0912a48d51981d86e7912c8d682ce75d62afb81
+Subproject 676a6cbb5f43b66d1d8d618a0f32aba09ac827c
diff --git a/plugins/replication b/plugins/replication
-Subproject 8c28ecec73a4017588ebddb2e869d88fa571fc6
+Subproject 9d1d158c0f4b48581183b878aebc4bfb61450af
diff --git a/plugins/webhooks b/plugins/webhooks
-Subproject 377fec17d2c0fc71cdfb1d12f502cfa1eba1fbd
+Subproject 33eeeb697d6a7bb03eed1b776bea40e26d5df31
diff --git a/tools/bzl/javadoc.bzl b/tools/bzl/javadoc.bzl
index eecafb4466..62b40109e3 100644
--- a/tools/bzl/javadoc.bzl
+++ b/tools/bzl/javadoc.bzl
@@ -32,7 +32,7 @@ def _impl(ctx):
"export TZ",
"rm -rf %s" % source,
"mkdir %s" % source,
- " && ".join(["unzip -qud %s %s" % (source, j.path) for j in source_jars.to_list()]),
+ " && ".join(["unzip -qoud %s %s" % (source, j.path) for j in source_jars.to_list()]),
"rm -rf %s" % dir,
"mkdir %s" % dir,
" ".join([