summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Pearce <sop@google.com>2014-03-06 12:07:38 -0800
committerShawn Pearce <sop@google.com>2014-03-06 12:15:25 -0800
commit9e12d1933a6a1088eb54e14046625170f297b1b1 (patch)
tree45eb2bd0f6a322debf6868e1f9961aaee5047814
parent9d8235cdd023df35f6d197aabbe3847b1e998d38 (diff)
parent6ff6418736ea1361a6a2cdb52a11547c4b9c8d50 (diff)
Merge branch 'stable-2.8'
* stable-2.8: Update 2.8.2 release notes with recently merged changes. Change dialog title from Error to Warning on intraline diff timeout Another attempt to fix submit rule evaluation for non blocking labels Fix: Label update operation is executed as insert RFC: Work around null commit when updating submodules Change-Id: Icc1ce1698add8321a86af42ed864b02d9ef58040
-rw-r--r--Documentation/rest-api-changes.txt2
-rw-r--r--ReleaseNotes/ReleaseNotes-2.8.2.txt57
-rw-r--r--gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/server/project/CustomLabelIT.java15
-rw-r--r--gerrit-extension-api/src/main/java/com/google/gerrit/extensions/common/LabelInfo.java1
-rw-r--r--gerrit-gwtui/src/main/java/com/google/gerrit/client/ErrorDialog.java5
-rw-r--r--gerrit-gwtui/src/main/java/com/google/gerrit/client/GerritConstants.java3
-rw-r--r--gerrit-gwtui/src/main/java/com/google/gerrit/client/GerritConstants.properties3
-rw-r--r--gerrit-gwtui/src/main/java/com/google/gerrit/client/change/Labels.java8
-rw-r--r--gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeInfo.java1
-rw-r--r--gerrit-gwtui/src/main/java/com/google/gerrit/client/patches/PatchScreen.java3
-rw-r--r--gerrit-server/src/main/java/com/google/gerrit/server/api/changes/ChangeInfoMapper.java1
-rw-r--r--gerrit-server/src/main/java/com/google/gerrit/server/change/ChangeJson.java20
-rw-r--r--gerrit-server/src/main/java/com/google/gerrit/server/change/PostReview.java2
-rw-r--r--gerrit-server/src/main/java/com/google/gerrit/server/git/SubmoduleOp.java3
14 files changed, 101 insertions, 23 deletions
diff --git a/Documentation/rest-api-changes.txt b/Documentation/rest-api-changes.txt
index 036392ce3e..0708278d94 100644
--- a/Documentation/rest-api-changes.txt
+++ b/Documentation/rest-api-changes.txt
@@ -3083,6 +3083,8 @@ link:rest-api-accounts.html#account-info[AccountInfo] entity.
|`disliked` |optional|One user who disliked this label on the change
(voted negatively, but not the minimum value) as an
link:rest-api-accounts.html#account-info[AccountInfo] entity.
+|`blocking` |optional|If `true`, the label blocks submit operation.
+If not set, the default is false.
|`value` |optional|The voting value of the user who
recommended/disliked this label on the change if it is not
"`+1`"/"`-1`".
diff --git a/ReleaseNotes/ReleaseNotes-2.8.2.txt b/ReleaseNotes/ReleaseNotes-2.8.2.txt
index 67a11358c3..9b72a774c9 100644
--- a/ReleaseNotes/ReleaseNotes-2.8.2.txt
+++ b/ReleaseNotes/ReleaseNotes-2.8.2.txt
@@ -66,12 +66,46 @@ Running a query with `limit:0` when the secondary index is enabled was causing
an internal server error.
* link:https://code.google.com/p/gerrit/issues/detail?id=2331[Issue 2331]:
-Make sure change-merged event contains correct patch set number.
+Make sure `change-merged` event contains correct patch set number.
+
When a change is submitted with the cherry-pick strategy, or when the
change is rebased with the "rebase if necessary" strategy, a new patch
set is created. The newly created patch set was not being set in the
-change-merged event.
+`change-merged` event.
+
+* Guard against `diff.mnemonicprefix` in `commit-msg` hook.
++
+When `diff.mnemonicprefix` was enabled in the git config, committing
+changes with `git commit -v` caused the diff to be included in the
+generated commit message.
+
+* link:https://code.google.com/p/gerrit/issues/detail?id=2453[Issue 2453]:
+Fix submit rule evaluation for non blocking labels.
++
+Putting a negative score on a label configured as `NoBlock` was causing
+the submit button to be disabled.
+
+* link:https://code.google.com/p/gerrit/issues/detail?id=2331[Issue 2331]:
+Allow to create branch with new commits.
++
+Branches could not be created with a new commit which is not on other branches
+already.
+
+* Fix incompatibility between "Rebase if Necessary" and "copy scores".
++
+When a project was set up with "Rebase if Necessary", one of its labels had
+`copyAllScoresOnTrivialRebase` or `copyMaxScore`, and a change that actually
+needed a trivial rebase was submitted, Gerrit first rebased the change, and in
+the process copied the approval for the label. It then copied all the
+approvals, including the one already copied, which resulted in a constraint
+violation on the database.
+
+* Add `Implementation-Vendor` default manifest entry for plugins.
++
+In buck, the `java_binary` rule merges manifest entries from dependent JARs
+unless the input JAR possesses these entries itself. This was causing some
+plugins to display the wrong vendor information if they had dependency on
+another JAR file that provided a `Implementation-Vendor` value.
* Remove dependency on joda time library in gerrit launcher.
+
@@ -141,6 +175,19 @@ Filling the browser available space with each side of the diff at
have a wide display, and better fit on more narrow displays by
splitting the available width at 50%.
+* Fire `comment-added` stream event even when mail notification is not sent.
++
+Unchecking the "and send email" option on the change screen prevented the
+`comment-added` event from being sent to the event stream.
+
+* link:https://code.google.com/p/gerrit/issues/detail?id=2493[Issue 2493]:
+Set uploader to current user in `patchset-created` event upon rebasing
+a change in the UI.
++
+When a change was rebased from the change screen, the `uploader` field
+of the `patchset-created` event was incorrectly set to the original
+change uploader, rather than the user that performed the rebase.
+
ssh
---
@@ -170,6 +217,8 @@ longer relevant to mention this in the description of a core command.
* Fix aliasing of SSH commands.
+* link:https://code.google.com/p/gerrit/issues/detail?id=2515[Issue 2515]:
+Fix internal server error when updating an existing label with `gerrit review`.
Replication Plugin
------------------
@@ -221,3 +270,7 @@ which has not been used for some time.
* Add a link from the plugin documentation to the validation listeners API
documentation.
+
+* Remove double border around code snippets.
+
+* Add border around tables.
diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/server/project/CustomLabelIT.java b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/server/project/CustomLabelIT.java
index 83c9f3822b..f38ac89b3e 100644
--- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/server/project/CustomLabelIT.java
+++ b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/server/project/CustomLabelIT.java
@@ -21,6 +21,7 @@ import static com.google.gerrit.server.project.Util.value;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
import com.google.gerrit.acceptance.AbstractDaemonTest;
import com.google.gerrit.acceptance.NoHttpd;
@@ -77,8 +78,8 @@ public class CustomLabelIT extends AbstractDaemonTest {
ChangeInfo c = get(r.getChangeId());
LabelInfo q = c.labels.get(Q.getName());
assertEquals(1, q.all.size());
- assertNull(q.rejected);
- assertNotNull(q.disliked);
+ assertNotNull(q.rejected);
+ assertNull(q.blocking);
}
@Test
@@ -90,8 +91,8 @@ public class CustomLabelIT extends AbstractDaemonTest {
ChangeInfo c = get(r.getChangeId());
LabelInfo q = c.labels.get(Q.getName());
assertEquals(1, q.all.size());
- assertNull(q.rejected);
- assertNotNull(q.disliked);
+ assertNotNull(q.rejected);
+ assertNull(q.blocking);
}
@Test
@@ -103,8 +104,8 @@ public class CustomLabelIT extends AbstractDaemonTest {
ChangeInfo c = get(r.getChangeId());
LabelInfo q = c.labels.get(Q.getName());
assertEquals(1, q.all.size());
- assertNull(q.rejected);
- assertNotNull(q.disliked);
+ assertNotNull(q.rejected);
+ assertNull(q.blocking);
}
@Test
@@ -118,6 +119,7 @@ public class CustomLabelIT extends AbstractDaemonTest {
assertEquals(1, q.all.size());
assertNull(q.disliked);
assertNotNull(q.rejected);
+ assertTrue(q.blocking);
}
@Test
@@ -130,6 +132,7 @@ public class CustomLabelIT extends AbstractDaemonTest {
assertEquals(1, q.all.size());
assertNull(q.disliked);
assertNotNull(q.rejected);
+ assertTrue(q.blocking);
}
private void saveLabelConfig() throws Exception {
diff --git a/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/common/LabelInfo.java b/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/common/LabelInfo.java
index 508fd7ebbb..fd6008f9b1 100644
--- a/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/common/LabelInfo.java
+++ b/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/common/LabelInfo.java
@@ -26,4 +26,5 @@ public class LabelInfo {
public Map<String, String> values;
public Short value;
public Boolean optional;
+ public Boolean blocking;
}
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/ErrorDialog.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/ErrorDialog.java
index 8048c4d41d..700c701fb7 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/ErrorDialog.java
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/ErrorDialog.java
@@ -75,7 +75,7 @@ public class ErrorDialog extends PluginSafePopupPanel {
center.add(body);
center.add(buttons);
- setText(Gerrit.C.errorDialogTitle());
+ setText(Gerrit.C.errorTitle());
addStyleName(Gerrit.RESOURCES.css().errorDialog());
add(center);
@@ -155,8 +155,9 @@ public class ErrorDialog extends PluginSafePopupPanel {
}
}
- public void setText(final String t) {
+ public ErrorDialog setText(final String t) {
text.setText(t);
+ return this;
}
@Override
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/GerritConstants.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/GerritConstants.java
index c0f91d3ac7..2d20b984a5 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/GerritConstants.java
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/GerritConstants.java
@@ -29,8 +29,9 @@ public interface GerritConstants extends Constants {
String registerDialogTitle();
String loginTypeUnsupported();
- String errorDialogTitle();
+ String errorTitle();
String errorDialogContinue();
+ String warnTitle();
String confirmationDialogOk();
String confirmationDialogCancel();
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/GerritConstants.properties b/gerrit-gwtui/src/main/java/com/google/gerrit/client/GerritConstants.properties
index 27cc30318e..af530f46bf 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/GerritConstants.properties
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/GerritConstants.properties
@@ -10,8 +10,9 @@ linkIdentityDialogTitle = Code Review - Link Identity
registerDialogTitle = Code Review - Register New Account
loginTypeUnsupported = Sign in is not available.
-errorDialogTitle = Code Review - Error
+errorTitle = Code Review - Error
errorDialogContinue = Continue
+warnTitle = Code Review - Warning
confirmationDialogOk = OK
confirmationDialogCancel = Cancel
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/Labels.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/Labels.java
index a88edfada9..2680347d96 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/Labels.java
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/Labels.java
@@ -126,10 +126,12 @@ class Labels extends Grid {
break;
case REJECT:
case IMPOSSIBLE:
- if (current) {
- statusText.setInnerText("Not " + name);
+ if (label.blocking()) {
+ if (current) {
+ statusText.setInnerText("Not " + name);
+ }
+ canSubmit = false;
}
- canSubmit = false;
break;
default:
break;
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeInfo.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeInfo.java
index bc752cfa50..bfe70b865c 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeInfo.java
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeInfo.java
@@ -160,6 +160,7 @@ public class ChangeInfo extends JavaScriptObject {
public final native String value_text(String n) /*-{ return this.values[n]; }-*/;
public final native boolean optional() /*-{ return this.optional ? true : false; }-*/;
+ public final native boolean blocking() /*-{ return this.blocking ? true : false; }-*/;
final native short _value()
/*-{
if (this.value) return this.value;
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/patches/PatchScreen.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/patches/PatchScreen.java
index fa2eb32998..ad96f243c1 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/patches/PatchScreen.java
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/patches/PatchScreen.java
@@ -526,7 +526,8 @@ public abstract class PatchScreen extends Screen implements
new ErrorDialog(PatchUtil.C.intralineFailure()).show();
} else if (intralineTimeout) {
intralineTimeout = false;
- new ErrorDialog(PatchUtil.C.intralineTimeout()).show();
+ new ErrorDialog(PatchUtil.C.intralineTimeout()).setText(
+ Gerrit.C.warnTitle()).show();
}
if (topView != null && prefs.get().isRetainHeader()) {
setTopView(topView);
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/api/changes/ChangeInfoMapper.java b/gerrit-server/src/main/java/com/google/gerrit/server/api/changes/ChangeInfoMapper.java
index 4faae5dac6..9d813fc6f4 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/api/changes/ChangeInfoMapper.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/api/changes/ChangeInfoMapper.java
@@ -117,6 +117,7 @@ class ChangeInfoMapper {
lo.disliked = fromAcountInfo(li.disliked);
lo.value = li.value;
lo.optional = li.optional;
+ lo.blocking = li.blocking;
lo.values = li.values;
if (li.all != null) {
lo.all = Lists.newArrayListWithExpectedSize(li.all.size());
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/change/ChangeJson.java b/gerrit-server/src/main/java/com/google/gerrit/server/change/ChangeJson.java
index cb852a8666..ad6b80460c 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/change/ChangeJson.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/change/ChangeJson.java
@@ -456,6 +456,7 @@ public class ChangeJson {
break;
case REJECT:
n.rejected = accountLoader.get(r.appliedBy);
+ n.blocking = true;
break;
default:
break;
@@ -482,12 +483,18 @@ public class ChangeJson {
return;
}
- if (score < 0) {
- label.disliked = accountLoader.get(accountId);
- label.value = score;
- } else if (score > 0 && label.disliked == null) {
- label.recommended = accountLoader.get(accountId);
- label.value = score;
+ if (score != 0) {
+ if (score == type.getMin().getValue()) {
+ label.rejected = accountLoader.get(accountId);
+ } else if (score == type.getMax().getValue()) {
+ label.approved = accountLoader.get(accountId);
+ } else if (score < 0) {
+ label.disliked = accountLoader.get(accountId);
+ label.value = score;
+ } else if (score > 0 && label.disliked == null) {
+ label.recommended = accountLoader.get(accountId);
+ label.value = score;
+ }
}
}
@@ -996,6 +1003,7 @@ public class ChangeJson {
public Short value;
public Boolean optional;
+ public Boolean blocking;
void addApproval(ApprovalInfo ai) {
if (all == null) {
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/change/PostReview.java b/gerrit-server/src/main/java/com/google/gerrit/server/change/PostReview.java
index d9ec66993d..25c63b5d11 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/change/PostReview.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/change/PostReview.java
@@ -395,7 +395,7 @@ public class PostReview implements RestModifyView<RevisionResource, ReviewInput>
continue;
}
- PatchSetApproval c = current.remove(name);
+ PatchSetApproval c = current.remove(lt.getName());
String normName = lt.getName();
if (ent.getValue() == null || ent.getValue() == 0) {
// User requested delete of this label.
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/git/SubmoduleOp.java b/gerrit-server/src/main/java/com/google/gerrit/server/git/SubmoduleOp.java
index 1096a09efe..5424887ee3 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/git/SubmoduleOp.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/git/SubmoduleOp.java
@@ -269,6 +269,9 @@ public class SubmoduleOp {
for (final Map.Entry<Branch.NameKey, ObjectId> me : modules.entrySet()) {
RevCommit c = myRw.parseCommit(me.getValue());
+ if (c == null) {
+ continue;
+ }
msgbuf.append("\nProject: ");
msgbuf.append(me.getKey().getParentKey().get());