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
This commit is contained in:
Shawn Pearce 2014-03-06 12:07:38 -08:00
commit 9e12d1933a
14 changed files with 101 additions and 23 deletions

View File

@ -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`".

View File

@ -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.

View File

@ -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 {

View File

@ -26,4 +26,5 @@ public class LabelInfo {
public Map<String, String> values;
public Short value;
public Boolean optional;
public Boolean blocking;
}

View File

@ -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

View File

@ -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();

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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());

View File

@ -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) {

View File

@ -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.

View File

@ -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());