Created
July 1, 2014 02:51
-
-
Save anonymous/a9feffebed6d4ee1fe95 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -ruN --exclude .git --exclude .svn upstream_1.7.10/build.gradle modified/git/build.gradle | |
--- upstream_1.7.10/build.gradle 2014-07-01 02:36:06.945289293 +0000 | |
+++ modified/git/build.gradle 2014-07-01 02:31:49.721306667 +0000 | |
@@ -1,5 +1,5 @@ | |
group = 'org.tmatesoft.svnkit' | |
-version = '1.7.10' | |
+version = '1.7.10-jenkins-1' | |
project.ext { | |
release = true | |
diff -ruN --exclude .git --exclude .svn upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/SVNAuthenticationException.java modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/SVNAuthenticationException.java | |
--- upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/SVNAuthenticationException.java 2014-07-01 02:36:10.233289202 +0000 | |
+++ modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/SVNAuthenticationException.java 2014-07-01 02:31:49.822306931 +0000 | |
@@ -32,6 +32,9 @@ | |
* | |
* @param errorMessage an error message | |
* @param cause an original cause | |
+ * | |
+ * @deprecated | |
+ * Use {@link #SVNAuthenticationException(SVNErrorMessage)} and set the cause to {@link SVNErrorMessage} | |
*/ | |
public SVNAuthenticationException(SVNErrorMessage errorMessage, Throwable cause) { | |
super(errorMessage, cause != null ? cause : errorMessage.getCause()); | |
diff -ruN --exclude .git --exclude .svn upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/SVNErrorMessage.java modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/SVNErrorMessage.java | |
--- upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/SVNErrorMessage.java 2014-07-01 02:36:10.234288854 +0000 | |
+++ modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/SVNErrorMessage.java 2014-07-01 02:31:49.824306813 +0000 | |
@@ -44,7 +44,7 @@ | |
* @author TMate Software Ltd. | |
* @since 1.2 | |
*/ | |
-public class SVNErrorMessage implements Serializable { | |
+public class SVNErrorMessage extends Exception implements Serializable { | |
private static final long serialVersionUID = 4845L; | |
@@ -320,7 +320,10 @@ | |
* @return throwable that caused error or null if not applicable or not known. | |
*/ | |
public Throwable getCause() { | |
- return myThrowable; | |
+ if (myThrowable!=null) | |
+ return myThrowable; | |
+ else | |
+ return super.getCause(); | |
} | |
/** | |
@@ -382,6 +385,13 @@ | |
child = child.getChildErrorMessage(); | |
} | |
myChildErrorMessage = childMessage; | |
+ | |
+ if (getCause()==null && childMessage!=null) | |
+ try { | |
+ initCause(childMessage); | |
+ } catch (IllegalStateException e) { | |
+ // failed to set the cause. that's OK. | |
+ } | |
} | |
/** | |
@@ -509,9 +519,12 @@ | |
return findChildWithErrorCode(errorCode) != null; | |
} | |
- public void initCause(Throwable cause) { | |
+ @Override | |
+ public SVNErrorMessage initCause(Throwable cause) { | |
+ super.initCause(cause); | |
if (myThrowable == null) { | |
myThrowable = cause; | |
} | |
+ return this; | |
} | |
-} | |
\ No newline at end of file | |
+} | |
diff -ruN --exclude .git --exclude .svn upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/SVNException.java modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/SVNException.java | |
--- upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/SVNException.java 2014-07-01 02:36:10.235289286 +0000 | |
+++ modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/SVNException.java 2014-07-01 02:31:49.824306813 +0000 | |
@@ -34,7 +34,7 @@ | |
* @param errorMessage an error message | |
*/ | |
public SVNException(SVNErrorMessage errorMessage) { | |
- this(errorMessage, errorMessage.getCause()); | |
+ this(errorMessage, errorMessage); | |
} | |
/** | |
@@ -42,6 +42,9 @@ | |
* | |
* @param errorMessage an error message | |
* @param cause the real cause of the error | |
+ * | |
+ * @deprecated | |
+ * Use {@link #SVNException(SVNErrorMessage)} and set the cause via {@link SVNErrorMessage#initCause(Throwable)} | |
*/ | |
public SVNException(SVNErrorMessage errorMessage, Throwable cause) { | |
super(cause != null ? cause : errorMessage.getCause()); | |
@@ -50,22 +53,24 @@ | |
cause = errorMessage.getCause(); | |
} | |
- if (cause instanceof SVNException) { | |
- SVNErrorMessage childMessages = ((SVNException) cause).getErrorMessage(); | |
- SVNErrorMessage parent = errorMessage; | |
- while(parent.hasChildErrorMessage()) { | |
- parent = parent.getChildErrorMessage(); | |
- } | |
- if (parent != childMessages) { | |
- parent.setChildErrorMessage(childMessages); | |
- } | |
- } | |
+// this can create cyclic reference among messages, if cause already contains errorMessage as a child | |
+// if (cause instanceof SVNException) { | |
+// SVNErrorMessage childMessages = ((SVNException) cause).getErrorMessage(); | |
+// SVNErrorMessage parent = errorMessage; | |
+// while(parent.hasChildErrorMessage()) { | |
+// parent = parent.getChildErrorMessage(); | |
+// } | |
+// if (parent != childMessages) { | |
+// parent.setChildErrorMessage(childMessages); | |
+// } | |
+// } | |
+ | |
myErrorMessage = errorMessage; | |
if (getCause() == null && errorMessage != null) { | |
errorMessage.initCause(this); | |
} | |
} | |
- | |
+ | |
/** | |
* Returns an error message provided to this exception object. | |
* | |
diff -ruN --exclude .git --exclude .svn upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/SVNURL.java modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/SVNURL.java | |
--- upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/SVNURL.java 2014-07-01 02:36:10.237288866 +0000 | |
+++ modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/SVNURL.java 2014-07-01 02:31:49.827306314 +0000 | |
@@ -19,6 +19,12 @@ | |
import org.tmatesoft.svn.util.SVNLogType; | |
import java.io.File; | |
+import java.io.Serializable; | |
+import java.io.IOException; | |
+import java.io.ObjectOutputStream; | |
+import java.io.ObjectInputStream; | |
+import java.io.ObjectStreamException; | |
+import java.io.StreamCorruptedException; | |
import java.net.MalformedURLException; | |
import java.net.URL; | |
import java.util.Map; | |
@@ -45,7 +51,7 @@ | |
* @since 1.2 | |
* @see <a target="_top" href="http://svnkit.com/kb/examples/">Examples</a> | |
*/ | |
-public class SVNURL { | |
+public class SVNURL implements Serializable { | |
/** | |
* Creates a new <b>SVNURL</b> representation from the given url | |
* components. | |
@@ -591,4 +597,24 @@ | |
return path; | |
} | |
-} | |
\ No newline at end of file | |
+ private synchronized void writeObject(ObjectOutputStream s) throws IOException { | |
+ s.writeUTF(toDecodedString()); | |
+ } | |
+ | |
+ private synchronized void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException { | |
+ // use this field temporarily until readResolve is called | |
+ myEncodedPath = s.readUTF(); | |
+ } | |
+ | |
+ private Object readResolve() throws ObjectStreamException { | |
+ try { | |
+ return new SVNURL(myEncodedPath,false); | |
+ } catch (SVNException e) { | |
+ StreamCorruptedException x = new StreamCorruptedException("Failed to load SVNURL"); | |
+ x.initCause(e); | |
+ throw x; | |
+ } | |
+ } | |
+ | |
+ private static final long serialVersionUID = 1L; | |
+} | |
diff -ruN --exclude .git --exclude .svn upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/auth/BasicAuthenticationManager.java modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/auth/BasicAuthenticationManager.java | |
--- upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/auth/BasicAuthenticationManager.java 2014-07-01 02:36:08.776289096 +0000 | |
+++ modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/auth/BasicAuthenticationManager.java 2014-07-01 02:31:49.828306521 +0000 | |
@@ -72,7 +72,8 @@ | |
private String myProxyUserName; | |
private String myProxyPassword; | |
private boolean myIsAuthenticationForced; | |
- | |
+ private ISVNAuthenticationOutcomeListener outcomeListener; | |
+ | |
/** | |
* Creates an auth manager given a user credential - a username | |
* and password. | |
@@ -265,7 +266,13 @@ | |
* @param errorMessage | |
* @param authentication | |
*/ | |
- public void acknowledgeAuthentication(boolean accepted, String kind, String realm, SVNErrorMessage errorMessage, SVNAuthentication authentication) { | |
+ public void acknowledgeAuthentication(boolean accepted, String kind, String realm, SVNErrorMessage errorMessage, SVNAuthentication authentication) throws SVNException { | |
+ if (outcomeListener!=null) | |
+ outcomeListener.acknowledgeAuthentication(accepted,kind,realm,errorMessage,authentication); | |
+ } | |
+ | |
+ public void setAuthenticationOutcomeListener(ISVNAuthenticationOutcomeListener listener) { | |
+ this.outcomeListener = listener; | |
} | |
/** | |
diff -ruN --exclude .git --exclude .svn upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/auth/ISVNAuthenticationManager.java modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/auth/ISVNAuthenticationManager.java | |
--- upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/auth/ISVNAuthenticationManager.java 2014-07-01 02:36:08.772289080 +0000 | |
+++ modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/auth/ISVNAuthenticationManager.java 2014-07-01 02:31:49.828306521 +0000 | |
@@ -233,6 +233,12 @@ | |
public void acknowledgeAuthentication(boolean accepted, String kind, String realm, SVNErrorMessage errorMessage, SVNAuthentication authentication) throws SVNException; | |
/** | |
+ * Sets the listener that gets invoked every time {@link #acknowledgeAuthentication(boolean, String, String, SVNErrorMessage, SVNAuthentication)} | |
+ * is called. | |
+ */ | |
+ public void setAuthenticationOutcomeListener(ISVNAuthenticationOutcomeListener listener); | |
+ | |
+ /** | |
* Acknowledges the specified trust manager. This method is called only when a secure connection is | |
* successfully established with the specified <code>manager</code>. | |
* | |
diff -ruN --exclude .git --exclude .svn upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/auth/ISVNAuthenticationOutcomeListener.java modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/auth/ISVNAuthenticationOutcomeListener.java | |
--- upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/auth/ISVNAuthenticationOutcomeListener.java 1970-01-01 00:00:00.000000000 +0000 | |
+++ modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/auth/ISVNAuthenticationOutcomeListener.java 2014-07-01 02:31:49.828306521 +0000 | |
@@ -0,0 +1,26 @@ | |
+package org.tmatesoft.svn.core.auth; | |
+ | |
+import org.tmatesoft.svn.core.SVNErrorMessage; | |
+import org.tmatesoft.svn.core.SVNException; | |
+ | |
+/** | |
+ * Listens to the outcome of the authentication. | |
+ */ | |
+public interface ISVNAuthenticationOutcomeListener { | |
+ /** | |
+ * Accepts the given authentication if it was successfully accepted by a | |
+ * repository server, or not if authentication failed. As a result the | |
+ * provided credential may be cached (authentication succeeded) or deleted | |
+ * from the cache (authentication failed). | |
+ * | |
+ * @param accepted <span class="javakeyword">true</span> if | |
+ * the credential was accepted by the server, | |
+ * otherwise <span class="javakeyword">false</span> | |
+ * @param kind a credential kind ({@link #PASSWORD} or {@link #SSH} or {@link #USERNAME}) | |
+ * @param realm a repository authentication realm | |
+ * @param errorMessage the reason of the authentication failure | |
+ * @param authentication a user credential to accept/drop | |
+ * @throws SVNException | |
+ */ | |
+ public void acknowledgeAuthentication(boolean accepted, String kind, String realm, SVNErrorMessage errorMessage, SVNAuthentication authentication) throws SVNException; | |
+} | |
diff -ruN --exclude .git --exclude .svn upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/auth/SVNSSLAuthentication.java modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/auth/SVNSSLAuthentication.java | |
--- upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/auth/SVNSSLAuthentication.java 2014-07-01 02:36:08.770289156 +0000 | |
+++ modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/auth/SVNSSLAuthentication.java 2014-07-01 02:31:49.829306276 +0000 | |
@@ -11,7 +11,12 @@ | |
*/ | |
package org.tmatesoft.svn.core.auth; | |
+import org.tmatesoft.svn.core.internal.wc.admin.SVNTranslator; | |
+ | |
+import java.io.ByteArrayOutputStream; | |
import java.io.File; | |
+import java.io.FileInputStream; | |
+import java.io.IOException; | |
import org.tmatesoft.svn.core.SVNURL; | |
import org.tmatesoft.svn.core.internal.wc.SVNFileType; | |
@@ -30,38 +35,59 @@ | |
public static final String MSCAPI = "MSCAPI"; | |
public static final String SSL = "SSL"; | |
- private File myCertificate; | |
+ private byte[] myCertificate; | |
private String myPassword; | |
private String mySSLKind; | |
private String myAlias; | |
private String myCertificatePath; | |
/** | |
- * Creates an SSL credentials object. | |
- * | |
+ * Creates an SSL credentials object. | |
+ * | |
* @deprecated use constructor with SVNURL parameter instead | |
- * | |
+ * | |
* @param certFile user's certificate file | |
- * @param password user's password | |
- * @param storageAllowed to store or not this credential in a | |
- * credentials cache | |
+ * @param password user's password | |
+ * @param storageAllowed to store or not this credential in a | |
+ * credentials cache | |
*/ | |
public SVNSSLAuthentication(File certFile, String password, boolean storageAllowed) { | |
- this(certFile, password, storageAllowed, null, false); | |
+ this(certFile,password,storageAllowed,null,false); | |
} | |
/** | |
- * Creates an SSL credentials object. | |
- * | |
+ * Creates an SSL credentials object. | |
+ * | |
* @param certFile user's certificate file | |
- * @param password user's password | |
- * @param storageAllowed to store or not this credential in a | |
+ * @param password user's password | |
+ * @param storageAllowed to store or not this credential in a | |
* credentials cache | |
* @param url url these credentials are applied to | |
* @since 1.3.1 | |
*/ | |
public SVNSSLAuthentication(File certFile, String password, boolean storageAllowed, SVNURL url, boolean isPartial) { | |
super(ISVNAuthenticationManager.SSL, null, storageAllowed, url, isPartial); | |
+ ByteArrayOutputStream baos = new ByteArrayOutputStream(); | |
+ try { | |
+ FileInputStream in = new FileInputStream(certFile); | |
+ try { | |
+ SVNTranslator.copy(in,baos); | |
+ } finally { | |
+ in.close(); | |
+ } | |
+ } catch (IOException e) { | |
+ throw new RuntimeException("Failed to load certificate from "+certFile,e); | |
+ } | |
+ myCertificate = baos.toByteArray(); | |
+ myPassword = password; | |
+ } | |
+ | |
+ public SVNSSLAuthentication(byte[] certFile, String password, boolean storageAllowed) { | |
+ this(certFile,password,storageAllowed,null,false); | |
+ } | |
+ | |
+ public SVNSSLAuthentication(byte[] certFile, String password, boolean storageAllowed, SVNURL url, boolean isPartial) { | |
+ super(ISVNAuthenticationManager.SSL, null, storageAllowed, url, isPartial); | |
myCertificate = certFile; | |
myPassword = password; | |
mySSLKind = SSL; | |
@@ -87,7 +113,7 @@ | |
* | |
* @return certificate file | |
*/ | |
- public File getCertificateFile() { | |
+ public byte[] getCertificateFile() { | |
return myCertificate; | |
} | |
@@ -106,7 +132,7 @@ | |
if (myCertificatePath != null) { | |
return myCertificatePath; | |
} | |
- return myCertificate.getAbsolutePath(); | |
+ return null; | |
} | |
public void setCertificatePath(String path) { | |
diff -ruN --exclude .git --exclude .svn upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/DAVCommitEditor.java modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/DAVCommitEditor.java | |
--- upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/DAVCommitEditor.java 2014-07-01 02:36:16.770288291 +0000 | |
+++ modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/DAVCommitEditor.java 2014-07-01 02:31:49.834306655 +0000 | |
@@ -169,7 +169,12 @@ | |
} catch (SVNException inner) { | |
} | |
if (err != null) { | |
+ /* | |
SVNErrorManager.error(err, SVNLogType.NETWORK); | |
+ */ | |
+ // this happens if you try to add the same directory twice | |
+ // (yet if you do addDir then openDir, that still fails) | |
+ return; | |
} | |
} | |
throw e; | |
@@ -513,3 +518,4 @@ | |
} | |
} | |
+ | |
diff -ruN --exclude .git --exclude .svn upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/DAVConnection.java modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/DAVConnection.java | |
--- upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/DAVConnection.java 2014-07-01 02:36:16.771288074 +0000 | |
+++ modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/DAVConnection.java 2014-07-01 02:31:49.834306655 +0000 | |
@@ -163,7 +163,7 @@ | |
} catch (SVNException e) { | |
if (e.getErrorMessage() != null && e.getErrorMessage().getErrorCode() == SVNErrorCode.UNSUPPORTED_FEATURE) { | |
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_NOT_IMPLEMENTED, "Server does not support locking features"); | |
- SVNErrorManager.error(err, e.getErrorMessage(), SVNLogType.NETWORK); | |
+ SVNErrorManager.error(err, e.getErrorMessage(), e, SVNLogType.NETWORK); | |
} else if (e.getErrorMessage() != null && e.getErrorMessage().getErrorCode() == SVNErrorCode.FS_NOT_FOUND) { | |
return new SVNLock[0]; | |
} | |
diff -ruN --exclude .git --exclude .svn upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/DAVRepository.java modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/DAVRepository.java | |
--- upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/DAVRepository.java 2014-07-01 02:36:16.773288544 +0000 | |
+++ modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/DAVRepository.java 2014-07-01 02:31:49.836306618 +0000 | |
@@ -609,9 +609,11 @@ | |
path = info.baseline; | |
DAVProppatchHandler handler = new DAVProppatchHandler(); | |
SVNErrorMessage requestError = null; | |
+ SVNException e = null; | |
try { | |
connection.doProppatch(null, path, request, handler, null); | |
- } catch (SVNException e) { | |
+ } catch (SVNException x) { | |
+ e = x; | |
requestError = e.getErrorMessage(); | |
} | |
if (requestError != null || handler.getError() != null){ | |
@@ -623,7 +625,7 @@ | |
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, | |
"DAV request failed; it's possible that the repository's " + | |
"pre-revprop-change hook either failed or is non-existent"); | |
- SVNErrorManager.error(err, requestError, SVNLogType.NETWORK); | |
+ SVNErrorManager.error(err, requestError, e, SVNLogType.NETWORK); | |
} | |
} finally { | |
closeConnection(); | |
diff -ruN --exclude .git --exclude .svn upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/http/HTTPConnection.java modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/http/HTTPConnection.java | |
--- upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/http/HTTPConnection.java 2014-07-01 02:36:16.276288293 +0000 | |
+++ modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/http/HTTPConnection.java 2014-07-01 02:31:49.844306758 +0000 | |
@@ -136,6 +136,8 @@ | |
private int myRequestCount; | |
private HTTPStatus myLastStatus; | |
+ private static final SVNPasswordAuthentication BOGUS_AUTH = new SVNPasswordAuthentication("qaOWQ8w3-byHudson","OGQCrcJ9-byHudson",false); | |
+ | |
public HTTPConnection(SVNRepository repository, String charset, File spoolDirectory, boolean spoolAll) throws SVNException { | |
myRepository = repository; | |
myCharset = charset; | |
@@ -376,6 +378,18 @@ | |
} | |
public HTTPStatus request(String method, String path, HTTPHeader header, InputStream body, int ok1, int ok2, OutputStream dst, DefaultHandler handler, SVNErrorMessage context) throws SVNException { | |
+ try { | |
+ return _request(method,path,header,body,ok1,ok2,dst,handler,context); | |
+ } catch (SVNCancelException e) { | |
+ throw new SVNCancelException(SVNErrorMessage.create(SVNErrorCode.CANCELLED, method+' '+path+" failed"), e); // retain the type of the exception | |
+ } catch (RuntimeException e) { | |
+ throw new SVNException(SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, method+' '+path+" failed").initCause(e)); | |
+ } catch (SVNException e) { | |
+ throw new SVNException(SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, method+' '+path+" failed").initCause(e)); | |
+ } | |
+ } | |
+ | |
+ private HTTPStatus _request(String method, String path, HTTPHeader header, InputStream body, int ok1, int ok2, OutputStream dst, DefaultHandler handler, SVNErrorMessage context) throws SVNException { | |
myLastStatus = null; | |
myRequestCount++; | |
@@ -393,7 +407,10 @@ | |
SVNAuthentication httpAuth = myLastValidAuth; | |
boolean isAuthForced = authManager != null ? authManager.isAuthenticationForced() : false; | |
if (httpAuth == null && isAuthForced) { | |
- httpAuth = authManager.getFirstAuthentication(ISVNAuthenticationManager.PASSWORD, sslRealm, null); | |
+ // send a bogus credential to force the server to reject access. That causes the server to send out | |
+ // 401, which enables us to learn the realm name. If we just send in the corret username/password first, | |
+ // then we won't be able to learn the security realm that the credential is supposed to be fore. | |
+ httpAuth = BOGUS_AUTH; | |
myChallengeCredentials = new HTTPBasicAuthentication((SVNPasswordAuthentication)httpAuth, myCharset); | |
} | |
String realm = null; | |
@@ -490,7 +507,7 @@ | |
keyManager.acknowledgeAndClearAuthentication(sslErr); | |
} | |
err = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, ssl); | |
- continue; | |
+ // continue; http://svnkit.com/tracker/view.php?id=301 - Kohsuke | |
} catch (IOException e) { | |
myRepository.getDebugLog().logFine(SVNLogType.NETWORK, e); | |
if (e instanceof SocketTimeoutException) { | |
@@ -612,7 +629,8 @@ | |
try { | |
myChallengeCredentials = HTTPAuthentication.parseAuthParameters(authHeaderValues, myChallengeCredentials, myCharset, authTypes, authManager, myRequestCount); | |
} catch (SVNException svne) { | |
- err = svne.getErrorMessage(); | |
+ myRepository.getDebugLog().logFine(SVNLogType.NETWORK, svne); | |
+ err = svne.getErrorMessage(); | |
break; | |
} | |
@@ -672,7 +690,7 @@ | |
realm = realm == null ? "" : " " + realm; | |
realm = composeRealm(realm); | |
- if (httpAuth == null) { | |
+ if (httpAuth == null || httpAuth==BOGUS_AUTH) { | |
httpAuth = authManager.getFirstAuthentication(ISVNAuthenticationManager.PASSWORD, realm, myRepository.getLocation()); | |
} else if (authAttempts >= requestAttempts) { | |
BasicAuthenticationManager.acknowledgeAuthentication(false, ISVNAuthenticationManager.PASSWORD, realm, request.getErrorMessage(), httpAuth, myRepository.getLocation(), authManager); | |
@@ -750,12 +768,13 @@ | |
close(); | |
if (err != null && err.getErrorCode().getCategory() != SVNErrorCode.RA_DAV_CATEGORY && | |
err.getErrorCode() != SVNErrorCode.UNSUPPORTED_FEATURE) { | |
- SVNErrorManager.error(err, SVNLogType.NETWORK); | |
+ SVNErrorManager.error(err.wrap(method+" request failed on '"+path+"'"), SVNLogType.NETWORK); | |
} | |
// err2 is another default context... | |
- myRepository.getDebugLog().logFine(SVNLogType.NETWORK, new Exception(err.getMessage())); | |
- SVNErrorMessage err2 = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, "{0} request failed on ''{1}''", new Object[] {method, path}, err.getType(), err.getCause()); | |
- SVNErrorManager.error(err, err2, SVNLogType.NETWORK); | |
+ myRepository.getDebugLog().logFine(SVNLogType.NETWORK, err); | |
+ SVNErrorMessage err2 = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, "{0} request failed on ''{1}''", new Object[] {method, path}, err.getType(), err); | |
+ err2.setChildErrorMessage(err); | |
+ SVNErrorManager.error(err2, SVNLogType.NETWORK); | |
return null; | |
} | |
diff -ruN --exclude .git --exclude .svn upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/http/HTTPRequest.java modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/http/HTTPRequest.java | |
--- upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/http/HTTPRequest.java 2014-07-01 02:36:16.294288360 +0000 | |
+++ modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/http/HTTPRequest.java 2014-07-01 02:31:49.846306268 +0000 | |
@@ -229,6 +229,10 @@ | |
if (header == null) { | |
return -1; | |
} | |
+ String connection = header.getFirstHeaderValue("Connection"); | |
+ if (connection != null && connection.indexOf("close")>=0) { | |
+ return -1; | |
+ } | |
String keepAlive = header.getFirstHeaderValue("Keep-Alive"); | |
if (keepAlive == null && status.isHTTP11()) { | |
// HTTP/1.1 | |
@@ -250,7 +254,7 @@ | |
} | |
} | |
} | |
- return -1; | |
+ return -1; // no keep alive | |
} | |
// HTTP/1.1 | |
String[] fields = keepAlive.split(","); | |
diff -ruN --exclude .git --exclude .svn upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/http/HTTPSSLKeyManager.java modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/http/HTTPSSLKeyManager.java | |
--- upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/http/HTTPSSLKeyManager.java 2014-07-01 02:36:16.278288309 +0000 | |
+++ modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/http/HTTPSSLKeyManager.java 2014-07-01 02:31:49.846306268 +0000 | |
@@ -11,6 +11,7 @@ | |
*/ | |
package org.tmatesoft.svn.core.internal.io.dav.http; | |
+import java.io.ByteArrayInputStream; | |
import java.io.File; | |
import java.io.IOException; | |
import java.io.InputStream; | |
@@ -76,7 +77,7 @@ | |
} | |
} catch (Throwable th) { | |
SVNDebugLog.getDefaultLog().logFine(SVNLogType.NETWORK, th); | |
- throw new SVNException(SVNErrorMessage.create(SVNErrorCode.RA_NOT_AUTHORIZED, "Problems, when connecting with ms capi! "+th.getMessage(), null, SVNErrorMessage.TYPE_ERROR, th), th); | |
+ throw new SVNException(SVNErrorMessage.create(SVNErrorCode.RA_NOT_AUTHORIZED, "Problems, when connecting with ms capi! "+th.getMessage(), null, SVNErrorMessage.TYPE_ERROR, th)); | |
} | |
KeyManagerFactory kmf = null; | |
@@ -91,7 +92,7 @@ | |
} | |
catch (Throwable th) { | |
SVNDebugLog.getDefaultLog().logFine(SVNLogType.NETWORK, th); | |
- throw new SVNException(SVNErrorMessage.create(SVNErrorCode.RA_NOT_AUTHORIZED, "MS Capi error: "+th.getMessage()), th); | |
+ throw new SVNException(SVNErrorMessage.create(SVNErrorCode.RA_NOT_AUTHORIZED, "MS Capi error: "+th.getMessage()).initCause(th)); | |
} | |
} | |
return result; | |
@@ -107,12 +108,10 @@ | |
if (clientCertPassword != null) { | |
passphrase = clientCertPassword.toCharArray(); | |
} | |
- KeyManager[] result = null; | |
- KeyStore keyStore = null; | |
if (clientCertFile != null && clientCertFile.getName().startsWith(SVNSSLAuthentication.MSCAPI)) { | |
SVNDebugLog.getDefaultLog().logError(SVNLogType.CLIENT,"using mscapi"); | |
try { | |
- keyStore = KeyStore.getInstance("Windows-MY"); | |
+ KeyStore keyStore = KeyStore.getInstance("Windows-MY"); | |
SVNDebugLog.getDefaultLog().logFine(SVNLogType.NETWORK, "using my windows store"); | |
if (keyStore != null) { | |
keyStore.load(null, null); | |
@@ -122,54 +121,62 @@ | |
kmf = KeyManagerFactory.getInstance("SunX509"); | |
if (kmf != null) { | |
kmf.init(keyStore, passphrase); | |
- result = kmf.getKeyManagers(); | |
+ return kmf.getKeyManagers(); | |
} | |
} | |
- return result; | |
+ return null; | |
} | |
catch (Throwable th) { | |
SVNDebugLog.getDefaultLog().logFine(SVNLogType.NETWORK, th); | |
- throw new SVNException(SVNErrorMessage.create(SVNErrorCode.RA_NOT_AUTHORIZED, "loadClientCertificate ms capi with file - should not be called: "+th.getMessage(), null, SVNErrorMessage.TYPE_ERROR, th), th); | |
+ throw new SVNException(SVNErrorMessage.create(SVNErrorCode.RA_NOT_AUTHORIZED, "loadClientCertificate ms capi with file - should not be called: "+th.getMessage(), null, SVNErrorMessage.TYPE_ERROR, th)); | |
} | |
} | |
final InputStream is = SVNFileUtil.openFileForReading(clientCertFile, SVNLogType.NETWORK); | |
+ return loadClientCertificate(is,clientCertPassword); | |
+ } | |
+ | |
+ public static KeyManager[] loadClientCertificate(InputStream clientCertFile, String clientCertPassword) throws SVNException { | |
+ char[] passphrase = null; | |
+ if (clientCertPassword != null) { | |
+ passphrase = clientCertPassword.toCharArray(); | |
+ } | |
+ KeyStore keyStore; | |
try { | |
keyStore = KeyStore.getInstance("PKCS12"); | |
if (keyStore != null) { | |
- keyStore.load(is, passphrase); | |
+ keyStore.load(clientCertFile, passphrase); | |
} | |
} | |
catch (Throwable th) { | |
SVNDebugLog.getDefaultLog().logFine(SVNLogType.NETWORK, th); | |
- throw new SVNException(SVNErrorMessage.create(SVNErrorCode.RA_NOT_AUTHORIZED, th.getMessage(), null, SVNErrorMessage.TYPE_ERROR, th), th); | |
+ throw new SVNException(SVNErrorMessage.create(SVNErrorCode.RA_NOT_AUTHORIZED, th.getMessage(), null, SVNErrorMessage.TYPE_ERROR, th)); | |
} | |
finally { | |
- SVNFileUtil.closeFile(is); | |
+ SVNFileUtil.closeFile(clientCertFile); | |
} | |
- KeyManagerFactory kmf = null; | |
if (keyStore != null) { | |
try { | |
- kmf = KeyManagerFactory.getInstance("SunX509"); | |
+ KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); | |
if (kmf != null) { | |
kmf.init(keyStore, passphrase); | |
- result = kmf.getKeyManagers(); | |
+ return kmf.getKeyManagers(); | |
} | |
} | |
catch (Throwable th) { | |
SVNDebugLog.getDefaultLog().logFine(SVNLogType.NETWORK, th); | |
- throw new SVNException(SVNErrorMessage.create(SVNErrorCode.RA_NOT_AUTHORIZED, th.getMessage()), th); | |
+ throw new SVNException(SVNErrorMessage.create(SVNErrorCode.RA_NOT_AUTHORIZED, th)); | |
} | |
} | |
- return result; | |
+ return null; | |
} | |
public KeyManager[] loadClientCertificate(SVNSSLAuthentication sslAuthentication) throws SVNException { | |
String clientCertPassword = sslAuthentication.getPassword(); | |
String clientCertPath = sslAuthentication.getCertificatePath(); | |
- File clientCertFile = sslAuthentication.getCertificateFile(); | |
+ byte[] clientCertFile = sslAuthentication.getCertificateFile(); | |
char[] passphrase = clientCertPassword == null || clientCertPassword.length() == 0 ? new char[0] : clientCertPassword.toCharArray(); | |
String realm = clientCertPath; | |
@@ -177,7 +184,7 @@ | |
KeyManager[] result = null; | |
KeyStore keyStore = null; | |
- if (clientCertFile != null && clientCertFile.getName().startsWith(SVNSSLAuthentication.MSCAPI)) { | |
+ if (clientCertPath != null && clientCertPath.startsWith(SVNSSLAuthentication.MSCAPI)) { | |
SVNDebugLog.getDefaultLog().logError(SVNLogType.CLIENT,"using mscapi"); | |
try { | |
keyStore = KeyStore.getInstance("Windows-MY"); | |
@@ -203,7 +210,7 @@ | |
while(true) { | |
try { | |
- final InputStream is = SVNFileUtil.openFileForReading(clientCertFile, SVNLogType.NETWORK); | |
+ final InputStream is = new ByteArrayInputStream(clientCertFile); | |
try { | |
keyStore = KeyStore.getInstance("PKCS12"); | |
if (keyStore != null) { | |
@@ -433,7 +440,7 @@ | |
((ISVNSSLPasspharsePromptSupport) authenticationManager).isSSLPassphrasePromtSupported()) { | |
keyManagers = loadClientCertificate(myAuthentication); | |
} else { | |
- keyManagers = loadClientCertificate(myAuthentication.getCertificateFile(), myAuthentication.getPassword()); | |
+ keyManagers = loadClientCertificate(new ByteArrayInputStream(myAuthentication.getCertificateFile()), myAuthentication.getPassword()); | |
} | |
} | |
@@ -466,4 +473,4 @@ | |
private static boolean isMSCAPI(SVNSSLAuthentication sslAuthentication) { | |
return sslAuthentication != null && SVNSSLAuthentication.MSCAPI.equals(sslAuthentication.getSSLKind()); | |
} | |
-} | |
\ No newline at end of file | |
+} | |
diff -ruN --exclude .git --exclude .svn upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/fs/FSCommitter.java modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/fs/FSCommitter.java | |
--- upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/fs/FSCommitter.java 2014-07-01 02:36:15.919288377 +0000 | |
+++ modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/fs/FSCommitter.java 2014-07-01 02:31:49.848306412 +0000 | |
@@ -350,6 +350,7 @@ | |
} catch (SVNException svne) { | |
SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.REPOS_POST_COMMIT_HOOK_FAILED, | |
"Commit succeeded, but post-commit hook failed", SVNErrorMessage.TYPE_WARNING); | |
+ errorMessage.initCause(svne); | |
SVNErrorMessage childErr = svne.getErrorMessage(); | |
childErr.setDontShowErrorCode(true); | |
errorMessage.setChildErrorMessage(childErr); | |
diff -ruN --exclude .git --exclude .svn upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/fs/FSFS.java modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/fs/FSFS.java | |
--- upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/fs/FSFS.java 2014-07-01 02:36:15.368288289 +0000 | |
+++ modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/fs/FSFS.java 2014-07-01 02:31:49.850307040 +0000 | |
@@ -943,7 +943,7 @@ | |
} catch (IOException e) { | |
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, | |
"Error writing repository UUID to ''{0}''", getUUIDFile()); | |
- err.setChildErrorMessage(SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e.getLocalizedMessage())); | |
+ err.initCause(e); | |
SVNErrorManager.error(err, SVNLogType.FSFS); | |
} finally { | |
SVNFileUtil.closeFile(uuidOS); | |
@@ -1377,7 +1377,7 @@ | |
FSHooks.runPostUnlockHook(myRepositoryRoot, paths, username); | |
} catch (SVNException svne) { | |
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.REPOS_POST_UNLOCK_HOOK_FAILED, "Unlock succeeded, but post-unlock hook failed"); | |
- err.setChildErrorMessage(svne.getErrorMessage()); | |
+ err.initCause(svne); | |
SVNErrorManager.error(err, svne, SVNLogType.FSFS); | |
} | |
} | |
@@ -1421,6 +1421,7 @@ | |
FSHooks.runPostLockHook(myRepositoryRoot, paths, username); | |
} catch (SVNException svne) { | |
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.REPOS_POST_LOCK_HOOK_FAILED, "Lock succeeded, but post-lock hook failed"); | |
+ err.initCause(svne); | |
err.setChildErrorMessage(svne.getErrorMessage()); | |
SVNErrorManager.error(err, svne, SVNLogType.FSFS); | |
} | |
diff -ruN --exclude .git --exclude .svn upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/fs/FSRepository.java modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/fs/FSRepository.java | |
--- upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/fs/FSRepository.java 2014-07-01 02:36:15.903288752 +0000 | |
+++ modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/fs/FSRepository.java 2014-07-01 02:31:49.855307156 +0000 | |
@@ -757,8 +757,8 @@ | |
try { | |
openRepositoryRoot(); | |
} catch (SVNException svne) { | |
- SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_LOCAL_REPOS_OPEN_FAILED, "Unable to open repository ''{0}''", getLocation().toString()); | |
- err.setChildErrorMessage(svne.getErrorMessage()); | |
+ SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_LOCAL_REPOS_OPEN_FAILED, "Unable to open repository ''{0}''", getLocation().toDecodedString()); | |
+ err.initCause(svne); | |
SVNErrorManager.error(err.wrap("Unable to open an ra_local session to URL"), SVNLogType.FSFS); | |
} | |
} | |
@@ -993,4 +993,4 @@ | |
return myLogDriver; | |
} | |
-} | |
\ No newline at end of file | |
+} | |
diff -ruN --exclude .git --exclude .svn upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/SVNEditModeReader.java modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/SVNEditModeReader.java | |
--- upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/SVNEditModeReader.java 2014-07-01 02:36:12.549288573 +0000 | |
+++ modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/SVNEditModeReader.java 2014-07-01 02:31:49.863306491 +0000 | |
@@ -217,6 +217,7 @@ | |
public void driveEditor() throws SVNException { | |
while (!myDone) { | |
SVNErrorMessage error = null; | |
+ Exception errorCause = null; | |
List items = readTuple("wl", false); | |
String commandName = SVNReader.getString(items, 0); | |
String template = (String) COMMANDS_MAP.get(commandName); | |
@@ -231,6 +232,7 @@ | |
processCommand(commandName, parameters); | |
} catch (SVNException e) { | |
error = e.getErrorMessage(); | |
+ errorCause = e; | |
} | |
} | |
if (error != null) { | |
@@ -245,7 +247,7 @@ | |
myConnection.writeError(error.getChildErrorMessage()); | |
break; | |
} | |
- SVNErrorManager.error(error, SVNLogType.NETWORK); | |
+ SVNErrorManager.error(error, errorCause, SVNLogType.NETWORK); | |
} | |
} | |
diff -ruN --exclude .git --exclude .svn upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/SVNReader.java modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/SVNReader.java | |
--- upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/SVNReader.java 2014-07-01 02:36:12.679289065 +0000 | |
+++ modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/SVNReader.java 2014-07-01 02:31:49.864307144 +0000 | |
@@ -469,7 +469,7 @@ | |
try { | |
r = is.read(); | |
if (r < 0) { | |
- SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_SVN_MALFORMED_DATA); | |
+ SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_SVN_CONNECTION_CLOSED); | |
SVNErrorManager.error(err, SVNLogType.NETWORK); | |
} | |
} catch (IOException e) { | |
diff -ruN --exclude .git --exclude .svn upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/SVNRepositoryImpl.java modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/SVNRepositoryImpl.java | |
--- upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/SVNRepositoryImpl.java 2014-07-01 02:36:12.676288145 +0000 | |
+++ modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/SVNRepositoryImpl.java 2014-07-01 02:31:49.865306982 +0000 | |
@@ -1375,7 +1375,7 @@ | |
private void handleUnsupportedCommand(SVNException e, String message) throws SVNException { | |
if (e.getErrorMessage() != null && e.getErrorMessage().getErrorCode() == SVNErrorCode.RA_SVN_UNKNOWN_CMD) { | |
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_NOT_IMPLEMENTED, message); | |
- SVNErrorManager.error(err, e.getErrorMessage(), SVNLogType.NETWORK); | |
+ SVNErrorManager.error(err, e.getErrorMessage(), e, SVNLogType.NETWORK); | |
} | |
throw e; | |
} | |
diff -ruN --exclude .git --exclude .svn upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/ssh/SshSession.java modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/ssh/SshSession.java | |
--- upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/ssh/SshSession.java 2014-07-01 02:36:12.552288795 +0000 | |
+++ modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/ssh/SshSession.java 2014-07-01 02:31:49.868307075 +0000 | |
@@ -19,7 +19,11 @@ | |
public void close() { | |
mySession.close(); | |
- waitForCondition(ChannelCondition.CLOSED, 0); | |
+ try { | |
+ waitForCondition(ChannelCondition.CLOSED, 0); | |
+ } catch (InterruptedException e) { | |
+ // TODO: what to do here? | |
+ } | |
myOwner.sessionClosed(this); | |
} | |
@@ -43,7 +47,7 @@ | |
return mySession.getExitSignal(); | |
} | |
- public void waitForCondition(int code, long timeout) { | |
+ public void waitForCondition(int code, long timeout) throws InterruptedException { | |
mySession.waitForCondition(code, timeout); | |
} | |
diff -ruN --exclude .git --exclude .svn upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/util/jna/SVNLinuxUtil.java modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/util/jna/SVNLinuxUtil.java | |
--- upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/util/jna/SVNLinuxUtil.java 2014-07-01 02:36:21.522288054 +0000 | |
+++ modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/util/jna/SVNLinuxUtil.java 2014-07-01 02:31:49.880306282 +0000 | |
@@ -463,4 +463,4 @@ | |
return 88; | |
} | |
-} | |
\ No newline at end of file | |
+} | |
diff -ruN --exclude .git --exclude .svn upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/DefaultSVNAuthenticationManager.java modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/DefaultSVNAuthenticationManager.java | |
--- upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/DefaultSVNAuthenticationManager.java 2014-07-01 02:36:18.649288477 +0000 | |
+++ modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/DefaultSVNAuthenticationManager.java 2014-07-01 02:31:49.883306432 +0000 | |
@@ -17,11 +17,13 @@ | |
import javax.net.ssl.TrustManager; | |
+import com.trilead.ssh2.crypto.Base64; | |
import org.tmatesoft.svn.core.SVNAuthenticationException; | |
import org.tmatesoft.svn.core.SVNErrorCode; | |
import org.tmatesoft.svn.core.SVNErrorMessage; | |
import org.tmatesoft.svn.core.SVNException; | |
import org.tmatesoft.svn.core.SVNURL; | |
+import org.tmatesoft.svn.core.auth.*; | |
import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager; | |
import org.tmatesoft.svn.core.auth.ISVNAuthenticationProvider; | |
import org.tmatesoft.svn.core.auth.ISVNProxyManager; | |
@@ -57,6 +59,8 @@ | |
private SVNAuthentication myLastLoadedAuth; | |
private boolean myIsAuthenticationForced; | |
+ private ISVNAuthenticationOutcomeListener outcomeListener; | |
+ | |
public DefaultSVNAuthenticationManager(File configDirectory, boolean storeAuth, String userName, String password) { | |
this(configDirectory, storeAuth, userName, password, null, null); | |
} | |
@@ -100,7 +104,11 @@ | |
public void setAuthenticationProvider(ISVNAuthenticationProvider provider) { | |
// add provider to list | |
- myProviders[3] = provider; | |
+ myProviders[3] = provider; | |
+ | |
+ // this hack makes it easier for ISVNAuthenticationProvider to get notified of the outcome. | |
+ if (provider instanceof ISVNAuthenticationOutcomeListener) | |
+ setAuthenticationOutcomeListener((ISVNAuthenticationOutcomeListener) provider); | |
} | |
protected File getConfigDirectory() { | |
@@ -174,7 +182,7 @@ | |
return auth; | |
} | |
if (i == 3) { | |
- SVNErrorManager.cancel("authentication cancelled", SVNLogType.WC); | |
+ SVNErrorManager.cancel("No credential to try. Authentication failed", SVNLogType.WC); | |
} | |
} | |
// end of probe. if we were asked for username for ssh and didn't find anything | |
@@ -212,7 +220,7 @@ | |
return auth; | |
} | |
if (i == 3) { | |
- SVNErrorManager.cancel("authentication cancelled", SVNLogType.WC); | |
+ SVNErrorManager.cancel("No credential to try. Authentication failed", SVNLogType.WC); | |
} | |
} | |
SVNErrorManager.authenticationFailed("Authentication required for ''{0}''", realm); | |
@@ -220,6 +228,8 @@ | |
} | |
public void acknowledgeAuthentication(boolean accepted, String kind, String realm, SVNErrorMessage errorMessage, SVNAuthentication authentication) throws SVNException { | |
+ if (outcomeListener!=null) | |
+ outcomeListener.acknowledgeAuthentication(accepted,kind,realm,errorMessage,authentication); | |
if (!accepted) { | |
myPreviousErrorMessage = errorMessage; | |
myPreviousAuthentication = authentication; | |
@@ -239,6 +249,10 @@ | |
} | |
} | |
+ public void setAuthenticationOutcomeListener(ISVNAuthenticationOutcomeListener listener) { | |
+ this.outcomeListener = listener; | |
+ } | |
+ | |
public void acknowledgeTrustManager(TrustManager manager) { | |
} | |
diff -ruN --exclude .git --exclude .svn upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/DefaultSVNPersistentAuthenticationProvider.java modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/DefaultSVNPersistentAuthenticationProvider.java | |
--- upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/DefaultSVNPersistentAuthenticationProvider.java 2014-07-01 02:36:18.650288187 +0000 | |
+++ modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/DefaultSVNPersistentAuthenticationProvider.java 2014-07-01 02:31:49.885306871 +0000 | |
@@ -18,10 +18,13 @@ | |
import org.tmatesoft.svn.util.SVNLogType; | |
import java.io.File; | |
+import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.Map; | |
+import com.trilead.ssh2.crypto.Base64; | |
+ | |
/** | |
* @author TMate Software Ltd. | |
* @version 1.3 | |
@@ -491,6 +494,7 @@ | |
if (sslAuth.getCertificateFile() != null) { | |
String path = sslAuth.getCertificatePath(); | |
values.put("key", path); | |
+ values.put("cert", new String(Base64.encode(sslAuth.getCertificateFile()))); | |
modified = true; | |
} | |
} else if (SVNSSLAuthentication.MSCAPI.equals(sslAuth.getSSLKind())) { | |
diff -ruN --exclude .git --exclude .svn upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/SVNAdminUtil.java modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/SVNAdminUtil.java | |
--- upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/SVNAdminUtil.java 2014-07-01 02:36:17.719288562 +0000 | |
+++ modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/SVNAdminUtil.java 2014-07-01 02:31:49.890306548 +0000 | |
@@ -238,6 +238,7 @@ | |
SVNErrorManager.error(err, e, SVNLogType.WC); | |
} catch (SVNException svne) { | |
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.WC_NOT_DIRECTORY, "''{0}'' is not a working copy", path); | |
+ err.initCause(svne); | |
err.setChildErrorMessage(svne.getErrorMessage()); | |
SVNErrorManager.error(err, svne, Level.FINEST, SVNLogType.WC); | |
} finally { | |
@@ -322,4 +323,4 @@ | |
return null; | |
} | |
-} | |
\ No newline at end of file | |
+} | |
diff -ruN --exclude .git --exclude .svn upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/SVNErrorManager.java modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/SVNErrorManager.java | |
--- upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/SVNErrorManager.java 2014-07-01 02:36:17.768288050 +0000 | |
+++ modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/SVNErrorManager.java 2014-07-01 02:31:49.895307178 +0000 | |
@@ -78,9 +78,9 @@ | |
SVNDebugLog.getDefaultLog().log(logType, cause, logLevel); | |
} | |
if (err.getErrorCode() == SVNErrorCode.CANCELLED) { | |
- throw new SVNCancelException(err); | |
+ throw new SVNCancelException(err,cause); | |
} else if (err.getErrorCode().isAuthentication()) { | |
- throw new SVNAuthenticationException(err); | |
+ throw new SVNAuthenticationException(err,cause); | |
} else { | |
throw new SVNException(err, cause); | |
} | |
diff -ruN --exclude .git --exclude .svn upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/SVNEventFactory.java modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/SVNEventFactory.java | |
--- upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/SVNEventFactory.java 2014-07-01 02:36:17.736287555 +0000 | |
+++ modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/SVNEventFactory.java 2014-07-01 02:31:49.896306867 +0000 | |
@@ -17,6 +17,7 @@ | |
import org.tmatesoft.svn.core.SVNLock; | |
import org.tmatesoft.svn.core.SVNMergeRange; | |
import org.tmatesoft.svn.core.SVNNodeKind; | |
+import org.tmatesoft.svn.core.internal.wc.admin.SVNAdminAreaInfo; | |
import org.tmatesoft.svn.core.SVNProperties; | |
import org.tmatesoft.svn.core.io.SVNRepository; | |
import org.tmatesoft.svn.core.wc.SVNEvent; | |
@@ -64,4 +65,4 @@ | |
public static SVNEvent createSVNEvent(File file, SVNNodeKind kind , String mimetype, long revision, SVNEventAction action, SVNEventAction expected, SVNErrorMessage error, SVNMergeRange range, SVNProperties revisionProperties, String propertyName) { | |
return new SVNEvent(file, kind, mimetype, revision, SVNStatusType.INAPPLICABLE, SVNStatusType.INAPPLICABLE, SVNStatusType.LOCK_INAPPLICABLE, null, action, expected, error, range, null, revisionProperties, propertyName); | |
} | |
-} | |
\ No newline at end of file | |
+} | |
diff -ruN --exclude .git --exclude .svn upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/admin/SVNAdminArea.java modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/admin/SVNAdminArea.java | |
--- upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/admin/SVNAdminArea.java 2014-07-01 02:36:18.667287693 +0000 | |
+++ modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/admin/SVNAdminArea.java 2014-07-01 02:31:49.908306504 +0000 | |
@@ -597,7 +597,7 @@ | |
} else if (e instanceof Error) { | |
throw (Error) e; | |
} | |
- throw new SVNException(SVNErrorMessage.create(SVNErrorCode.UNKNOWN), e); | |
+ throw new SVNException(SVNErrorMessage.create(SVNErrorCode.UNKNOWN, e)); | |
} | |
runner.logCompleted(this); | |
// delete all logs, there shoudn't be left unprocessed. | |
diff -ruN --exclude .git --exclude .svn upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/admin/SVNLogRunner.java modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/admin/SVNLogRunner.java | |
--- upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/admin/SVNLogRunner.java 2014-07-01 02:36:18.661288549 +0000 | |
+++ modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/admin/SVNLogRunner.java 2014-07-01 02:31:49.912306910 +0000 | |
@@ -193,8 +193,8 @@ | |
} | |
} catch (SVNException svne) { | |
SVNErrorCode code = count <= 1 ? SVNErrorCode.WC_BAD_ADM_LOG_START : SVNErrorCode.WC_BAD_ADM_LOG; | |
- SVNErrorMessage err = SVNErrorMessage.create(code, "Error removing lock from entry for ''{0}''", fileName); | |
- error = new SVNException(err, svne); | |
+ SVNErrorMessage err = SVNErrorMessage.create(code, "Error removing lock from entry for ''{0}''", fileName).initCause(svne); | |
+ error = new SVNException(err); | |
} | |
} else if (SVNLog.DELETE_CHANGELIST.equals(name)) { | |
try { | |
@@ -205,8 +205,8 @@ | |
} catch (SVNException svne) { | |
SVNErrorCode code = count <= 1 ? SVNErrorCode.WC_BAD_ADM_LOG_START : SVNErrorCode.WC_BAD_ADM_LOG; | |
SVNErrorMessage err = SVNErrorMessage.create(code, | |
- "Error removing changelist from entry ''{0}''", fileName); | |
- error = new SVNException(err, svne); | |
+ "Error removing changelist from entry ''{0}''", fileName).initCause(svne); | |
+ error = new SVNException(err); | |
} | |
} else if (SVNLog.DELETE.equals(name)) { | |
File file = adminArea.getFile(fileName); | |
@@ -221,7 +221,7 @@ | |
SVNFileUtil.rename(src, dst); | |
} catch (SVNException svne) { | |
if (!myIsRerun || src.exists()) { | |
- error = new SVNException(svne.getErrorMessage().wrap("Can't move source to dest"), svne); | |
+ error = new SVNException(svne.getErrorMessage().wrap("Can't move source to dest").initCause(svne)); | |
} | |
} | |
} else if (SVNLog.APPEND.equals(name)) { | |
@@ -241,8 +241,8 @@ | |
} | |
} catch (IOException e) { | |
if (!myIsRerun || !(e instanceof FileNotFoundException)) { | |
- SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "Cannot write to ''{0}'': {1}", new Object[] {dst, e.getLocalizedMessage()}); | |
- error = new SVNException(err, e); | |
+ SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "Cannot write to ''{0}'': {1}", new Object[] {dst, e.getLocalizedMessage()}).initCause(e); | |
+ error = new SVNException(err); | |
} | |
} catch (SVNException svne) { | |
if (!myIsRerun || src.exists()) { | |
diff -ruN --exclude .git --exclude .svn upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/admin/SVNXMLAdminAreaFactory.java modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/admin/SVNXMLAdminAreaFactory.java | |
--- upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/admin/SVNXMLAdminAreaFactory.java 2014-07-01 02:36:18.678288155 +0000 | |
+++ modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/admin/SVNXMLAdminAreaFactory.java 2014-07-01 02:31:49.915306367 +0000 | |
@@ -119,7 +119,7 @@ | |
SVNErrorManager.error(err, e, SVNLogType.WC); | |
} catch (SVNException svne) { | |
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.WC_NOT_DIRECTORY, "''{0}'' is not a working copy", path); | |
- err.setChildErrorMessage(svne.getErrorMessage()); | |
+ err.initCause(svne); | |
SVNErrorManager.error(err, svne, Level.FINEST, SVNLogType.WC); | |
} finally { | |
SVNFileUtil.closeFile(reader); | |
diff -ruN --exclude .git --exclude .svn upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc16/SVNUpdateClient16.java modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc16/SVNUpdateClient16.java | |
--- upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc16/SVNUpdateClient16.java 2014-07-01 02:36:10.241288794 +0000 | |
+++ modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc16/SVNUpdateClient16.java 2014-07-01 02:31:49.923306613 +0000 | |
@@ -1710,7 +1710,7 @@ | |
} catch (SVNException svne) { | |
File target = new File(externalDiff.owner, targetDir); | |
SVNEvent event = SVNEventFactory.createSVNEvent(target, SVNNodeKind.UNKNOWN, null, SVNRepository.INVALID_REVISION, SVNEventAction.FAILED_EXTERNAL, SVNEventAction.UPDATE_EXTERNAL, svne | |
- .getErrorMessage(), null); | |
+ .getErrorMessage(), null).setExternalInfo(externalDiff.oldExternal,externalDiff.newExternal); | |
dispatchEvent(event); | |
} | |
} | |
@@ -1745,7 +1745,7 @@ | |
} | |
SVNRevision[] revs = getExternalsHandler().handleExternal(target, newURL, externalRevision, externalPegRevision, externalDefinition, SVNRevision.UNDEFINED); | |
if (revs == null) { | |
- SVNEvent event = SVNEventFactory.createSVNEvent(target, SVNNodeKind.DIR, null, SVNRepository.INVALID_REVISION, SVNEventAction.SKIP, SVNEventAction.UPDATE_EXTERNAL, null, null); | |
+ SVNEvent event = SVNEventFactory.createSVNEvent(target, SVNNodeKind.DIR, null, SVNRepository.INVALID_REVISION, SVNEventAction.SKIP, SVNEventAction.UPDATE_EXTERNAL, null, null).setExternalInfo(externalDiff.oldExternal,externalDiff.newExternal); | |
dispatchEvent(event); | |
return; | |
} | |
@@ -1779,14 +1779,14 @@ | |
if (oldURL == null) { | |
if (kind == SVNNodeKind.DIR) { | |
target.mkdirs(); | |
- dispatchEvent(SVNEventFactory.createSVNEvent(target, SVNNodeKind.DIR, null, SVNRepository.INVALID_REVISION, SVNEventAction.UPDATE_EXTERNAL, null, null, null)); | |
+ dispatchEvent(SVNEventFactory.createSVNEvent(target, SVNNodeKind.DIR, null, SVNRepository.INVALID_REVISION, SVNEventAction.UPDATE_EXTERNAL, null, null, null).setExternalInfo(externalDiff.oldExternal,externalDiff.newExternal)); | |
if (externalDiff.isExport) { | |
doExport(newURL, target, externalPegRevision, externalRevision, null, true, SVNDepth.INFINITY); | |
} else { | |
doCheckout(newURL, target, externalPegRevision, externalRevision, SVNDepth.INFINITY, false); | |
} | |
} else if (kind == SVNNodeKind.FILE) { | |
- dispatchEvent(SVNEventFactory.createSVNEvent(target, SVNNodeKind.FILE, null, SVNRepository.INVALID_REVISION, SVNEventAction.UPDATE_EXTERNAL, null, null, null)); | |
+ dispatchEvent(SVNEventFactory.createSVNEvent(target, SVNNodeKind.FILE, null, SVNRepository.INVALID_REVISION, SVNEventAction.UPDATE_EXTERNAL, null, null, null).setExternalInfo(externalDiff.oldExternal,externalDiff.newExternal)); | |
if (externalDiff.isExport) { | |
boolean ignoreExternals = isIgnoreExternals(); | |
setIgnoreExternals(true); | |
@@ -1826,7 +1826,7 @@ | |
} | |
} | |
if (fileType == SVNFileType.DIRECTORY && !empty) { | |
- dispatchEvent(SVNEventFactory.createSVNEvent(target, SVNNodeKind.DIR, null, SVNRepository.INVALID_REVISION, SVNEventAction.UPDATE_EXTERNAL, null, null, null)); | |
+ dispatchEvent(SVNEventFactory.createSVNEvent(target, SVNNodeKind.DIR, null, SVNRepository.INVALID_REVISION, SVNEventAction.UPDATE_EXTERNAL, null, null, null).setExternalInfo(externalDiff.oldExternal,externalDiff.newExternal)); | |
SVNWCAccess wcAccess = createWCAccess(); | |
SVNAdminArea area = wcAccess.open(target, true, 0); | |
SVNEntry entry = area.getEntry(area.getThisDirName(), false); | |
@@ -1859,17 +1859,17 @@ | |
} | |
deleteExternal(target); | |
target.mkdirs(); | |
- dispatchEvent(SVNEventFactory.createSVNEvent(target, SVNNodeKind.DIR, null, SVNRepository.INVALID_REVISION, SVNEventAction.UPDATE_EXTERNAL, null, null, null)); | |
+ dispatchEvent(SVNEventFactory.createSVNEvent(target, SVNNodeKind.DIR, null, SVNRepository.INVALID_REVISION, SVNEventAction.UPDATE_EXTERNAL, null, null, null).setExternalInfo(externalDiff.oldExternal,externalDiff.newExternal)); | |
doCheckout(newURL, target, externalPegRevision, externalRevision, SVNDepth.INFINITY, false); | |
return; | |
} | |
if (fileType != SVNFileType.DIRECTORY) { | |
target.mkdirs(); | |
} | |
- dispatchEvent(SVNEventFactory.createSVNEvent(target, SVNNodeKind.DIR, null, SVNRepository.INVALID_REVISION, SVNEventAction.UPDATE_EXTERNAL, null, null, null)); | |
+ dispatchEvent(SVNEventFactory.createSVNEvent(target, SVNNodeKind.DIR, null, SVNRepository.INVALID_REVISION, SVNEventAction.UPDATE_EXTERNAL, null, null, null).setExternalInfo(externalDiff.oldExternal,externalDiff.newExternal)); | |
doCheckout(newURL, target, externalPegRevision, externalRevision, SVNDepth.INFINITY, true); | |
} else { | |
- dispatchEvent(SVNEventFactory.createSVNEvent(target, SVNNodeKind.FILE, null, SVNRepository.INVALID_REVISION, SVNEventAction.UPDATE_EXTERNAL, null, null, null)); | |
+ dispatchEvent(SVNEventFactory.createSVNEvent(target, SVNNodeKind.FILE, null, SVNRepository.INVALID_REVISION, SVNEventAction.UPDATE_EXTERNAL, null, null, null).setExternalInfo(externalDiff.oldExternal,externalDiff.newExternal)); | |
switchFileExternal(access, target, newURL, externalPegRevision, externalRevision, reposRootURL); | |
} | |
} | |
@@ -1878,7 +1878,7 @@ | |
} catch (SVNException e) { | |
SVNDebugLog.getDefaultLog().logFine(SVNLogType.WC, e); | |
SVNEvent event = SVNEventFactory.createSVNEvent(target, SVNNodeKind.DIR, null, SVNRepository.INVALID_REVISION, SVNEventAction.SKIP, SVNEventAction.UPDATE_EXTERNAL, e.getErrorMessage(), | |
- null); | |
+ null).setExternalInfo(externalDiff.oldExternal,externalDiff.newExternal); | |
dispatchEvent(event); | |
} finally { | |
setEventPathPrefix(null); | |
diff -ruN --exclude .git --exclude .svn upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/compat/SvnCodec.java modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/compat/SvnCodec.java | |
--- upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/compat/SvnCodec.java 2014-07-01 02:36:19.414288456 +0000 | |
+++ modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/compat/SvnCodec.java 2014-07-01 02:31:49.971306484 +0000 | |
@@ -1,6 +1,20 @@ | |
package org.tmatesoft.svn.core.internal.wc2.compat; | |
-import org.tmatesoft.svn.core.*; | |
+import java.io.File; | |
+import java.util.ArrayList; | |
+import java.util.Collection; | |
+import java.util.HashMap; | |
+import java.util.HashSet; | |
+import java.util.Map; | |
+ | |
+import org.tmatesoft.svn.core.ISVNLogEntryHandler; | |
+import org.tmatesoft.svn.core.SVNDepth; | |
+import org.tmatesoft.svn.core.SVNErrorCode; | |
+import org.tmatesoft.svn.core.SVNException; | |
+import org.tmatesoft.svn.core.SVNLogEntry; | |
+import org.tmatesoft.svn.core.SVNNodeKind; | |
+import org.tmatesoft.svn.core.SVNProperties; | |
+import org.tmatesoft.svn.core.SVNURL; | |
import org.tmatesoft.svn.core.internal.util.SVNDate; | |
import org.tmatesoft.svn.core.internal.util.SVNHashMap; | |
import org.tmatesoft.svn.core.internal.util.SVNPathUtil; | |
@@ -14,17 +28,58 @@ | |
import org.tmatesoft.svn.core.internal.wc17.db.Structure; | |
import org.tmatesoft.svn.core.internal.wc17.db.StructureFields.NodeInfo; | |
import org.tmatesoft.svn.core.internal.wc2.ISvnCommitRunner; | |
-import org.tmatesoft.svn.core.wc.*; | |
-import org.tmatesoft.svn.core.wc.admin.*; | |
-import org.tmatesoft.svn.core.wc2.*; | |
+import org.tmatesoft.svn.core.wc.ISVNAddParameters; | |
+import org.tmatesoft.svn.core.wc.ISVNAnnotateHandler; | |
+import org.tmatesoft.svn.core.wc.ISVNChangelistHandler; | |
+import org.tmatesoft.svn.core.wc.ISVNCommitHandler; | |
+import org.tmatesoft.svn.core.wc.ISVNCommitParameters; | |
+import org.tmatesoft.svn.core.wc.ISVNDiffStatusHandler; | |
+import org.tmatesoft.svn.core.wc.ISVNExternalsHandler; | |
+import org.tmatesoft.svn.core.wc.ISVNFileFilter; | |
+import org.tmatesoft.svn.core.wc.ISVNPropertyHandler; | |
+import org.tmatesoft.svn.core.wc.ISVNPropertyValueProvider; | |
+import org.tmatesoft.svn.core.wc.ISVNStatusFileProvider; | |
+import org.tmatesoft.svn.core.wc.SVNCommitItem; | |
+import org.tmatesoft.svn.core.wc.SVNCommitPacket; | |
+import org.tmatesoft.svn.core.wc.SVNConflictDescription; | |
+import org.tmatesoft.svn.core.wc.SVNCopySource; | |
+import org.tmatesoft.svn.core.wc.SVNDiffStatus; | |
+import org.tmatesoft.svn.core.wc.SVNInfo; | |
+import org.tmatesoft.svn.core.wc.SVNPropertyData; | |
+import org.tmatesoft.svn.core.wc.SVNRevision; | |
+import org.tmatesoft.svn.core.wc.SVNRevisionRange; | |
+import org.tmatesoft.svn.core.wc.SVNStatus; | |
+import org.tmatesoft.svn.core.wc.SVNStatusType; | |
+import org.tmatesoft.svn.core.wc.SVNTreeConflictDescription; | |
+import org.tmatesoft.svn.core.wc.SVNWCUtil; | |
+import org.tmatesoft.svn.core.wc.admin.ISVNChangeEntryHandler; | |
+import org.tmatesoft.svn.core.wc.admin.ISVNChangedDirectoriesHandler; | |
+import org.tmatesoft.svn.core.wc.admin.ISVNHistoryHandler; | |
+import org.tmatesoft.svn.core.wc.admin.ISVNTreeHandler; | |
+import org.tmatesoft.svn.core.wc.admin.SVNAdminPath; | |
+import org.tmatesoft.svn.core.wc.admin.SVNChangeEntry; | |
+import org.tmatesoft.svn.core.wc2.ISvnAddParameters; | |
+import org.tmatesoft.svn.core.wc2.ISvnCommitParameters; | |
+import org.tmatesoft.svn.core.wc2.ISvnObjectReceiver; | |
+import org.tmatesoft.svn.core.wc2.SvnAnnotateItem; | |
+import org.tmatesoft.svn.core.wc2.SvnChecksum; | |
+import org.tmatesoft.svn.core.wc2.SvnCommit; | |
+import org.tmatesoft.svn.core.wc2.SvnCommitItem; | |
+import org.tmatesoft.svn.core.wc2.SvnCommitPacket; | |
+import org.tmatesoft.svn.core.wc2.SvnCopySource; | |
+import org.tmatesoft.svn.core.wc2.SvnDiffStatus; | |
+import org.tmatesoft.svn.core.wc2.SvnInfo; | |
+import org.tmatesoft.svn.core.wc2.SvnRevisionRange; | |
+import org.tmatesoft.svn.core.wc2.SvnSchedule; | |
+import org.tmatesoft.svn.core.wc2.SvnStatus; | |
+import org.tmatesoft.svn.core.wc2.SvnTarget; | |
+import org.tmatesoft.svn.core.wc2.SvnWorkingCopyInfo; | |
import org.tmatesoft.svn.core.wc2.hooks.ISvnCommitHandler; | |
import org.tmatesoft.svn.core.wc2.hooks.ISvnExternalsHandler; | |
+import org.tmatesoft.svn.core.wc2.hooks.ISvnFileFilter; | |
import org.tmatesoft.svn.core.wc2.hooks.ISvnFileListHook; | |
import org.tmatesoft.svn.core.wc2.hooks.ISvnPropertyValueProvider; | |
-import java.io.File; | |
-import java.util.*; | |
- | |
public class SvnCodec { | |
public static SVNDiffStatus diffStatus(SvnDiffStatus diffStatus) { | |
@@ -773,48 +828,72 @@ | |
if (target == null) { | |
return null; | |
} | |
- return new ISvnCommitHandler() { | |
- | |
- public SVNProperties getRevisionProperties(String message, SvnCommitItem[] commitables, SVNProperties revisionProperties) throws SVNException { | |
- SVNCommitItem[] targetItems = new SVNCommitItem[commitables.length]; | |
- for (int i = 0; i < targetItems.length; i++) { | |
- targetItems[i] = commitItem(commitables[i]); | |
- } | |
- return target.getRevisionProperties(message, targetItems, revisionProperties); | |
- } | |
- | |
- public String getCommitMessage(String message, SvnCommitItem[] commitables) throws SVNException { | |
- SVNCommitItem[] targetItems = new SVNCommitItem[commitables.length]; | |
- for (int i = 0; i < targetItems.length; i++) { | |
- targetItems[i] = commitItem(commitables[i]); | |
- } | |
- return target.getCommitMessage(message, targetItems); | |
- } | |
- }; | |
+ return new SvnCommitHandlerWithFilter(target); | |
} | |
public static ISVNCommitHandler commitHandler(final ISvnCommitHandler target) { | |
if (target == null) { | |
return null; | |
} | |
- return new ISVNCommitHandler() { | |
- public SVNProperties getRevisionProperties(String message, SVNCommitItem[] commitables, SVNProperties revisionProperties) throws SVNException { | |
- SvnCommitItem[] targetItems = new SvnCommitItem[commitables.length]; | |
- for (int i = 0; i < targetItems.length; i++) { | |
- targetItems[i] = commitItem(commitables[i]); | |
- } | |
- return target.getRevisionProperties(message, targetItems, revisionProperties); | |
+ return new SVNCommitHandler(target); | |
+ } | |
+ | |
+ private static class SVNCommitHandler implements ISVNCommitHandler, ISVNFileFilter { | |
+ | |
+ private final ISvnCommitHandler targetHandler; | |
+ | |
+ public SVNCommitHandler(ISvnCommitHandler target) { | |
+ targetHandler = target; | |
+ } | |
+ | |
+ public boolean accept(File file) throws SVNException { | |
+ return targetHandler instanceof ISvnFileFilter ? ((ISvnFileFilter) targetHandler).accept(file) : true; | |
+ } | |
+ | |
+ public SVNProperties getRevisionProperties(String message, SVNCommitItem[] commitables, SVNProperties revisionProperties) throws SVNException { | |
+ SvnCommitItem[] targetItems = new SvnCommitItem[commitables.length]; | |
+ for (int i = 0; i < targetItems.length; i++) { | |
+ targetItems[i] = commitItem(commitables[i]); | |
} | |
- | |
- public String getCommitMessage(String message, SVNCommitItem[] commitables) throws SVNException { | |
- SvnCommitItem[] targetItems = new SvnCommitItem[commitables.length]; | |
- for (int i = 0; i < targetItems.length; i++) { | |
- targetItems[i] = commitItem(commitables[i]); | |
- } | |
- return target.getCommitMessage(message, targetItems); | |
+ return targetHandler.getRevisionProperties(message, targetItems, revisionProperties); | |
+ } | |
+ | |
+ public String getCommitMessage(String message, SVNCommitItem[] commitables) throws SVNException { | |
+ SvnCommitItem[] targetItems = new SvnCommitItem[commitables.length]; | |
+ for (int i = 0; i < targetItems.length; i++) { | |
+ targetItems[i] = commitItem(commitables[i]); | |
} | |
- }; | |
+ return targetHandler.getCommitMessage(message, targetItems); | |
+ } | |
+ } | |
+ | |
+ private static class SvnCommitHandlerWithFilter implements ISvnCommitHandler, ISvnFileFilter { | |
+ | |
+ private final ISVNCommitHandler targetHandler; | |
+ public SvnCommitHandlerWithFilter(ISVNCommitHandler target) { | |
+ targetHandler = target; | |
+ } | |
+ | |
+ public boolean accept(File file) throws SVNException { | |
+ return targetHandler instanceof ISVNFileFilter ? ((ISVNFileFilter) targetHandler).accept(file) : true; | |
+ } | |
+ | |
+ public SVNProperties getRevisionProperties(String message, SvnCommitItem[] commitables, SVNProperties revisionProperties) throws SVNException { | |
+ SVNCommitItem[] targetItems = new SVNCommitItem[commitables.length]; | |
+ for (int i = 0; i < targetItems.length; i++) { | |
+ targetItems[i] = commitItem(commitables[i]); | |
+ } | |
+ return targetHandler.getRevisionProperties(message, targetItems, revisionProperties); | |
+ } | |
+ | |
+ public String getCommitMessage(String message, SvnCommitItem[] commitables) throws SVNException { | |
+ SVNCommitItem[] targetItems = new SVNCommitItem[commitables.length]; | |
+ for (int i = 0; i < targetItems.length; i++) { | |
+ targetItems[i] = commitItem(commitables[i]); | |
+ } | |
+ return targetHandler.getCommitMessage(message, targetItems); | |
+ } | |
} | |
public static ISVNExternalsHandler externalsHandler(final ISvnExternalsHandler target) { | |
diff -ruN --exclude .git --exclude .svn upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/io/SVNRepositoryFactory.java modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/io/SVNRepositoryFactory.java | |
--- upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/io/SVNRepositoryFactory.java 2014-07-01 02:36:22.496288023 +0000 | |
+++ modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/io/SVNRepositoryFactory.java 2014-07-01 02:31:50.002306657 +0000 | |
@@ -537,7 +537,7 @@ | |
uuidOS.write(uuid.getBytes("US-ASCII")); | |
} catch (IOException e) { | |
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "Error writing repository UUID to ''{0}''", uuidFile); | |
- err.setChildErrorMessage(SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e.getLocalizedMessage())); | |
+ err.setChildErrorMessage(SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e)); | |
SVNErrorManager.error(err, SVNLogType.FSFS); | |
} | |
@@ -557,7 +557,7 @@ | |
reposFormatOS.write(format.getBytes("US-ASCII")); | |
} catch (IOException e) { | |
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "Error writing repository format to ''{0}''", reposFormatFile); | |
- err.setChildErrorMessage(SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e.getLocalizedMessage())); | |
+ err.setChildErrorMessage(SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e)); | |
SVNErrorManager.error(err, SVNLogType.FSFS); | |
} | |
} | |
@@ -579,7 +579,7 @@ | |
} catch (IOException e) { | |
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, | |
"Error writing fs format to ''{0}''", fsFormatFile); | |
- err.setChildErrorMessage(SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e.getLocalizedMessage())); | |
+ err.setChildErrorMessage(SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e)); | |
SVNErrorManager.error(err, SVNLogType.FSFS); | |
} | |
@@ -621,7 +621,7 @@ | |
fsFormatOS.write(format.getBytes("US-ASCII")); | |
} catch (IOException e) { | |
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "Error writing fs format to ''{0}''", fsFormatFile); | |
- err.setChildErrorMessage(SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e.getLocalizedMessage())); | |
+ err.setChildErrorMessage(SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e)); | |
SVNErrorManager.error(err, SVNLogType.FSFS); | |
} | |
} | |
@@ -729,7 +729,7 @@ | |
} | |
} catch (IOException e) { | |
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "Can not copy repository template file to ''{0}''", dstFile); | |
- err.setChildErrorMessage(SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e.getLocalizedMessage())); | |
+ err.setChildErrorMessage(SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e)); | |
SVNErrorManager.error(err, SVNLogType.NETWORK); | |
} finally { | |
SVNFileUtil.closeFile(os); | |
@@ -780,7 +780,7 @@ | |
} catch (IOException e) { | |
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "Can not extract repository files from ''{0}'' to ''{1}''", | |
new Object[] {srcFile, dst}); | |
- err.setChildErrorMessage(SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e.getLocalizedMessage())); | |
+ err.setChildErrorMessage(SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e)); | |
SVNErrorManager.error(err, SVNLogType.NETWORK); | |
} finally { | |
SVNFileUtil.closeFile(jis); | |
diff -ruN --exclude .git --exclude .svn upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNCopyClient.java modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNCopyClient.java | |
--- upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNCopyClient.java 2014-07-01 02:36:24.466287534 +0000 | |
+++ modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNCopyClient.java 2014-07-01 02:31:50.016306894 +0000 | |
@@ -519,4 +519,52 @@ | |
cp.setSingleTarget(SvnTarget.fromFile(nestedWC)); | |
cp.run(); | |
} | |
+ | |
+ /** | |
+ * Copies/moves a source URL to a destination one immediately committing changes | |
+ * to a repository. | |
+ * <p/> | |
+ * <p/> | |
+ * If <code>dstURL</code> and <code>srcURL</code> are the same, | |
+ * <code>failWhenDstExists</code> is <span class="javakeyword">false</span> and | |
+ * <code>srcURL</code> is a directory then this directory will be copied into itself. | |
+ * <p/> | |
+ * <p/> | |
+ * If <code>dstURL</code> is a directory, <code>dstURL</code> and <code>srcURL</code> are not the same, | |
+ * <code>failWhenDstExists</code> is <span class="javakeyword">false</span>, <code>dstURL</code> | |
+ * has not the last path element entry of <code>srcURL</code> then that entry will be copied into | |
+ * <code>dstURL</code>. | |
+ * | |
+ * @param srcURL a source repository location URL | |
+ * @param srcRevision a revision of <code>srcURL</code> | |
+ * @param dstURL a target URL where <code>srcURL</code> is to be | |
+ * copied/moved | |
+ * @param isMove <span class="javakeyword">true</span> to move the source | |
+ * to the target (only URL-to-URL), | |
+ * <span class="javakeyword">false</span> to copy | |
+ * @param failWhenDstExists <span class="javakeyword">true</span> to force a failure if | |
+ * the destination exists | |
+ * @param commitMessage a commit log message | |
+ * @return information on the committed revision | |
+ * @throws SVNException if one of the following is true: | |
+ * <ul> | |
+ * <li><code>srcURL</code> and <code>dstURL</code> are not in the | |
+ * same repository | |
+ * <li><code>srcURL</code> was not found in <code>srcRevision</code> | |
+ * <li><code>dstURL</code> and <code>srcURL</code> are the same and | |
+ * <code>failWhenDstExists</code> is <span class="javakeyword">true</span> | |
+ * <li><code>dstURL</code> already exists and <code>failWhenDstExists</code> | |
+ * is <span class="javakeyword">true</span> | |
+ * <li><code>dstURL</code> already exists, <code>failWhenDstExists</code> | |
+ * is <span class="javakeyword">false</span>, but <code>dstURL</code> | |
+ * already contains the top path element name of <code>srcURL</code> | |
+ * <li><code>isMove = </code><span class="javakeyword">true</span> and | |
+ * <code>dstURL = srcURL</code> | |
+ * </ul> | |
+ */ | |
+ public SVNCommitInfo doCopy(SVNURL srcURL, SVNRevision srcRevision, SVNURL dstURL, boolean isMove, boolean failWhenDstExists, String commitMessage) throws SVNException { | |
+ SVNCopySource cs = new SVNCopySource(SVNRevision.UNDEFINED,srcRevision,srcURL); | |
+ return doCopy( new SVNCopySource[]{cs}, dstURL, isMove, true, failWhenDstExists, commitMessage, null); | |
+ } | |
+ | |
} | |
diff -ruN --exclude .git --exclude .svn upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNEvent.java modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNEvent.java | |
--- upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNEvent.java 2014-07-01 02:36:24.468287639 +0000 | |
+++ modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNEvent.java 2014-07-01 02:31:50.017306585 +0000 | |
@@ -19,6 +19,7 @@ | |
import org.tmatesoft.svn.core.SVNNodeKind; | |
import org.tmatesoft.svn.core.SVNProperties; | |
import org.tmatesoft.svn.core.SVNURL; | |
+import org.tmatesoft.svn.core.internal.wc.SVNExternal; | |
/** | |
* The <b>SVNEvent</b> class is used to provide detailed information on | |
@@ -122,6 +123,8 @@ | |
private SVNEventAction myExpectedAction; | |
private String myChangelistName; | |
private SVNMergeRange myRange; | |
+ private SVNExternal myExternalInfo; | |
+ private SVNExternal myPreviousExternalInfo; | |
private SVNProperties myRevisionProperties; | |
private String myPropertyName; | |
private Object info; | |
@@ -413,7 +416,20 @@ | |
myPreviousURL = url; | |
} | |
+ public SVNExternal getExternalInfo() { | |
+ return myExternalInfo; | |
+ } | |
+ | |
+ public SVNExternal getPreviousExternalInfo() { | |
+ return myExternalInfo; | |
+ } | |
+ public SVNEvent setExternalInfo(SVNExternal prev, SVNExternal _new) { | |
+ this.myPreviousExternalInfo = prev; | |
+ this.myExternalInfo = _new; | |
+ return this; | |
+ } | |
+ | |
public String toString() { | |
StringBuffer sb = new StringBuffer(); | |
if (getAction() != null) { | |
diff -ruN --exclude .git --exclude .svn upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/wc2/hooks/ISvnFileFilter.java modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/wc2/hooks/ISvnFileFilter.java | |
--- upstream_1.7.10/svnkit/src/main/java/org/tmatesoft/svn/core/wc2/hooks/ISvnFileFilter.java 1970-01-01 00:00:00.000000000 +0000 | |
+++ modified/git/svnkit/src/main/java/org/tmatesoft/svn/core/wc2/hooks/ISvnFileFilter.java 2014-07-01 02:31:50.055306251 +0000 | |
@@ -0,0 +1,10 @@ | |
+package org.tmatesoft.svn.core.wc2.hooks; | |
+ | |
+import java.io.File; | |
+ | |
+import org.tmatesoft.svn.core.SVNException; | |
+ | |
+public interface ISvnFileFilter { | |
+ | |
+ public boolean accept(File file) throws SVNException; | |
+} | |
diff -ruN --exclude .git --exclude .svn upstream_1.7.10/svnkit-osgi/build.gradle modified/git/svnkit-osgi/build.gradle | |
--- upstream_1.7.10/svnkit-osgi/build.gradle 2014-07-01 02:36:07.108288168 +0000 | |
+++ modified/git/svnkit-osgi/build.gradle 2014-07-01 02:31:49.802306618 +0000 | |
@@ -49,6 +49,7 @@ | |
'Bundle-ActivationPolicy' : 'lazy', | |
'Eclipse-BundleShape' : 'jar', | |
'Require-Bundle': 'net.java.dev.jna;bundle-version="[3.2.7,4.0.0)";resolution:=optional,' + | |
+ 'com.trilead.ssh2;bundle-version="[1.0.0,2.0.0)",' + | |
'org.tmatesoft.sqljet;bundle-version="[1.0.5,2.0.0)",' + | |
'org.eclipse.core.runtime;bundle-version="[3.0.0,4.0.0)"' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment