diff options
author | Shawn Pearce <sop@google.com> | 2013-05-14 15:33:06 -0700 |
---|---|---|
committer | Shawn Pearce <sop@google.com> | 2013-05-14 15:33:06 -0700 |
commit | f0cb7cb93ca9d193c6f76459c5f2901610057cb4 (patch) | |
tree | d88c29bd8c82eb4ccd9c11203d4159bc43a839e1 | |
parent | a6678bff25769dd3deda803ad1d4d524d7f43704 (diff) | |
parent | be320a9de5d87cd6d4a095dbbf2d6e9beaab44d2 (diff) |
Merge branch 'stable-2.6' into stable-2.7v2.7-rc1
* 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
9 files changed, 44 insertions, 29 deletions
diff --git a/Documentation/project-setup.txt b/Documentation/project-setup.txt index 244b4b8c10..36d3c60b0c 100644 --- a/Documentation/project-setup.txt +++ b/Documentation/project-setup.txt @@ -108,9 +108,11 @@ then the change is automatically rebased and then the branch is fast-forwarded to the change. When Gerrit tries to do a merge, by default the merge will only -succeed if there is no path conflict. By selecting the checkbox -`Automatically resolve conflicts` Gerrit will try do a content merge -if a path conflict occurs. +succeed if there is no path conflict. A path conflict occurs when +the same file has also been changed on the other side of the merge. + +If `Automatically resolve conflicts` is enabled, Gerrit will try +to do a content merge when a path conflict occurs. Registering Additional Branches diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/Gerrit.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/Gerrit.java index 2a9cb71b12..0b1af89406 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/Gerrit.java +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/Gerrit.java @@ -695,6 +695,7 @@ public class Gerrit implements EntryPoint { addDocLink(m, C.menuDocumentationSearch(), "user-search.html"); addDocLink(m, C.menuDocumentationUpload(), "user-upload.html"); addDocLink(m, C.menuDocumentationAccess(), "access-control.html"); + addDocLink(m, C.menuDocumentationAPI(), "rest-api.html"); menuLeft.add(m, C.menuDocumentation()); } diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/GerritConstants.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/GerritConstants.java index 0b57bcb478..683f0585e4 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/GerritConstants.java +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/GerritConstants.java @@ -88,6 +88,7 @@ public interface GerritConstants extends Constants { String menuDocumentationSearch(); String menuDocumentationUpload(); String menuDocumentationAccess(); + String menuDocumentationAPI(); String searchHint(); String searchButton(); diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/GerritConstants.properties b/gerrit-gwtui/src/main/java/com/google/gerrit/client/GerritConstants.properties index f7033e4fef..defc7e477a 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/GerritConstants.properties +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/GerritConstants.properties @@ -71,6 +71,7 @@ menuDocumentationIndex = Index menuDocumentationSearch = Searching menuDocumentationUpload = Uploading menuDocumentationAccess = Access Controls +menuDocumentationAPI = REST API searchHint = Change #, SHA-1, tr:id or owner:email searchButton = Search diff --git a/gerrit-openid/pom.xml b/gerrit-openid/pom.xml index b23249677a..a81cf17f82 100644 --- a/gerrit-openid/pom.xml +++ b/gerrit-openid/pom.xml @@ -51,8 +51,7 @@ limitations under the License. <dependency> <groupId>org.openid4java</groupId> - <artifactId>openid4java-consumer</artifactId> - <type>pom</type> + <artifactId>openid4java</artifactId> </dependency> <dependency> diff --git a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/init/Browser.java b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/init/Browser.java index ea1304374f..8e3948e424 100644 --- a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/init/Browser.java +++ b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/init/Browser.java @@ -14,6 +14,7 @@ package com.google.gerrit.pgm.init; +import com.google.common.base.Strings; import com.google.gerrit.server.config.GerritServerConfig; import com.google.inject.Inject; @@ -42,7 +43,6 @@ public class Browser { if (url == null) { return; } - if (url.startsWith("proxy-")) { url = url.substring("proxy-".length()); } @@ -54,15 +54,19 @@ public class Browser { System.err.println("error: invalid httpd.listenUrl: " + url); return; } - final String hostname = uri.getHost(); - final int port = InitUtil.portOf(uri); + waitForServer(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(); for (;;) { - final Socket s; + Socket s; try { - s = new Socket(hostname, port); + s = new Socket(host, port); } catch (IOException e) { try { Thread.sleep(100); @@ -74,18 +78,33 @@ public class Browser { break; } System.err.println("OK"); + } - url = cfg.getString("gerrit", null, "canonicalWebUrl"); - if (url == null || url.isEmpty()) { + private String resolveUrl(URI uri, String link) { + String url = cfg.getString("gerrit", null, "canonicalWebUrl"); + if (Strings.isNullOrEmpty(url)) { url = uri.toString(); } if (!url.endsWith("/")) { url += "/"; } - if (link != null && !link.isEmpty()) { + if (!Strings.isNullOrEmpty(link)) { url += "#" + link; } - System.err.println("Opening browser ..."); - org.h2.tools.Server.openBrowser(url); + 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); + 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); + } } } diff --git a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/init/JDBCInitializer.java b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/init/JDBCInitializer.java index ac3e7287a3..20034c121e 100644 --- a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/init/JDBCInitializer.java +++ b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/init/JDBCInitializer.java @@ -21,10 +21,11 @@ import com.google.common.base.Strings; class JDBCInitializer implements DatabaseConfigInitializer { @Override public void initConfig(Section database) { + boolean hasUrl = Strings.emptyToNull(database.get("url")) != null; database.string("URL", "url", null); guessDriver(database); 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"); } diff --git a/gerrit-war/src/main/resources/log4j.properties b/gerrit-war/src/main/resources/log4j.properties index 250fa4c4a9..1fcca6df02 100644 --- a/gerrit-war/src/main/resources/log4j.properties +++ b/gerrit-war/src/main/resources/log4j.properties @@ -38,10 +38,8 @@ log4j.logger.eu.medsea.mimeutil=WARN # Silence non-critical messages from openid4java # +log4j.logger.org.apache.http=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.consumer.ConsumerManager=FATAL log4j.logger.org.openid4java.discovery.Discovery=ERROR @@ -526,9 +526,8 @@ limitations under the License. <dependency> <groupId>org.openid4java</groupId> - <artifactId>openid4java-consumer</artifactId> - <version>0.9.6</version> - <type>pom</type> + <artifactId>openid4java</artifactId> + <version>0.9.8</version> <exclusions> <exclusion> <!-- conflicts with our use of guice 3.0 --> @@ -575,12 +574,6 @@ limitations under the License. </dependency> <dependency> - <groupId>org.apache.httpcomponents</groupId> - <artifactId>httpclient</artifactId> - <version>4.0</version> - </dependency> - - <dependency> <groupId>com.jcraft</groupId> <artifactId>jsch</artifactId> <version>0.1.44-1</version> |