Mercurial > jhg
comparison src/org/tmatesoft/hg/repo/HgRemoteRepository.java @ 407:30922c728341 smartgit3
Better multiline log printout; options to tune default log output
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Fri, 16 Mar 2012 12:51:03 +0100 |
parents | 994b5813a925 |
children | bb278ccf9866 |
comparison
equal
deleted
inserted
replaced
404:31a719b9f95e | 407:30922c728341 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2011 TMate Software Ltd | 2 * Copyright (c) 2011-2012 TMate Software Ltd |
3 * | 3 * |
4 * This program is free software; you can redistribute it and/or modify | 4 * This program is free software; you can redistribute it and/or modify |
5 * it under the terms of the GNU General Public License as published by | 5 * it under the terms of the GNU General Public License as published by |
6 * the Free Software Foundation; version 2 of the License. | 6 * the Free Software Foundation; version 2 of the License. |
7 * | 7 * |
64 public class HgRemoteRepository { | 64 public class HgRemoteRepository { |
65 | 65 |
66 private final URL url; | 66 private final URL url; |
67 private final SSLContext sslContext; | 67 private final SSLContext sslContext; |
68 private final String authInfo; | 68 private final String authInfo; |
69 private final boolean debug = Boolean.parseBoolean(System.getProperty("hg4j.remote.debug")); | 69 private final boolean debug; |
70 private HgLookup lookupHelper; | 70 private HgLookup lookupHelper; |
71 private final SessionContext sessionContext; | 71 private final SessionContext sessionContext; |
72 | 72 |
73 HgRemoteRepository(SessionContext ctx, URL url) throws HgBadArgumentException { | 73 HgRemoteRepository(SessionContext ctx, URL url) throws HgBadArgumentException { |
74 if (url == null || ctx == null) { | 74 if (url == null || ctx == null) { |
75 throw new IllegalArgumentException(); | 75 throw new IllegalArgumentException(); |
76 } | 76 } |
77 this.url = url; | 77 this.url = url; |
78 sessionContext = ctx; | 78 sessionContext = ctx; |
79 Object debugProp = ctx.getProperty("hg4j.remote.debug", false); | |
80 debug = debugProp instanceof Boolean ? ((Boolean) debugProp).booleanValue() : Boolean.parseBoolean(String.valueOf(debugProp)); | |
79 if ("https".equals(url.getProtocol())) { | 81 if ("https".equals(url.getProtocol())) { |
80 try { | 82 try { |
81 sslContext = SSLContext.getInstance("SSL"); | 83 sslContext = SSLContext.getInstance("SSL"); |
82 class TrustEveryone implements X509TrustManager { | 84 class TrustEveryone implements X509TrustManager { |
83 public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException { | 85 public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException { |