Merge branch 'stable-3.6' into stable-3.7
* stable-3.6:
NoteDbUpdateManager: Fix wrong conflict resolution
Release-Notes: skip
Forward-Compatible: checked
Change-Id: Ic6e2090e7132aa353b7104a829878b936c98c493
diff --git a/java/com/google/gerrit/server/notedb/NoteDbUpdateManager.java b/java/com/google/gerrit/server/notedb/NoteDbUpdateManager.java
index c9280f1..ad1f4c5 100644
--- a/java/com/google/gerrit/server/notedb/NoteDbUpdateManager.java
+++ b/java/com/google/gerrit/server/notedb/NoteDbUpdateManager.java
@@ -310,12 +310,6 @@
}
}
- public BatchRefUpdate prepare() throws IOException {
- checkNotExecuted();
- stage();
- return prepare(changeRepo, false, pushCert);
- }
-
@Nullable
public BatchRefUpdate execute() throws IOException {
return execute(false);
@@ -371,7 +365,7 @@
cu -> cu.getAttentionSetUpdates().stream()));
}
- private BatchRefUpdate prepare(OpenRepo or, boolean dryrun, @Nullable PushCertificate pushCert)
+ private BatchRefUpdate execute(OpenRepo or, boolean dryrun, @Nullable PushCertificate pushCert)
throws IOException {
if (or == null || or.cmds.isEmpty()) {
return null;
@@ -400,13 +394,7 @@
bru = listener.beforeUpdateRefs(bru);
}
- return bru;
- }
-
- private BatchRefUpdate execute(OpenRepo or, boolean dryrun, @Nullable PushCertificate pushCert)
- throws IOException {
- BatchRefUpdate bru = prepare(or, dryrun, pushCert);
- if (bru != null && !dryrun) {
+ if (!dryrun) {
RefUpdateUtil.executeChecked(bru, or.rw);
}
return bru;
diff --git a/java/com/google/gerrit/server/update/BatchUpdate.java b/java/com/google/gerrit/server/update/BatchUpdate.java
index db4509a..32529f7 100644
--- a/java/com/google/gerrit/server/update/BatchUpdate.java
+++ b/java/com/google/gerrit/server/update/BatchUpdate.java
@@ -453,11 +453,6 @@
execute(ImmutableList.of(this), ImmutableList.of(), false);
}
- public BatchRefUpdate prepareRefUpdates() throws Exception {
- ChangesHandle handle = executeChangeOps(ImmutableList.of(), false);
- return handle.prepare();
- }
-
public boolean isExecuted() {
return executed;
}
@@ -644,10 +639,6 @@
checkArgument(old == null, "result for change %s already set: %s", id, old);
}
- public BatchRefUpdate prepare() throws IOException {
- return manager.prepare();
- }
-
void execute() throws IOException {
BatchUpdate.this.batchRefUpdate = manager.execute(dryrun);
BatchUpdate.this.executed = manager.isExecuted();