Merge branch 'stable-2.8'
* stable-2.8: Update release notes with recently made changes Buck: extend the tool chain to support unsigning JARs Update jgit to 3.1.0.201310021548-r Fixing jdbc code: correct Statement closing Remove unnecessary imports Print error message to log when plugin loader fails to close JAR file Document how plugins can listen to stream-events Change-Id: I2f0051fdf065a6b0170294c6f9dfbef1ea4018ab
This commit is contained in:
@@ -52,6 +52,7 @@ The currently supported message types are *patchset-created*,
|
|||||||
Note that any field may be missing in the JSON messages, so consumers of
|
Note that any field may be missing in the JSON messages, so consumers of
|
||||||
this JSON stream should deal with that appropriately.
|
this JSON stream should deal with that appropriately.
|
||||||
|
|
||||||
|
[[events]]
|
||||||
Events
|
Events
|
||||||
~~~~~~
|
~~~~~~
|
||||||
Patchset Created
|
Patchset Created
|
||||||
|
@@ -346,6 +346,12 @@ Certain operations in Gerrit trigger events. Plugins may receive
|
|||||||
notifications of these events by implementing the corresponding
|
notifications of these events by implementing the corresponding
|
||||||
listeners.
|
listeners.
|
||||||
|
|
||||||
|
* `com.google.gerrit.common.ChangeListener`:
|
||||||
|
+
|
||||||
|
Allows to listen to change events. These are the same
|
||||||
|
link:cmd-stream-events.html#events[events] that are also streamed by
|
||||||
|
the link:cmd-stream-events.html[gerrit stream-events] command.
|
||||||
|
|
||||||
* `com.google.gerrit.extensions.events.LifecycleListener`:
|
* `com.google.gerrit.extensions.events.LifecycleListener`:
|
||||||
+
|
+
|
||||||
Gerrit server startup and shutdown
|
Gerrit server startup and shutdown
|
||||||
|
@@ -735,7 +735,7 @@ release notes.
|
|||||||
Upgrades
|
Upgrades
|
||||||
--------
|
--------
|
||||||
|
|
||||||
* Update JGit to 3.0.0.201306101825-r.41-g84d2738
|
* Update JGit to 3.1.0.201310021548-r
|
||||||
* Update gwtorm to 1.7
|
* Update gwtorm to 1.7
|
||||||
* Update guice to 4.0-beta
|
* Update guice to 4.0-beta
|
||||||
* Update guava to 15.0
|
* Update guava to 15.0
|
||||||
|
@@ -14,8 +14,6 @@
|
|||||||
|
|
||||||
package org.eclipse.jgit.internal.storage.file;
|
package org.eclipse.jgit.internal.storage.file;
|
||||||
|
|
||||||
import org.eclipse.jgit.internal.storage.file.WindowCache;
|
|
||||||
|
|
||||||
// Hack to obtain visibility to package level methods only.
|
// Hack to obtain visibility to package level methods only.
|
||||||
// These aren't yet part of the public JGit API.
|
// These aren't yet part of the public JGit API.
|
||||||
|
|
||||||
|
@@ -31,7 +31,6 @@ import org.eclipse.jgit.revwalk.RevWalk;
|
|||||||
import org.eclipse.jgit.treewalk.TreeWalk;
|
import org.eclipse.jgit.treewalk.TreeWalk;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.charset.CharacterCodingException;
|
|
||||||
|
|
||||||
/** State supporting processing of a single {@link Patch} instance. */
|
/** State supporting processing of a single {@link Patch} instance. */
|
||||||
public class PatchFile {
|
public class PatchFile {
|
||||||
@@ -89,7 +88,6 @@ public class PatchFile {
|
|||||||
* @throws CorruptEntityException the patch cannot be read.
|
* @throws CorruptEntityException the patch cannot be read.
|
||||||
* @throws IOException the patch or complete file content cannot be read.
|
* @throws IOException the patch or complete file content cannot be read.
|
||||||
* @throws NoSuchEntityException
|
* @throws NoSuchEntityException
|
||||||
* @throws CharacterCodingException the file is not a known character set.
|
|
||||||
*/
|
*/
|
||||||
public String getLine(final int file, final int line)
|
public String getLine(final int file, final int line)
|
||||||
throws CorruptEntityException, IOException, NoSuchEntityException {
|
throws CorruptEntityException, IOException, NoSuchEntityException {
|
||||||
|
@@ -32,6 +32,7 @@ class CleanupHandle {
|
|||||||
try {
|
try {
|
||||||
jarFile.close();
|
jarFile.close();
|
||||||
} catch (IOException err) {
|
} catch (IOException err) {
|
||||||
|
PluginLoader.log.error("Cannot close " + jarFile.getName(), err);
|
||||||
}
|
}
|
||||||
if (!tmpFile.delete() && tmpFile.exists()) {
|
if (!tmpFile.delete() && tmpFile.exists()) {
|
||||||
PluginLoader.log.warn("Cannot delete " + tmpFile.getAbsolutePath()
|
PluginLoader.log.warn("Cannot delete " + tmpFile.getAbsolutePath()
|
||||||
|
@@ -14,8 +14,6 @@
|
|||||||
|
|
||||||
package com.google.gerrit.server.ioutil;
|
package com.google.gerrit.server.ioutil;
|
||||||
|
|
||||||
import com.google.gerrit.server.ioutil.ColumnFormatter;
|
|
||||||
|
|
||||||
import junit.framework.TestCase;
|
import junit.framework.TestCase;
|
||||||
|
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
|
@@ -23,13 +23,14 @@ import java.io.File;
|
|||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
|
import java.sql.Statement;
|
||||||
|
|
||||||
public final class SiteInitializer {
|
public final class SiteInitializer {
|
||||||
private static final Logger log = LoggerFactory
|
private static final Logger LOG = LoggerFactory
|
||||||
.getLogger(SiteInitializer.class);
|
.getLogger(SiteInitializer.class);
|
||||||
|
|
||||||
final String sitePath;
|
private final String sitePath;
|
||||||
final String initPath;
|
private final String initPath;
|
||||||
|
|
||||||
SiteInitializer(String sitePath, String initPath) {
|
SiteInitializer(String sitePath, String initPath) {
|
||||||
this.sitePath = sitePath;
|
this.sitePath = sitePath;
|
||||||
@@ -38,10 +39,9 @@ public final class SiteInitializer {
|
|||||||
|
|
||||||
public void init() {
|
public void init() {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
if (sitePath != null) {
|
if (sitePath != null) {
|
||||||
File site = new File(sitePath);
|
File site = new File(sitePath);
|
||||||
log.info(String.format("Initializing site at %s",
|
LOG.info(String.format("Initializing site at %s",
|
||||||
site.getAbsolutePath()));
|
site.getAbsolutePath()));
|
||||||
new BaseInit(site, false).run();
|
new BaseInit(site, false).run();
|
||||||
return;
|
return;
|
||||||
@@ -53,9 +53,8 @@ public final class SiteInitializer {
|
|||||||
if (site == null && initPath != null) {
|
if (site == null && initPath != null) {
|
||||||
site = new File(initPath);
|
site = new File(initPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (site != null) {
|
if (site != null) {
|
||||||
log.info(String.format("Initializing site at %s",
|
LOG.info(String.format("Initializing site at %s",
|
||||||
site.getAbsolutePath()));
|
site.getAbsolutePath()));
|
||||||
new BaseInit(site, new ReviewDbDataSourceProvider(), false).run();
|
new BaseInit(site, new ReviewDbDataSourceProvider(), false).run();
|
||||||
}
|
}
|
||||||
@@ -63,7 +62,7 @@ public final class SiteInitializer {
|
|||||||
conn.close();
|
conn.close();
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Site init failed", e);
|
LOG.error("Site init failed", e);
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -74,10 +73,14 @@ public final class SiteInitializer {
|
|||||||
|
|
||||||
private File getSiteFromReviewDb(Connection conn) {
|
private File getSiteFromReviewDb(Connection conn) {
|
||||||
try {
|
try {
|
||||||
ResultSet rs = conn.createStatement().executeQuery(
|
Statement stmt = conn.createStatement();
|
||||||
"select site_path from system_config");
|
try {
|
||||||
if (rs.next()) {
|
ResultSet rs = stmt.executeQuery("SELECT site_path FROM system_config");
|
||||||
return new File(rs.getString(1));
|
if (rs.next()) {
|
||||||
|
return new File(rs.getString(1));
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
stmt.close();
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
|
Reference in New Issue
Block a user