# HG changeset patch
# User C:\Documents and Settings\pavel.sher\Application Data\The Bat!
# Date 1246551298 -14400
# Node ID cef5cfe52e3e150417d897616bc0d89e18ad58b2
# Parent b328c6b6526dd043f0a9bb6f079da36b80d68b72
do not set credentials in the url if url already has them
diff -r b328c6b6526d -r cef5cfe52e3e mercurial-common/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/command/Settings.java
--- a/mercurial-common/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/command/Settings.java Wed Nov 26 19:12:27 2008 +0300
+++ b/mercurial-common/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/command/Settings.java Thu Jul 02 20:14:58 2009 +0400
@@ -103,6 +103,8 @@
* @return URL to use for push command
*/
public String getPushUrl() {
+ if (containsCredentials(myRepository)) return myRepository;
+
String cre = "";
if (!StringUtil.isEmpty(myUsername)) {
cre += myUsername;
@@ -121,6 +123,18 @@
return myRepository;
}
+ private boolean containsCredentials(final String repository) {
+ for (String proto: AUTH_PROTOS) {
+ if (myRepository.startsWith(proto)) {
+ String withoutProto = myRepository.substring(proto.length());
+ int comma = withoutProto.indexOf(':');
+ int at = withoutProto.indexOf('@');
+ if (at != -1 && comma != -1 && at > comma) return true;
+ }
+ }
+ return false;
+ }
+
public void setHgCommandPath(@NotNull final String hgCommandPath) {
myHgCommandPath = hgCommandPath;
}
diff -r b328c6b6526d -r cef5cfe52e3e mercurial.ipr
--- a/mercurial.ipr Wed Nov 26 19:12:27 2008 +0300
+++ b/mercurial.ipr Thu Jul 02 20:14:58 2009 +0400
@@ -57,6 +57,9 @@
+
+
+
@@ -99,15 +102,21 @@
-
-
+
+
-
+
+
+
+
+
+
+
@@ -286,6 +295,9 @@
+
+
+
-
+
+