Merge branch 'stable-2.15' into stable-2.16
* stable-2.15: Change bazel-genfiles to bazel-bin as per Bazel 0.25 AccountIT#deletePreferredEmail: Make assertions more explicit Avoid evaluating submit rules twice for open changes Change-Id: Ia911640d51803723fb22fcdcd6fbceb9a5206eaa
This commit is contained in:
@@ -131,7 +131,7 @@ The output archive that contains Java binaries, Java sources and
|
||||
Java docs will be placed in:
|
||||
|
||||
----
|
||||
bazel-genfiles/api.zip
|
||||
bazel-bin/api.zip
|
||||
----
|
||||
|
||||
Install {extension,plugin,gwt}-api to the local maven repository:
|
||||
@@ -155,13 +155,13 @@ Install gerrit.war to the local maven repository:
|
||||
The output JAR files for individual plugins will be placed in:
|
||||
|
||||
----
|
||||
bazel-genfiles/plugins/<name>/<name>.jar
|
||||
bazel-bin/plugins/<name>/<name>.jar
|
||||
----
|
||||
|
||||
The JAR files will also be packaged in:
|
||||
|
||||
----
|
||||
bazel-genfiles/plugins/core.zip
|
||||
bazel-bin/plugins/core.zip
|
||||
----
|
||||
|
||||
To build a specific plugin:
|
||||
@@ -173,7 +173,7 @@ To build a specific plugin:
|
||||
The output JAR file will be be placed in:
|
||||
|
||||
----
|
||||
bazel-genfiles/plugins/<name>/<name>.jar
|
||||
bazel-bin/plugins/<name>/<name>.jar
|
||||
----
|
||||
|
||||
Note that when building an individual plugin, the `core.zip` package
|
||||
|
@@ -936,7 +936,7 @@ public class ChangeData {
|
||||
}
|
||||
|
||||
public List<SubmitRecord> submitRecords(SubmitRuleOptions options) {
|
||||
List<SubmitRecord> records = submitRecords.get(options);
|
||||
List<SubmitRecord> records = getCachedSubmitRecord(options);
|
||||
if (records == null) {
|
||||
if (!lazyLoad) {
|
||||
return Collections.emptyList();
|
||||
@@ -949,7 +949,21 @@ public class ChangeData {
|
||||
|
||||
@Nullable
|
||||
public List<SubmitRecord> getSubmitRecords(SubmitRuleOptions options) {
|
||||
return submitRecords.get(options);
|
||||
return getCachedSubmitRecord(options);
|
||||
}
|
||||
|
||||
private List<SubmitRecord> getCachedSubmitRecord(SubmitRuleOptions options) {
|
||||
List<SubmitRecord> records = submitRecords.get(options);
|
||||
if (records != null) {
|
||||
return records;
|
||||
}
|
||||
|
||||
if (options.allowClosed() && change != null && change.getStatus().isOpen()) {
|
||||
SubmitRuleOptions openSubmitRuleOptions = options.toBuilder().allowClosed(false).build();
|
||||
return submitRecords.get(openSubmitRuleOptions);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setSubmitRecords(SubmitRuleOptions options, List<SubmitRecord> records) {
|
||||
|
@@ -1063,6 +1063,7 @@ public class AccountIT extends AbstractDaemonTest {
|
||||
|
||||
@Test
|
||||
public void deletePreferredEmail() throws Exception {
|
||||
String previous = gApi.accounts().self().get().email;
|
||||
String email = "foo.bar.baz@example.com";
|
||||
EmailInput input = new EmailInput();
|
||||
input.email = email;
|
||||
@@ -1074,6 +1075,7 @@ public class AccountIT extends AbstractDaemonTest {
|
||||
// and then again on setting the email preferred.
|
||||
accountIndexedCounter.assertReindexOf(admin, 2);
|
||||
|
||||
// The new preferred email is set
|
||||
assertThat(gApi.accounts().self().get().email).isEqualTo(email);
|
||||
|
||||
accountIndexedCounter.clear();
|
||||
@@ -1081,7 +1083,8 @@ public class AccountIT extends AbstractDaemonTest {
|
||||
accountIndexedCounter.assertReindexOf(admin);
|
||||
|
||||
resetCurrentApiUser();
|
||||
assertThat(getEmails()).doesNotContain(email);
|
||||
assertThat(getEmails()).containsExactly(previous);
|
||||
assertThat(gApi.accounts().self().get().email).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Reference in New Issue
Block a user