in src/main/java/com/googlesource/gerrit/plugins/batch/ssh/MergeChangeCommand.java [90:113]
public void run() throws Exception {
Batch batch = new Batch(user.getAccountId());
String err = null;
try {
Resolver resolver = new Resolver(patchSetArgumentsByPatchSet.values());
for (PatchSetArgument psarg : resolver.resolved) {
err = "Couldn't merge change(" + psarg.patchSet + ") to batch(" + batch.id + ")";
merge(batch, psarg.change, psarg.patchSet);
}
if (close) {
err = "Could not close batch(" + batch.id + ")";
batchCloser.close(batch);
}
} catch (Exception e) {
String msg = e.getMessage();
if (msg != null) {
err += ": " + msg;
}
throw die(err);
}
batch.version = null;
out.write((OutputFormat.JSON.newGson().toJson(batch) + "\n").getBytes(ENC));
out.flush();
}