Merge branch 'stable-2.6' into stable-2.7
* stable-2.6: Bump openid4java dependency to 0.9.8 Provide direct link to REST API documentation init: Gracefully handle missing browser Improve explanation of path conflicts in project config doc init: Don't set username on upgrade if database.type is JDBC
This commit is contained in:
@@ -108,9 +108,11 @@ then the change is automatically rebased and then the branch is
|
|||||||
fast-forwarded to the change.
|
fast-forwarded to the change.
|
||||||
|
|
||||||
When Gerrit tries to do a merge, by default the merge will only
|
When Gerrit tries to do a merge, by default the merge will only
|
||||||
succeed if there is no path conflict. By selecting the checkbox
|
succeed if there is no path conflict. A path conflict occurs when
|
||||||
`Automatically resolve conflicts` Gerrit will try do a content merge
|
the same file has also been changed on the other side of the merge.
|
||||||
if a path conflict occurs.
|
|
||||||
|
If `Automatically resolve conflicts` is enabled, Gerrit will try
|
||||||
|
to do a content merge when a path conflict occurs.
|
||||||
|
|
||||||
|
|
||||||
Registering Additional Branches
|
Registering Additional Branches
|
||||||
|
@@ -695,6 +695,7 @@ public class Gerrit implements EntryPoint {
|
|||||||
addDocLink(m, C.menuDocumentationSearch(), "user-search.html");
|
addDocLink(m, C.menuDocumentationSearch(), "user-search.html");
|
||||||
addDocLink(m, C.menuDocumentationUpload(), "user-upload.html");
|
addDocLink(m, C.menuDocumentationUpload(), "user-upload.html");
|
||||||
addDocLink(m, C.menuDocumentationAccess(), "access-control.html");
|
addDocLink(m, C.menuDocumentationAccess(), "access-control.html");
|
||||||
|
addDocLink(m, C.menuDocumentationAPI(), "rest-api.html");
|
||||||
menuLeft.add(m, C.menuDocumentation());
|
menuLeft.add(m, C.menuDocumentation());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -88,6 +88,7 @@ public interface GerritConstants extends Constants {
|
|||||||
String menuDocumentationSearch();
|
String menuDocumentationSearch();
|
||||||
String menuDocumentationUpload();
|
String menuDocumentationUpload();
|
||||||
String menuDocumentationAccess();
|
String menuDocumentationAccess();
|
||||||
|
String menuDocumentationAPI();
|
||||||
|
|
||||||
String searchHint();
|
String searchHint();
|
||||||
String searchButton();
|
String searchButton();
|
||||||
|
@@ -71,6 +71,7 @@ menuDocumentationIndex = Index
|
|||||||
menuDocumentationSearch = Searching
|
menuDocumentationSearch = Searching
|
||||||
menuDocumentationUpload = Uploading
|
menuDocumentationUpload = Uploading
|
||||||
menuDocumentationAccess = Access Controls
|
menuDocumentationAccess = Access Controls
|
||||||
|
menuDocumentationAPI = REST API
|
||||||
|
|
||||||
searchHint = Change #, SHA-1, tr:id or owner:email
|
searchHint = Change #, SHA-1, tr:id or owner:email
|
||||||
searchButton = Search
|
searchButton = Search
|
||||||
|
@@ -51,8 +51,7 @@ limitations under the License.
|
|||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.openid4java</groupId>
|
<groupId>org.openid4java</groupId>
|
||||||
<artifactId>openid4java-consumer</artifactId>
|
<artifactId>openid4java</artifactId>
|
||||||
<type>pom</type>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
package com.google.gerrit.pgm.init;
|
package com.google.gerrit.pgm.init;
|
||||||
|
|
||||||
|
import com.google.common.base.Strings;
|
||||||
import com.google.gerrit.server.config.GerritServerConfig;
|
import com.google.gerrit.server.config.GerritServerConfig;
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
|
|
||||||
@@ -42,7 +43,6 @@ public class Browser {
|
|||||||
if (url == null) {
|
if (url == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (url.startsWith("proxy-")) {
|
if (url.startsWith("proxy-")) {
|
||||||
url = url.substring("proxy-".length());
|
url = url.substring("proxy-".length());
|
||||||
}
|
}
|
||||||
@@ -54,15 +54,19 @@ public class Browser {
|
|||||||
System.err.println("error: invalid httpd.listenUrl: " + url);
|
System.err.println("error: invalid httpd.listenUrl: " + url);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final String hostname = uri.getHost();
|
waitForServer(uri);
|
||||||
final int port = InitUtil.portOf(uri);
|
openBrowser(uri, link);
|
||||||
|
}
|
||||||
|
|
||||||
System.err.print("Waiting for server to start ... ");
|
private void waitForServer(URI uri) throws IOException {
|
||||||
|
String host = uri.getHost();
|
||||||
|
int port = InitUtil.portOf(uri);
|
||||||
|
System.err.format("Waiting for server on %s:%d ... ", host, port);
|
||||||
System.err.flush();
|
System.err.flush();
|
||||||
for (;;) {
|
for (;;) {
|
||||||
final Socket s;
|
Socket s;
|
||||||
try {
|
try {
|
||||||
s = new Socket(hostname, port);
|
s = new Socket(host, port);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
try {
|
try {
|
||||||
Thread.sleep(100);
|
Thread.sleep(100);
|
||||||
@@ -74,18 +78,33 @@ public class Browser {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
System.err.println("OK");
|
System.err.println("OK");
|
||||||
|
}
|
||||||
|
|
||||||
url = cfg.getString("gerrit", null, "canonicalWebUrl");
|
private String resolveUrl(URI uri, String link) {
|
||||||
if (url == null || url.isEmpty()) {
|
String url = cfg.getString("gerrit", null, "canonicalWebUrl");
|
||||||
|
if (Strings.isNullOrEmpty(url)) {
|
||||||
url = uri.toString();
|
url = uri.toString();
|
||||||
}
|
}
|
||||||
if (!url.endsWith("/")) {
|
if (!url.endsWith("/")) {
|
||||||
url += "/";
|
url += "/";
|
||||||
}
|
}
|
||||||
if (link != null && !link.isEmpty()) {
|
if (!Strings.isNullOrEmpty(link)) {
|
||||||
url += "#" + link;
|
url += "#" + link;
|
||||||
}
|
}
|
||||||
System.err.println("Opening browser ...");
|
return url;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void openBrowser(URI uri, String link) {
|
||||||
|
String url = resolveUrl(uri, link);
|
||||||
|
System.err.format("Opening %s ...", url);
|
||||||
|
System.err.flush();
|
||||||
|
try {
|
||||||
org.h2.tools.Server.openBrowser(url);
|
org.h2.tools.Server.openBrowser(url);
|
||||||
|
System.err.println("OK");
|
||||||
|
} catch (Exception e) {
|
||||||
|
System.err.println("FAILED");
|
||||||
|
System.err.println("Open Gerrit with a JavaScript capable browser:");
|
||||||
|
System.err.println(" " + url);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -21,10 +21,11 @@ import com.google.common.base.Strings;
|
|||||||
class JDBCInitializer implements DatabaseConfigInitializer {
|
class JDBCInitializer implements DatabaseConfigInitializer {
|
||||||
@Override
|
@Override
|
||||||
public void initConfig(Section database) {
|
public void initConfig(Section database) {
|
||||||
|
boolean hasUrl = Strings.emptyToNull(database.get("url")) != null;
|
||||||
database.string("URL", "url", null);
|
database.string("URL", "url", null);
|
||||||
guessDriver(database);
|
guessDriver(database);
|
||||||
database.string("Driver class name", "driver", null);
|
database.string("Driver class name", "driver", null);
|
||||||
database.string("Database username", "username", username());
|
database.string("Database username", "username", hasUrl ? null : username());
|
||||||
database.password("username", "password");
|
database.password("username", "password");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -38,10 +38,8 @@ log4j.logger.eu.medsea.mimeutil=WARN
|
|||||||
|
|
||||||
# Silence non-critical messages from openid4java
|
# Silence non-critical messages from openid4java
|
||||||
#
|
#
|
||||||
|
log4j.logger.org.apache.http=WARN
|
||||||
log4j.logger.org.apache.xml=WARN
|
log4j.logger.org.apache.xml=WARN
|
||||||
log4j.logger.httpclient.wire=WARN
|
|
||||||
log4j.logger.org.apache.commons.httpclient=WARN
|
|
||||||
log4j.logger.org.apache.commons.httpclient.HttpMethodBase=ERROR
|
|
||||||
log4j.logger.org.openid4java=WARN
|
log4j.logger.org.openid4java=WARN
|
||||||
log4j.logger.org.openid4java.consumer.ConsumerManager=FATAL
|
log4j.logger.org.openid4java.consumer.ConsumerManager=FATAL
|
||||||
log4j.logger.org.openid4java.discovery.Discovery=ERROR
|
log4j.logger.org.openid4java.discovery.Discovery=ERROR
|
||||||
|
11
pom.xml
11
pom.xml
@@ -526,9 +526,8 @@ limitations under the License.
|
|||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.openid4java</groupId>
|
<groupId>org.openid4java</groupId>
|
||||||
<artifactId>openid4java-consumer</artifactId>
|
<artifactId>openid4java</artifactId>
|
||||||
<version>0.9.6</version>
|
<version>0.9.8</version>
|
||||||
<type>pom</type>
|
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<!-- conflicts with our use of guice 3.0 -->
|
<!-- conflicts with our use of guice 3.0 -->
|
||||||
@@ -574,12 +573,6 @@ limitations under the License.
|
|||||||
<version>0.6.0</version>
|
<version>0.6.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.httpcomponents</groupId>
|
|
||||||
<artifactId>httpclient</artifactId>
|
|
||||||
<version>4.0</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.jcraft</groupId>
|
<groupId>com.jcraft</groupId>
|
||||||
<artifactId>jsch</artifactId>
|
<artifactId>jsch</artifactId>
|
||||||
|
Reference in New Issue
Block a user