Mercurial > hg > mercurial
annotate mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialUrlSupport.java @ 960:1aaf8dba4072
fixing TW-48788 for the case of SSH url
author | Pavel.Sher |
---|---|
date | Tue, 21 Feb 2017 18:22:37 +0100 |
parents | 9e67a769bcc1 |
children | 0a31f12174ca 38adef4f1b8f |
rev | line source |
---|---|
732
31a1aca3305c
Update copyright
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
678
diff
changeset
|
1 /* |
31a1aca3305c
Update copyright
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
678
diff
changeset
|
2 * Copyright 2000-2014 JetBrains s.r.o. |
31a1aca3305c
Update copyright
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
678
diff
changeset
|
3 * |
31a1aca3305c
Update copyright
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
678
diff
changeset
|
4 * Licensed under the Apache License, Version 2.0 (the "License"); |
31a1aca3305c
Update copyright
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
678
diff
changeset
|
5 * you may not use this file except in compliance with the License. |
31a1aca3305c
Update copyright
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
678
diff
changeset
|
6 * You may obtain a copy of the License at |
31a1aca3305c
Update copyright
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
678
diff
changeset
|
7 * |
31a1aca3305c
Update copyright
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
678
diff
changeset
|
8 * http://www.apache.org/licenses/LICENSE-2.0 |
31a1aca3305c
Update copyright
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
678
diff
changeset
|
9 * |
31a1aca3305c
Update copyright
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
678
diff
changeset
|
10 * Unless required by applicable law or agreed to in writing, software |
31a1aca3305c
Update copyright
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
678
diff
changeset
|
11 * distributed under the License is distributed on an "AS IS" BASIS, |
31a1aca3305c
Update copyright
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
678
diff
changeset
|
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
31a1aca3305c
Update copyright
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
678
diff
changeset
|
13 * See the License for the specific language governing permissions and |
31a1aca3305c
Update copyright
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
678
diff
changeset
|
14 * limitations under the License. |
31a1aca3305c
Update copyright
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
678
diff
changeset
|
15 */ |
31a1aca3305c
Update copyright
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
678
diff
changeset
|
16 |
678
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
17 package jetbrains.buildServer.buildTriggers.vcs.mercurial; |
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
18 |
959
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
19 import jetbrains.buildServer.http.HttpUtil; |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
20 import jetbrains.buildServer.log.Loggers; |
678
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
21 import jetbrains.buildServer.vcs.*; |
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
22 import jetbrains.buildServer.vcs.impl.VcsRootImpl; |
959
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
23 import org.apache.commons.httpclient.Header; |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
24 import org.apache.commons.httpclient.HttpClient; |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
25 import org.apache.commons.httpclient.HttpState; |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
26 import org.apache.commons.httpclient.UsernamePasswordCredentials; |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
27 import org.apache.commons.httpclient.auth.AuthScope; |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
28 import org.apache.commons.httpclient.methods.GetMethod; |
678
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
29 import org.jetbrains.annotations.NotNull; |
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
30 import org.jetbrains.annotations.Nullable; |
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
31 |
959
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
32 import java.net.URL; |
678
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
33 import java.util.HashMap; |
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
34 import java.util.Map; |
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
35 |
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
36 public class MercurialUrlSupport implements UrlSupport { |
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
37 |
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
38 private final MercurialVcsSupport myVcsSupport; |
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
39 |
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
40 public MercurialUrlSupport(@NotNull MercurialVcsSupport vcsSupport) { |
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
41 myVcsSupport = vcsSupport; |
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
42 } |
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
43 |
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
44 @Nullable |
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
45 public Map<String, String> convertToVcsRootProperties(@NotNull VcsUrl url) throws VcsException { |
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
46 String fetchUrl = url.getUrl(); |
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
47 |
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
48 boolean testRequired = true; |
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
49 |
960 | 50 if (fetchUrl.startsWith("ssh://hg@bitbucket.org")) { |
51 testRequired = false; // definitely Mercurial | |
52 } else { | |
53 MavenVcsUrl mavenUrl = url.asMavenVcsUrl(); | |
54 if (mavenUrl != null && !"hg".equals(mavenUrl.getProviderSchema())) { | |
55 return null; | |
56 } | |
678
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
57 |
960 | 58 if (mavenUrl != null) { |
59 fetchUrl = mavenUrl.getProviderSpecificPart(); | |
959
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
60 testRequired = false; |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
61 } |
960 | 62 |
63 if (fetchUrl.startsWith("http")) { | |
64 // check URL by sending HTTP request | |
65 if (isMercurialRepository(fetchUrl, url.getCredentials())) { | |
66 testRequired = false; | |
67 } | |
68 } | |
959
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
69 } |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
70 |
960 | 71 Map<String, String> res = new HashMap<>(myVcsSupport.getDefaultVcsProperties()); |
678
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
72 res.put(Constants.REPOSITORY_PROP, fetchUrl); |
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
73 Credentials credentials = url.getCredentials(); |
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
74 if (credentials != null) { |
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
75 res.put(Constants.USERNAME, credentials.getUsername()); |
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
76 res.put(Constants.PASSWORD, credentials.getPassword()); |
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
77 } |
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
78 |
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
79 if (testRequired) { |
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
80 try { |
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
81 TestConnectionSupport testConnectionSupport = myVcsSupport.getTestConnectionSupport(); |
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
82 testConnectionSupport.testConnection(new VcsRootImpl(-1, res)); |
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
83 } catch (VcsException e) { |
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
84 return null; |
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
85 } |
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
86 } |
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
87 |
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
88 return res; |
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
89 } |
959
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
90 |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
91 private boolean isMercurialRepository(@NotNull String fetchUrl, @Nullable Credentials credentials) { |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
92 String capabilitiesUrl = fetchUrl; |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
93 if (capabilitiesUrl.endsWith("/")) { |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
94 capabilitiesUrl += "?cmd=capabilities"; |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
95 } else { |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
96 capabilitiesUrl += "/?cmd=capabilities"; |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
97 } |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
98 |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
99 HttpClient client = HttpUtil.createHttpClient(30); |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
100 GetMethod get = new GetMethod(capabilitiesUrl); |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
101 |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
102 try { |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
103 if (credentials != null) { |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
104 URL url = new URL(fetchUrl); |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
105 HttpState state = new HttpState(); |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
106 state.setCredentials(new AuthScope(url.getHost(), url.getPort()), new UsernamePasswordCredentials(credentials.getUsername(), credentials.getPassword())); |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
107 client.setState(state); |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
108 } |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
109 |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
110 // emulate HG command request |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
111 get.addRequestHeader("Accept-Encoding", "identity"); |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
112 get.addRequestHeader("accept", "application/mercurial-0.1"); |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
113 get.addRequestHeader("user-agent", "mercurial/proto-1.0"); |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
114 |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
115 int status = client.executeMethod(get); |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
116 if (status == 200) { |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
117 Header header = get.getResponseHeader("Content-Type"); |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
118 if (header == null || !"application/mercurial-0.1".equals(header.getValue())) { |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
119 return false; |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
120 } |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
121 |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
122 String text = get.getResponseBodyAsString(); |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
123 if (text.contains("unbundle=HG10GZ,HG10BZ")) { |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
124 // looks like mercurial repo |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
125 return true; |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
126 } |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
127 } |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
128 |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
129 } catch (Exception e) { |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
130 Loggers.VCS.debug("Got error while sending HTTP request to " + capabilitiesUrl, e); |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
131 } finally { |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
132 get.releaseConnection(); |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
133 } |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
134 |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
135 return false; |
9e67a769bcc1
fixing TW-48788 for the case of http/https URLs: for HTTP URL we can try to ask for Mercurial repository capabilities to check if it's in fact mercurial
Pavel.Sher
parents:
732
diff
changeset
|
136 } |
678
fd0c1e91bd46
mercurial url support + some tests
Pavel Sher <pavel.sher@gmail.com>
parents:
diff
changeset
|
137 } |