Created
July 1, 2014 03:20
-
-
Save anonymous/dd46cb35b3cf2bf59cb4 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_trunk/.gitattributes modified-1.8/.gitattributes | |
--- upstream_trunk/.gitattributes 1970-01-01 00:00:00.000000000 +0000 | |
+++ modified-1.8/.gitattributes 2014-07-01 03:13:45.817133266 +0000 | |
@@ -0,0 +1,29 @@ | |
+* text=auto !eol | |
+/CHANGES.txt eol=lf | |
+/LICENSE.txt eol=lf | |
+/build.pom.gradle -text | |
+gradle/wrapper/gradle-wrapper.jar -text | |
+/gradlew eol=lf | |
+svnkit-cli/src/main/resources/org/tmatesoft/svn/cli/svn/commands.properties eol=lf | |
+svnkit-cli/src/main/resources/org/tmatesoft/svn/cli/svn/options.properties eol=lf | |
+svnkit-cli/src/main/scripts/jsvn eol=lf | |
+svnkit-distribution/src/main/licenses/LICENSE-ANTLR.txt eol=lf | |
+svnkit-distribution/src/main/licenses/LICENSE-JAVAHL.txt eol=lf | |
+svnkit-distribution/src/main/licenses/LICENSE-JNA.txt eol=lf | |
+svnkit-distribution/src/main/licenses/LICENSE-JSCH.txt eol=lf | |
+svnkit-distribution/src/main/licenses/LICENSE-SEQUENCE.txt eol=lf | |
+svnkit-distribution/src/main/licenses/LICENSE-SQLJET.txt eol=lf | |
+svnkit-distribution/src/main/licenses/LICENSE-TRILEAD.txt eol=lf | |
+svnkit-test/configurations/shared/apache/python.template.conf eol=lf | |
+svnkit-test/configurations/shared/apache/users eol=lf | |
+svnkit-test/configurations/shared/daemon/snapshot eol=lf | |
+svnkit-test/configurations/shared/daemon/template eol=lf | |
+svnkit-test/configurations/shared/daemon/template.bat -text | |
+svnkit-test/nailgun/nailgun-0.7.1.jar -text | |
+svnkit-test/nailgun/ng.exe -text | |
+svnkit/.settings/org.eclipse.jdt.ui.prefs -text | |
+svnkit/src/javadoc/info.png -text | |
+svnkit/src/main/java/org/tmatesoft/svn/core/io/repository/template.jar -text | |
+svnkit/src/main/resources/org/tmatesoft/svn/core/internal/wc/config eol=lf | |
+svnkit/src/main/resources/org/tmatesoft/svn/core/internal/wc/servers eol=lf | |
+svnkit/src/main/resources/org/tmatesoft/svn/core/io/repository/template.jar -text | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/.gitignore modified-1.8/.gitignore | |
--- upstream_trunk/.gitignore 1970-01-01 00:00:00.000000000 +0000 | |
+++ modified-1.8/.gitignore 2014-07-01 03:13:45.817133266 +0000 | |
@@ -0,0 +1,8 @@ | |
+*.iml | |
+*.ipr | |
+*.iws | |
+build | |
+target | |
+m2repo | |
+bin | |
+.gradle | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/CHANGES.txt modified-1.8/CHANGES.txt | |
--- upstream_trunk/CHANGES.txt 2014-07-01 03:14:16.502130771 +0000 | |
+++ modified-1.8/CHANGES.txt 2014-07-01 03:13:45.818133979 +0000 | |
@@ -1,22 +1,3 @@ | |
-== version 1.8.6 == | |
- | |
-+ Dependency on JNA set to 4.1.0 version, JNA is bundled under Apache 2.0 License. | |
-+ JRE 1.6 or newer now required by SVNKit. | |
-+ Stability improvements. | |
- | |
-== version 1.8.5 == | |
- | |
-+ Properties merge didn't work correctly in 1.8.4, fixed. | |
-+ Stability improvements. | |
- | |
-== version 1.8.4 == | |
- | |
-+ Full transparent support of 1.7 working copy format. | |
-+ Crash on concurrent access to GNOME Keyring fixed. | |
-+ Non-atomic rename issues when JNA is not present fixed. | |
-+ Missing JavaHL 1.8 methods implemented. | |
-+ Stability and performance improvements. | |
- | |
== version 1.8.3-1 == | |
+ Pre 1.8.4 version. | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/README.txt modified-1.8/README.txt | |
--- upstream_trunk/README.txt 2014-07-01 03:14:17.755130191 +0000 | |
+++ modified-1.8/README.txt 2014-07-01 03:13:45.818133979 +0000 | |
@@ -1,3 +1,12 @@ | |
+This is the Jenkins patches to SVNKit. | |
+ | |
+We maintain all our changes in the 'master' branch. The upstream repository is in | |
+http://svn.svnkit.com/git/svnkit, and we'll occasionally merge upstream release tag | |
+into our main line. | |
+ | |
+ | |
+==================== | |
+ | |
This is a README.txt file for SVNKit - pure Java Subversion client library. | |
1. DESCRIPTION | |
@@ -44,4 +53,4 @@ | |
5. CONTACTS | |
-On all questions related to SVNKit please contact us at support@svnkit.com | |
\ No newline at end of file | |
+On all questions related to SVNKit please contact us at support@svnkit.com | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/build.defaults.gradle modified-1.8/build.defaults.gradle | |
--- upstream_trunk/build.defaults.gradle 2014-07-01 03:14:17.754130437 +0000 | |
+++ modified-1.8/build.defaults.gradle 2014-07-01 03:12:33.210138089 +0000 | |
@@ -11,4 +11,4 @@ | |
if (!project.hasProperty(name)) { | |
project.ext.setProperty(name, value) | |
} | |
-} | |
\ No newline at end of file | |
+} | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/build.gradle modified-1.8/build.gradle | |
--- upstream_trunk/build.gradle 2014-07-01 03:14:17.720130258 +0000 | |
+++ modified-1.8/build.gradle 2014-07-01 03:13:45.818133979 +0000 | |
@@ -1,9 +1,9 @@ | |
group = 'org.tmatesoft.svnkit' | |
-version = '1.8.6' | |
+version = '1.8.4-jenkins-1' | |
project.ext { | |
- release = false | |
- target = '1.6' | |
+ release = true | |
+target = '1.5' | |
compatibleSvnVersion = '1.8.1' | |
} | |
@@ -55,7 +55,7 @@ | |
configure(javaProjects()) { | |
apply plugin : 'java' | |
- apply plugin : 'signing' | |
+ // apply plugin : 'signing' -- Kohsuke: commented this out to get the build going | |
sourceCompatibility = target | |
targetCompatibility = target | |
@@ -90,14 +90,12 @@ | |
dependencies { | |
compile 'de.regnis.q.sequence:sequence-library:1.0.2' | |
compile 'org.tmatesoft.sqljet:sqljet:1.1.10' | |
- compile 'net.java.dev.jna:jna:4.1.0' | |
- compile 'net.java.dev.jna:jna-platform:4.1.0' | |
+ compile 'net.java.dev.jna:jna:3.5.2' | |
+ compile 'net.java.dev.jna:platform:3.5.2' | |
compile 'com.trilead:trilead-ssh2:1.0.0-build217' | |
- compile('com.jcraft:jsch.agentproxy.connector-factory:0.0.7') { | |
- exclude group: 'net.java.dev.jna' | |
- } | |
+ compile 'com.jcraft:jsch.agentproxy.connector-factory:0.0.7' | |
compile 'com.jcraft:jsch.agentproxy.svnkit-trilead-ssh2:0.0.7' | |
- | |
+ | |
testCompile 'junit:junit:4.8' | |
} | |
artifacts { maven jar, sourcesJar, javadocJar } | |
@@ -164,7 +162,7 @@ | |
osgi project(path: ':svnkit-osgi', configuration: 'archives') | |
osgi 'com.trilead:trilead-ssh2-osgi:1.0.0-build217' | |
osgi 'org.tmatesoft.sqljet:sqljet-osgi:1.1.10' | |
- osgi 'net.java.dev.jna:jna-osgi:4.1.0' | |
+ osgi 'net.java.dev.jna:jna-osgi:3.5.2' | |
} | |
} | |
task publish(dependsOn: [':svnkit-distribution:buildAll']) { | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/pom.xml modified-1.8/pom.xml | |
--- upstream_trunk/pom.xml 1970-01-01 00:00:00.000000000 +0000 | |
+++ modified-1.8/pom.xml 2014-07-01 03:13:45.819133635 +0000 | |
@@ -0,0 +1,97 @@ | |
+<?xml version="1.0" encoding="UTF-8"?><project> | |
+ <modelVersion>4.0.0</modelVersion> | |
+ <groupId>org.jenkins-ci.svnkit</groupId> | |
+ <artifactId>svnkit</artifactId> | |
+ <version>1.8.4-jenkins-1</version> | |
+ <name>SVNKit</name> | |
+ <description>A pure Java Subversion library, formerly known as JavaSVN</description> | |
+ <url>http://svnkit.com/</url> | |
+ <licenses> | |
+ <license> | |
+ <url>http://svnkit.com/license.html</url> | |
+ </license> | |
+ </licenses> | |
+ <distributionManagement> | |
+ <downloadUrl>http://svnkit.com/download/index.php</downloadUrl> | |
+ <repository> | |
+ <id>maven.jenkins-ci.org</id> | |
+ <url>http://maven.jenkins-ci.org:8081/content/repositories/releases/</url> | |
+ </repository> | |
+ </distributionManagement> | |
+ <properties> | |
+ <skipTests>true</skipTests><!-- run by Gradle --> | |
+ </properties> | |
+ <build> | |
+ <sourceDirectory>svnkit/src/main/java</sourceDirectory> | |
+ <testSourceDirectory>svnkit/src/test/java</testSourceDirectory> | |
+ <testResources> | |
+ <testResource> | |
+ <directory>svnkit/src/test/resources</directory> | |
+ </testResource> | |
+ </testResources> | |
+ <resources> | |
+ <resource> | |
+ <directory>svnkit/src/main/resources</directory> | |
+ </resource> | |
+ </resources> | |
+ <plugins> | |
+ <!-- fake out maven and install the binary artifact --> | |
+ <plugin> | |
+ <groupId>org.jvnet.maven-antrun-extended-plugin</groupId> | |
+ <artifactId>maven-antrun-extended-plugin</artifactId> | |
+ <executions> | |
+ <execution> | |
+ <phase>package</phase> | |
+ <goals> | |
+ <goal>run</goal> | |
+ </goals> | |
+ <configuration> | |
+ <tasks> | |
+ <exec command="./gradlew clean assemble" /> | |
+ <attachArtifact file="./svnkit/build/libs/svnkit-${project.version}.jar"/> | |
+ <attachArtifact file="./svnkit/build/libs/svnkit-${project.version}-sources.jar" classifier="sources" type="jar"/> | |
+ </tasks> | |
+ </configuration> | |
+ </execution> | |
+ </executions> | |
+ </plugin> | |
+ </plugins> | |
+ </build> | |
+ <dependencies> | |
+ <dependency> | |
+ <groupId>net.java.dev.jna</groupId> | |
+ <artifactId>jna</artifactId> | |
+ <version>3.4.0</version> | |
+ <optional>true</optional> | |
+ </dependency> | |
+ <dependency> | |
+ <groupId>org.jenkins-ci</groupId> | |
+ <artifactId>trilead-ssh2</artifactId> | |
+ <version>build217-jenkins-3</version> | |
+ <optional>true</optional> | |
+ </dependency> | |
+ <dependency> | |
+ <groupId>org.tmatesoft.sqljet</groupId> | |
+ <artifactId>sqljet</artifactId> | |
+ <version>1.1.10</version> | |
+ </dependency> | |
+ <dependency> | |
+ <groupId>de.regnis.q.sequence</groupId> | |
+ <artifactId>sequence-library</artifactId> | |
+ <version>1.0.2</version> | |
+ </dependency> | |
+ <dependency> | |
+ <groupId>junit</groupId> | |
+ <artifactId>junit</artifactId> | |
+ <version>4.9</version> | |
+ <scope>test</scope> | |
+ </dependency> | |
+ </dependencies> | |
+ | |
+ <repositories> | |
+ <repository> | |
+ <id>repo.jenkins-ci.org</id> | |
+ <url>http://repo.jenkins-ci.org/public/</url> | |
+ </repository> | |
+ </repositories> | |
+</project> | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/.settings/org.eclipse.jdt.ui.prefs modified-1.8/svnkit/.settings/org.eclipse.jdt.ui.prefs | |
--- upstream_trunk/svnkit/.settings/org.eclipse.jdt.ui.prefs 2014-07-01 03:14:30.541130198 +0000 | |
+++ modified-1.8/svnkit/.settings/org.eclipse.jdt.ui.prefs 1970-01-01 00:00:00.000000000 +0000 | |
@@ -1,8 +0,0 @@ | |
-#Tue Jul 26 18:02:53 CEST 2011 | |
-eclipse.preferences.version=1 | |
-formatter_profile=_Eclipse [no-tabs] | |
-formatter_settings_version=11 | |
-org.eclipse.jdt.ui.exception.name=e | |
-org.eclipse.jdt.ui.gettersetter.use.is=true | |
-org.eclipse.jdt.ui.keywordthis=false | |
-org.eclipse.jdt.ui.overrideannotation=true | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/SVNAuthenticationException.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/SVNAuthenticationException.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/SVNAuthenticationException.java 2014-07-01 03:14:19.349131005 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/SVNAuthenticationException.java 2014-07-01 03:12:33.410137836 +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_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/SVNErrorMessage.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/SVNErrorMessage.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/SVNErrorMessage.java 2014-07-01 03:14:19.350131445 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/SVNErrorMessage.java 2014-07-01 03:13:45.841133573 +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,14 @@ | |
return findChildWithErrorCode(errorCode) != null; | |
} | |
- public void initCause(Throwable cause) { | |
- if (myThrowable == null) { | |
- myThrowable = cause; | |
+ @Override | |
+ public SVNErrorMessage initCause(Throwable cause) { | |
+ try { | |
+ super.initCause(cause); | |
+ } catch (IllegalStateException e) { | |
+ // failed to set the cause. that's OK. | |
} | |
+ myThrowable = cause; | |
+ return this; | |
} | |
} | |
\ No newline at end of file | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/SVNException.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/SVNException.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/SVNException.java 2014-07-01 03:14:19.351131594 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/SVNException.java 2014-07-01 03:13:45.841133573 +0000 | |
@@ -34,7 +34,7 @@ | |
* @param errorMessage an error message | |
*/ | |
public SVNException(SVNErrorMessage errorMessage) { | |
- this(errorMessage, errorMessage.getCause()); | |
+ this(errorMessage, errorMessage); | |
} | |
/** | |
@@ -42,14 +42,19 @@ | |
* | |
* @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()); | |
+ super(cause != null ? cause : errorMessage); | |
if (cause == null) { | |
cause = errorMessage.getCause(); | |
} | |
+// 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; | |
@@ -60,12 +65,14 @@ | |
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_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/SVNProperty.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/SVNProperty.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/SVNProperty.java 2014-07-01 03:14:28.351131798 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/SVNProperty.java 2014-07-01 03:13:45.842133420 +0000 | |
@@ -474,7 +474,7 @@ | |
public static boolean isRegularProperty(String name) { | |
if (name == null) { | |
return false; | |
- } else if (isWorkingCopyProperty(name) || isEntryProperty(name)) { | |
+ } else if (name.startsWith(SVN_WC_PREFIX) || name.startsWith(SVN_ENTRY_PREFIX)) { | |
return false; | |
} else { | |
return true; | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/SVNURL.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/SVNURL.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/SVNURL.java 2014-07-01 03:14:19.353131060 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/SVNURL.java 2014-07-01 03:13:45.843133844 +0000 | |
@@ -11,6 +11,13 @@ | |
*/ | |
package org.tmatesoft.svn.core; | |
+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 org.tmatesoft.svn.core.internal.util.SVNEncodingUtil; | |
import org.tmatesoft.svn.core.internal.util.SVNHashMap; | |
import org.tmatesoft.svn.core.internal.util.SVNPathUtil; | |
@@ -45,7 +52,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. | |
@@ -137,7 +144,7 @@ | |
String host = null; | |
if (SVNFileUtil.isWindows && path.startsWith("//") || path.startsWith("\\\\")) { | |
// this is UNC path, remove host. | |
- path = path.replace(File.separatorChar, '/'); | |
+ path = path.replace(File.separatorChar, '/'); | |
path = path.substring("//".length()); | |
final int lastIndex = path.indexOf("/") > 0 ? path.indexOf("/") : path.length(); | |
host = path.substring(0, lastIndex); | |
@@ -591,4 +598,24 @@ | |
return path; | |
} | |
+ 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; | |
} | |
\ No newline at end of file | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/auth/BasicAuthenticationManager.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/auth/BasicAuthenticationManager.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/auth/BasicAuthenticationManager.java 2014-07-01 03:14:18.902131641 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/auth/BasicAuthenticationManager.java 2014-07-01 03:12:33.416137638 +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_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/auth/ISVNAuthenticationManager.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/auth/ISVNAuthenticationManager.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/auth/ISVNAuthenticationManager.java 2014-07-01 03:14:18.899130941 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/auth/ISVNAuthenticationManager.java 2014-07-01 03:12:33.417137820 +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_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/auth/ISVNAuthenticationOutcomeListener.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/auth/ISVNAuthenticationOutcomeListener.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/auth/ISVNAuthenticationOutcomeListener.java 1970-01-01 00:00:00.000000000 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/auth/ISVNAuthenticationOutcomeListener.java 2014-07-01 03:12:33.417137820 +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_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/auth/SVNSSLAuthentication.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/auth/SVNSSLAuthentication.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/auth/SVNSSLAuthentication.java 2014-07-01 03:14:18.896131166 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/auth/SVNSSLAuthentication.java 2014-07-01 03:12:33.418137580 +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_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/DAVCommitEditor.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/DAVCommitEditor.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/DAVCommitEditor.java 2014-07-01 03:14:22.472129954 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/DAVCommitEditor.java 2014-07-01 03:13:45.844134146 +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; | |
@@ -396,7 +401,7 @@ | |
// we should run abort edit if exception is thrown | |
// abort edit will not be run if there was an error (from server side) on MERGE. | |
try { | |
- abortEdit(); | |
+ abortEdit(); | |
} catch (SVNException e) { | |
SVNDebugLog.getDefaultLog().logError(SVNLogType.DEFAULT, e); | |
} | |
@@ -513,3 +518,4 @@ | |
} | |
} | |
+ | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/DAVConnection.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/DAVConnection.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/DAVConnection.java 2014-07-01 03:14:22.474130121 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/DAVConnection.java 2014-07-01 03:13:45.845133689 +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]; | |
} | |
@@ -210,16 +210,16 @@ | |
myLastStatus = httpConnection.getLastStatus(); | |
exception = e; | |
} | |
- if (myLastStatus != null) { | |
- if (myLastStatus.getCode() == 405) { | |
- SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_OUT_OF_DATE, "Lock request failed: {0} {1}", | |
- new Object[] {myLastStatus.getCode(), myLastStatus.getReason()}); | |
- SVNErrorManager.error(err, SVNLogType.CLIENT); | |
- } | |
- if (myLastStatus.getError() != null) { | |
+ if (myLastStatus != null) { | |
+ if (myLastStatus.getCode() == 405) { | |
+ SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_OUT_OF_DATE, "Lock request failed: {0} {1}", | |
+ new Object[] {myLastStatus.getCode(), myLastStatus.getReason()}); | |
+ SVNErrorManager.error(err, SVNLogType.CLIENT); | |
+ } | |
+ if (myLastStatus.getError() != null) { | |
myLastStatus.getError().setChildErrorMessage(null); // subversion doesn't have a child message for lock | |
- SVNErrorManager.error(myLastStatus.getError(), SVNLogType.NETWORK); | |
- } | |
+ SVNErrorManager.error(myLastStatus.getError(), SVNLogType.NETWORK); | |
+ } | |
if (myLastStatus.getHeader() == null) { | |
if (exception != null) { | |
@@ -228,18 +228,18 @@ | |
return null; | |
} | |
- String userName = myLastStatus.getHeader().getFirstHeaderValue(HTTPHeader.LOCK_OWNER_HEADER); | |
- if (userName == null) { | |
- userName = httpConnection.getLastValidCredentials() != null ? httpConnection.getLastValidCredentials().getUserName() : null; | |
- } | |
- String created = myLastStatus.getHeader().getFirstHeaderValue(HTTPHeader.CREATION_DATE_HEADER); | |
- if (userName == null || created == null) { | |
- SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_DAV_MALFORMED_DATA, "Incomplete lock data returned"); | |
- SVNErrorManager.error(err, SVNLogType.NETWORK); | |
- } | |
- Date createdDate = created != null ? SVNDate.parseDate(created) : null; | |
+ String userName = myLastStatus.getHeader().getFirstHeaderValue(HTTPHeader.LOCK_OWNER_HEADER); | |
+ if (userName == null) { | |
+ userName = httpConnection.getLastValidCredentials() != null ? httpConnection.getLastValidCredentials().getUserName() : null; | |
+ } | |
+ String created = myLastStatus.getHeader().getFirstHeaderValue(HTTPHeader.CREATION_DATE_HEADER); | |
+ if (userName == null || created == null) { | |
+ SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_DAV_MALFORMED_DATA, "Incomplete lock data returned"); | |
+ SVNErrorManager.error(err, SVNLogType.NETWORK); | |
+ } | |
+ Date createdDate = created != null ? SVNDate.parseDate(created) : null; | |
return new SVNLock(repositoryPath, handler.getID(), userName, comment, createdDate, null); | |
- } | |
+ } | |
if (exception != null) { | |
throw exception; | |
@@ -433,53 +433,53 @@ | |
exception = e; | |
} | |
if (myLastStatus != null) { | |
- if (myLastStatus.getError() != null) { | |
- SVNErrorCode errCode = myLastStatus.getError().getErrorCode(); | |
- if (errCode == SVNErrorCode.FS_BAD_LOCK_TOKEN || errCode == SVNErrorCode.FS_NO_LOCK_TOKEN || | |
- errCode == SVNErrorCode.FS_LOCK_OWNER_MISMATCH || errCode == SVNErrorCode.FS_PATH_ALREADY_LOCKED) { | |
- Map childTokens = null; | |
- if (myLocks != null) { | |
- childTokens = new SVNHashMap(); | |
- for (Iterator locksIter = myLocks.keySet().iterator(); locksIter.hasNext();) { | |
- String lockPath = (String) locksIter.next(); | |
- if (lockPath.startsWith(path)) { | |
- childTokens.put(lockPath, myLocks.get(lockPath)); | |
- } | |
+ if (myLastStatus.getError() != null) { | |
+ SVNErrorCode errCode = myLastStatus.getError().getErrorCode(); | |
+ if (errCode == SVNErrorCode.FS_BAD_LOCK_TOKEN || errCode == SVNErrorCode.FS_NO_LOCK_TOKEN || | |
+ errCode == SVNErrorCode.FS_LOCK_OWNER_MISMATCH || errCode == SVNErrorCode.FS_PATH_ALREADY_LOCKED) { | |
+ Map childTokens = null; | |
+ if (myLocks != null) { | |
+ childTokens = new SVNHashMap(); | |
+ for (Iterator locksIter = myLocks.keySet().iterator(); locksIter.hasNext();) { | |
+ String lockPath = (String) locksIter.next(); | |
+ if (lockPath.startsWith(path)) { | |
+ childTokens.put(lockPath, myLocks.get(lockPath)); | |
} | |
} | |
- | |
- if (childTokens == null || childTokens.isEmpty()) { | |
- SVNErrorManager.error(myLastStatus.getError(), SVNLogType.NETWORK); | |
- } else { | |
- myLastStatus.setError(null); | |
- } | |
- | |
- String token = myLocks != null ? (String) myLocks.get(path) : null; | |
- if (token != null) { | |
- childTokens.put(path, token); | |
- } | |
- | |
- request = new StringBuffer(); | |
- String locationPath = getLocation().getPath(); | |
- locationPath = SVNEncodingUtil.uriEncode(locationPath); | |
- | |
- request = DAVMergeHandler.generateLockDataRequest(request, locationPath, repositoryPath, childTokens); | |
- try { | |
- myLastStatus = performHttpRequest(httpConnection, "DELETE", path, header, request, 204, 404, null, null); | |
- } catch (SVNException e) { | |
- myLastStatus = httpConnection.getLastStatus(); | |
- exception = e; | |
- } | |
- if (myLastStatus.getError() != null) { | |
- SVNErrorManager.error(myLastStatus.getError(), SVNLogType.NETWORK); | |
- } | |
- if (exception != null) { | |
- throw exception; | |
- } | |
- return myLastStatus; | |
} | |
- SVNErrorManager.error(myLastStatus.getError(), SVNLogType.NETWORK); | |
- } | |
+ | |
+ if (childTokens == null || childTokens.isEmpty()) { | |
+ SVNErrorManager.error(myLastStatus.getError(), SVNLogType.NETWORK); | |
+ } else { | |
+ myLastStatus.setError(null); | |
+ } | |
+ | |
+ String token = myLocks != null ? (String) myLocks.get(path) : null; | |
+ if (token != null) { | |
+ childTokens.put(path, token); | |
+ } | |
+ | |
+ request = new StringBuffer(); | |
+ String locationPath = getLocation().getPath(); | |
+ locationPath = SVNEncodingUtil.uriEncode(locationPath); | |
+ | |
+ request = DAVMergeHandler.generateLockDataRequest(request, locationPath, repositoryPath, childTokens); | |
+ try { | |
+ myLastStatus = performHttpRequest(httpConnection, "DELETE", path, header, request, 204, 404, null, null); | |
+ } catch (SVNException e) { | |
+ myLastStatus = httpConnection.getLastStatus(); | |
+ exception = e; | |
+ } | |
+ if (myLastStatus.getError() != null) { | |
+ SVNErrorManager.error(myLastStatus.getError(), SVNLogType.NETWORK); | |
+ } | |
+ if (exception != null) { | |
+ throw exception; | |
+ } | |
+ return myLastStatus; | |
+ } | |
+ SVNErrorManager.error(myLastStatus.getError(), SVNLogType.NETWORK); | |
+ } | |
} | |
if (exception != null) { | |
@@ -665,7 +665,7 @@ | |
myCapabilities.put(SVNCapability.ATOMIC_REVPROPS, DAV_CAPABILITY_YES); | |
} else if (DAVElement.ATOMIC_REVPROPS_OPTION.equalsIgnoreCase(value)) { | |
myCapabilities.put(SVNCapability.INHERITED_PROPS, DAV_CAPABILITY_YES); | |
- } | |
+ } | |
} | |
} | |
} | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/DAVRepository.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/DAVRepository.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/DAVRepository.java 2014-07-01 03:14:22.476131538 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/DAVRepository.java 2014-07-01 03:13:45.846133578 +0000 | |
@@ -295,9 +295,9 @@ | |
if (inputStream != null) { | |
FSRepositoryUtil.copy(inputStream, contents, getCanceller()); | |
} else { | |
- connection.doGet(path, contents); | |
- } | |
- } finally { | |
+ connection.doGet(path, contents); | |
+ } | |
+ } finally { | |
SVNFileUtil.closeFile(inputStream); | |
} | |
} | |
@@ -623,9 +623,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){ | |
@@ -637,7 +639,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(); | |
@@ -1272,8 +1274,8 @@ | |
return mergeInfoWithPath; | |
} | |
- private void runReport(SVNURL url, long targetRevision, String target, String dstPath, SVNDepth depth, | |
- boolean ignoreAncestry, boolean resourceWalk, boolean fetchContents, boolean sendCopyFromArgs, | |
+ private void runReport(SVNURL url, long targetRevision, String target, String dstPath, SVNDepth depth, | |
+ boolean ignoreAncestry, boolean resourceWalk, boolean fetchContents, boolean sendCopyFromArgs, | |
boolean sendAll, boolean closeEditorOnException, boolean spool, ISVNWorkingCopyContentMediator workingCopyContentMediator, ISVNReporterBaton reporter, ISVNEditor editor) throws SVNException { | |
boolean serverSupportsDepth = hasCapability(SVNCapability.DEPTH); | |
if (depth != SVNDepth.FILES && depth != SVNDepth.INFINITY && !serverSupportsDepth) { | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/handlers/DAVEditorHandler.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/handlers/DAVEditorHandler.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/handlers/DAVEditorHandler.java 2014-07-01 03:14:22.420130937 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/handlers/DAVEditorHandler.java 2014-07-01 03:13:45.847133240 +0000 | |
@@ -73,8 +73,6 @@ | |
attrs.put("send-all", Boolean.toString(sendAll)); | |
SVNXMLUtil.openNamespaceDeclarationTag(SVNXMLUtil.SVN_NAMESPACE_PREFIX, "update-report", | |
SVN_NAMESPACES_LIST, SVNXMLUtil.PREFIX_MAP, attrs, xmlBuffer, true); | |
- | |
- SVNXMLUtil.openCDataTag(SVNXMLUtil.SVN_NAMESPACE_PREFIX, "include-props", "yes", xmlBuffer); | |
SVNXMLUtil.openCDataTag(SVNXMLUtil.SVN_NAMESPACE_PREFIX, "src-path", url, xmlBuffer); | |
if (targetRevision >= 0) { | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/http/HTTPConnection.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/http/HTTPConnection.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/http/HTTPConnection.java 2014-07-01 03:14:22.248131099 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/http/HTTPConnection.java 2014-07-01 03:13:45.848133528 +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; | |
@@ -181,29 +183,29 @@ | |
mySocket = SVNSocketFactory.createPlainSocket(proxyManager.getProxyHost(), proxyManager.getProxyPort(), connectTimeout, readTimeout, myRepository.getCanceller()); | |
debugLog.logFine(SVNLogType.NETWORK, "proxy connection reopened"); | |
} | |
- HTTPRequest connectRequest = new HTTPRequest(myCharset); | |
- connectRequest.setConnection(this); | |
+ HTTPRequest connectRequest = new HTTPRequest(myCharset); | |
+ connectRequest.setConnection(this); | |
if (myProxyAuthentication != null) { | |
final String authToken = myProxyAuthentication.authenticate(); | |
connectRequest.setProxyAuthentication(authToken); | |
debugLog.logFine(SVNLogType.NETWORK, "auth token set: " + authToken); | |
} | |
- connectRequest.setForceProxyAuth(true); | |
- connectRequest.dispatch("CONNECT", host + ":" + port, null, 0, 0, null); | |
- HTTPStatus status = connectRequest.getStatus(); | |
+ connectRequest.setForceProxyAuth(true); | |
+ connectRequest.dispatch("CONNECT", host + ":" + port, null, 0, 0, null); | |
+ HTTPStatus status = connectRequest.getStatus(); | |
- if (status.getCode() == HttpURLConnection.HTTP_OK) { | |
- myInputStream = null; | |
- myOutputStream = null; | |
+ if (status.getCode() == HttpURLConnection.HTTP_OK) { | |
+ myInputStream = null; | |
+ myOutputStream = null; | |
myProxyAuthentication = null; | |
- mySocket = SVNSocketFactory.createSSLSocket(keyManager != null ? new KeyManager[] { keyManager } : new KeyManager[0], trustManager, host, port, mySocket, readTimeout); | |
- proxyManager.acknowledgeProxyContext(true, null); | |
- return; | |
+ mySocket = SVNSocketFactory.createSSLSocket(keyManager != null ? new KeyManager[] { keyManager } : new KeyManager[0], trustManager, host, port, mySocket, readTimeout); | |
+ proxyManager.acknowledgeProxyContext(true, null); | |
+ return; | |
} else if (status.getCode() == HttpURLConnection.HTTP_PROXY_AUTH) { | |
if (hasToCloseConnection(connectRequest.getResponseHeader())) { | |
close(); | |
debugLog.logFine(SVNLogType.NETWORK, "Connection closed as requested by the response header"); | |
- } | |
+ } | |
authAttempts++; | |
debugLog.logFine(SVNLogType.NETWORK, "authentication attempt #" + authAttempts); | |
Collection<String> proxyAuthHeaders = connectRequest.getResponseHeader().getHeaderValues(HTTPHeader.PROXY_AUTHENTICATE_HEADER); | |
@@ -260,11 +262,11 @@ | |
SVNErrorManager.error(err, SVNLogType.NETWORK); | |
} | |
} else { | |
- SVNURL proxyURL = SVNURL.parseURIEncoded("http://" + proxyManager.getProxyHost() + ":" + proxyManager.getProxyPort()); | |
- SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, "{0} request failed on ''{1}''", new Object[] {"CONNECT", proxyURL}); | |
- proxyManager.acknowledgeProxyContext(false, err); | |
- SVNErrorManager.error(err, connectRequest.getErrorMessage(), SVNLogType.NETWORK); | |
- } | |
+ SVNURL proxyURL = SVNURL.parseURIEncoded("http://" + proxyManager.getProxyHost() + ":" + proxyManager.getProxyPort()); | |
+ SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, "{0} request failed on ''{1}''", new Object[] {"CONNECT", proxyURL}); | |
+ proxyManager.acknowledgeProxyContext(false, err); | |
+ SVNErrorManager.error(err, connectRequest.getErrorMessage(), SVNLogType.NETWORK); | |
+ } | |
} | |
} else if (proxyManager.getProxyUserName() != null && proxyManager.getProxyPassword() != null ){ | |
myProxyAuthentication = new HTTPBasicAuthentication("UTF-8"); | |
@@ -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; | |
@@ -489,14 +506,14 @@ | |
} | |
SVNErrorMessage sslErr = SVNErrorMessage.create(SVNErrorCode.RA_NOT_AUTHORIZED, "SSL handshake failed: ''{0}''", new Object[] { ssl.getMessage() }, SVNErrorMessage.TYPE_ERROR, ssl); | |
if (keyManager != null && keyManager.isInitialized()) { | |
- keyManager.acknowledgeAndClearAuthentication(sslErr); | |
+ keyManager.acknowledgeAndClearAuthentication(sslErr); | |
} else { | |
sslErr = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, "SSL handshake failed: ''{0}''", new Object[] { ssl.getMessage() }, SVNErrorMessage.TYPE_ERROR, ssl); | |
SVNErrorManager.error(sslErr, SVNLogType.NETWORK); | |
- } | |
+ } | |
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) { | |
@@ -569,11 +586,11 @@ | |
if (myProxyAuthentication instanceof HTTPNTLMAuthentication) { | |
ntlmProxyAuthIsRequired = true; | |
- HTTPNTLMAuthentication ntlmProxyAuth = (HTTPNTLMAuthentication) myProxyAuthentication; | |
+ HTTPNTLMAuthentication ntlmProxyAuth = (HTTPNTLMAuthentication)myProxyAuthentication; | |
if (ntlmProxyAuth.isInType3State()) { | |
continue; | |
} | |
- } | |
+ } | |
err = SVNErrorMessage.create(SVNErrorCode.RA_NOT_AUTHORIZED, "HTTP proxy authorization failed"); | |
if (proxyManager != null) { | |
@@ -618,7 +635,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; | |
} | |
@@ -659,10 +677,10 @@ | |
* if this is the first time we get HTTP_UNAUTHORIZED, NTLM is the target auth scheme | |
* and JNA is available, we should try a native auth mechanism first without calling | |
* auth providers. | |
- */ | |
+ */ | |
if (!ntlmAuth.allowPropmtForCredentials()) { | |
- continue; | |
- } | |
+ continue; | |
+ } | |
} | |
if (negoAuth != null && !negoAuth.needsLogin()) { | |
@@ -678,7 +696,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); | |
@@ -756,12 +774,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_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/http/HTTPRequest.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/http/HTTPRequest.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/http/HTTPRequest.java 2014-07-01 03:14:22.345130444 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/http/HTTPRequest.java 2014-07-01 03:13:45.848133528 +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(","); | |
@@ -432,8 +436,8 @@ | |
final String location = status.getHeader() != null ? status.getHeader().getFirstHeaderValue("Location") : null; | |
if (location != null) { | |
- message = status.getCode() == HttpURLConnection.HTTP_MOVED_PERM ? "Repository moved permanently to ''{0}''; please relocate" : | |
- "Repository moved temporarily to ''{0}''; please relocate"; | |
+ message = status.getCode() == HttpURLConnection.HTTP_MOVED_PERM ? "Repository moved permanently to ''{0}''; please relocate" : | |
+ "Repository moved temporarily to ''{0}''; please relocate"; | |
return SVNErrorMessage.create(SVNErrorCode.RA_DAV_RELOCATED, message, location); | |
} else { | |
message = status.getCode() == HttpURLConnection.HTTP_MOVED_PERM ? "Repository moved permanently; please relocate" : | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/http/HTTPSSLKeyManager.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/http/HTTPSSLKeyManager.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/http/HTTPSSLKeyManager.java 2014-07-01 03:14:22.298130947 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/dav/http/HTTPSSLKeyManager.java 2014-07-01 03:13:45.849133441 +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) { | |
@@ -393,7 +400,7 @@ | |
throw new SVNException(SVNErrorMessage.UNKNOWN_ERROR_MESSAGE, exception); | |
} | |
} | |
- | |
+ | |
public boolean isInitialized() { | |
return myKeyManagers != null; | |
} | |
@@ -437,7 +444,7 @@ | |
((ISVNSSLPasspharsePromptSupport) authenticationManager).isSSLPassphrasePromtSupported()) { | |
keyManagers = loadClientCertificate(myAuthentication); | |
} else { | |
- keyManagers = loadClientCertificate(myAuthentication.getCertificateFile(), myAuthentication.getPassword()); | |
+ keyManagers = loadClientCertificate(new ByteArrayInputStream(myAuthentication.getCertificateFile()), myAuthentication.getPassword()); | |
} | |
} | |
@@ -470,4 +477,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_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/fs/FSCommitter.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/fs/FSCommitter.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/fs/FSCommitter.java 2014-07-01 03:14:22.091129770 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/fs/FSCommitter.java 2014-07-01 03:13:45.849133441 +0000 | |
@@ -61,7 +61,7 @@ | |
private Collection<String> myLockTokens; | |
private Map<String, String> myAutoUnlockPaths; | |
private String myAuthor; | |
- | |
+ | |
public static synchronized void setAutoUnlock(boolean autoUnlock) { | |
ourAutoUnlock = autoUnlock; | |
} | |
@@ -78,7 +78,7 @@ | |
myAutoUnlockPaths = new HashMap<String, String>(); | |
myAuthor = author; | |
} | |
- | |
+ | |
public Map<String, String> getAutoUnlockPaths() { | |
return myAutoUnlockPaths; | |
} | |
@@ -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); | |
@@ -779,11 +780,11 @@ | |
if (isAutoUnlock()) { | |
scheduleForAutoUnlock(username, path, lock); | |
} else { | |
- verifyLock(lock, lockTokens, username); | |
- } | |
+ verifyLock(lock, lockTokens, username); | |
} | |
} | |
} | |
+ } | |
private void scheduleForAutoUnlock(final String username, String path, SVNLock lock) { | |
myAutoUnlockPaths.put(path, lock.getID()); | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/fs/FSFS.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/fs/FSFS.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/fs/FSFS.java 2014-07-01 03:14:21.867130220 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/fs/FSFS.java 2014-07-01 03:13:45.850133351 +0000 | |
@@ -35,7 +35,6 @@ | |
import org.tmatesoft.svn.core.SVNProperty; | |
import org.tmatesoft.svn.core.SVNPropertyValue; | |
import org.tmatesoft.svn.core.SVNRevisionProperty; | |
-import org.tmatesoft.svn.core.internal.delta.SVNDeltaReader; | |
import org.tmatesoft.svn.core.internal.io.fs.revprop.SVNFSFSPackedRevProps; | |
import org.tmatesoft.svn.core.internal.io.fs.revprop.SVNFSFSPackedRevPropsManifest; | |
import org.tmatesoft.svn.core.internal.util.SVNDate; | |
@@ -49,13 +48,9 @@ | |
import org.tmatesoft.svn.core.internal.wc.SVNFileType; | |
import org.tmatesoft.svn.core.internal.wc.SVNFileUtil; | |
import org.tmatesoft.svn.core.internal.wc.SVNWCProperties; | |
-import org.tmatesoft.svn.core.io.ISVNDeltaConsumer; | |
import org.tmatesoft.svn.core.io.ISVNLockHandler; | |
import org.tmatesoft.svn.core.io.SVNLocationEntry; | |
import org.tmatesoft.svn.core.io.SVNRepository; | |
-import org.tmatesoft.svn.core.io.diff.SVNDeltaProcessor; | |
-import org.tmatesoft.svn.core.io.diff.SVNDiffWindow; | |
-import org.tmatesoft.svn.core.wc.SVNRevision; | |
import org.tmatesoft.svn.util.SVNLogType; | |
/** | |
@@ -316,7 +311,7 @@ | |
} else { | |
myRevpropPackSize = 0x10000; | |
myCompressPackedRevprops = false; | |
- } | |
+ } | |
} | |
public String getFSType() throws SVNException { | |
@@ -630,9 +625,6 @@ | |
public SVNProperties getRevisionProperties(long revision) throws SVNException { | |
try{ | |
- if (!SVNRevision.isValidRevisionNumber(revision)) { | |
- revision = getYoungestRevision(); | |
- } | |
return readRevisionProperties(revision); | |
} catch(SVNException e ) { | |
if(e.getErrorMessage().getErrorCode()==SVNErrorCode.FS_NO_SUCH_REVISION && myDBFormat >= MIN_PACKED_REVPROP_FORMAT ) { | |
@@ -657,7 +649,7 @@ | |
} finally { | |
file.close(); | |
} | |
- } | |
+ } | |
if (myDBFormat >= MIN_PACKED_REVPROP_FORMAT && properties == null) { | |
// read packed revision props | |
return readPackedRevisionProperties(revision); | |
@@ -665,15 +657,15 @@ | |
} | |
return properties == null ? new SVNProperties() : properties; | |
} | |
- | |
+ | |
private SVNProperties readPackedRevisionProperties(long revision) throws SVNException { | |
if (!isPackedRevisionProperties(revision)) { | |
updateMinUnpackedRevProp(); | |
} | |
if (!isPackedRevisionProperties(revision)) { | |
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NO_SUCH_REVISION, "No such packed revision {0}", (Long) revision); | |
- SVNErrorManager.error(err, SVNLogType.FSFS); | |
- } | |
+ SVNErrorManager.error(err, SVNLogType.FSFS); | |
+ } | |
final File packFile = getPackedRevPropFile(revision); | |
final SVNFSFSPackedRevProps packedRevProps = SVNFSFSPackedRevProps.fromPackFile(packFile); | |
final SVNProperties properties = packedRevProps.parseProperties(revision); | |
@@ -756,7 +748,7 @@ | |
if (c < 0) { | |
SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.FS_CORRUPT); | |
SVNErrorManager.error(errorMessage, SVNLogType.FSFS); | |
- } | |
+ } | |
if (c != '\n' && (c < '0'|| c > '9')) { | |
SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.FS_CORRUPT); | |
SVNErrorManager.error(errorMessage, SVNLogType.FSFS); | |
@@ -850,55 +842,14 @@ | |
revisionFile = openAndSeekRepresentation(txtRep); | |
String repHeader = revisionFile.readLine(160); | |
- SVNProperties rawEntries = null; | |
- String checksum = null; | |
- | |
- if ("PLAIN".equals(repHeader)) { | |
- revisionFile.resetDigest(); | |
- rawEntries = revisionFile.readProperties(false, false); | |
- checksum = revisionFile.digest(); | |
- } else if ("DELTA".equals(repHeader)) { | |
- SVNDeltaReader deltaReader = new SVNDeltaReader(); | |
- byte[] buffer = new byte[2048]; | |
- int readCount = -1; | |
- int length = (int) txtRep.getSize(); | |
- | |
- final SVNDeltaProcessor deltaProcessor = new SVNDeltaProcessor(); | |
- final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | |
- | |
- //TODO if repHeader is "DELTA source length", deltaProcessor should be applied to that source | |
- deltaProcessor.applyTextDelta(SVNFileUtil.DUMMY_IN, byteArrayOutputStream, true); | |
- | |
- while ((readCount = revisionFile.read(buffer, 0, length)) != -1) { | |
- if (readCount == 0) { | |
- continue; | |
- } | |
- deltaReader.nextWindow(buffer, 0, readCount, "", new ISVNDeltaConsumer() { | |
- public void applyTextDelta(String path, String baseChecksum) throws SVNException { | |
- } | |
- | |
- public OutputStream textDeltaChunk(String path, SVNDiffWindow diffWindow) throws SVNException { | |
- return deltaProcessor.textDeltaChunk(diffWindow); | |
- } | |
- | |
- public void textDeltaEnd(String path) throws SVNException { | |
- } | |
- }); | |
- length -= readCount; | |
- if (length == 0) { | |
- break; | |
- } | |
- } | |
- | |
- checksum = deltaProcessor.textDeltaEnd(); | |
- rawEntries = readProperties(byteArrayOutputStream.toByteArray()); | |
- } else { | |
- //if this happens, see "TODO" above | |
- SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_CORRUPT, "Malformed representation header ''{0}''", repHeader); | |
+ if(!"PLAIN".equals(repHeader)){ | |
+ SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_CORRUPT, "Malformed representation header"); | |
SVNErrorManager.error(err, SVNLogType.FSFS); | |
} | |
- SVNErrorManager.assertionFailure(checksum != null, "Checksum should be computed", SVNLogType.FSFS); | |
+ revisionFile.resetDigest(); | |
+ SVNProperties rawEntries = revisionFile.readProperties(false, false); | |
+ String checksum = revisionFile.digest(); | |
if (!checksum.equals(txtRep.getMD5HexDigest())) { | |
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_CORRUPT, | |
@@ -908,9 +859,6 @@ | |
} | |
return parsePlainRepresentation(rawEntries, false); | |
- } catch (IOException e) { | |
- SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e); | |
- SVNErrorManager.error(errorMessage, SVNLogType.FSFS); | |
} finally { | |
if(revisionFile != null){ | |
revisionFile.close(); | |
@@ -1106,7 +1054,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); | |
@@ -1178,8 +1126,8 @@ | |
writeLock.lock(); | |
if (!isPackedRevisionProperties(revision)) { | |
- SVNWCProperties revProps = new SVNWCProperties(getRevisionPropertiesFile(revision, false), null); | |
- revProps.setPropertyValue(propertyName, propertyValue); | |
+ SVNWCProperties revProps = new SVNWCProperties(getRevisionPropertiesFile(revision, false), null); | |
+ revProps.setPropertyValue(propertyName, propertyValue); | |
} else { | |
final File packShardDirectory = getPackedRevPropsShardPath(revision); | |
final File manifestFile = new File(packShardDirectory, MANIFEST_FILE); | |
@@ -1223,7 +1171,7 @@ | |
FSWriteLock.release(writeLock); | |
} | |
} | |
- } | |
+ } | |
protected long getRevPropPackSize() { | |
return myRevpropPackSize; | |
@@ -1573,7 +1521,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); | |
} | |
} | |
@@ -1617,6 +1565,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_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/fs/FSRepository.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/fs/FSRepository.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/fs/FSRepository.java 2014-07-01 03:14:22.078130314 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/fs/FSRepository.java 2014-07-01 03:13:45.852133352 +0000 | |
@@ -678,7 +678,7 @@ | |
return true; | |
} else if (capability == SVNCapability.ATOMIC_REVPROPS) { | |
return false; | |
- } else if (capability == SVNCapability.MERGE_INFO) { | |
+ } else if (capability == SVNCapability.MERGE_INFO) { | |
try { | |
getMergeInfoImpl(new String[] { "" }, 0, SVNMergeInfoInheritance.EXPLICIT, false); | |
} catch (SVNException svne) { | |
@@ -699,7 +699,7 @@ | |
SVNErrorManager.error(err, SVNLogType.FSFS); | |
return false; | |
} | |
- | |
+ | |
protected void getInheritedPropertiesImpl(String path, long revision, String propertyName, ISVNInheritedPropertiesHandler handler) throws SVNException { | |
try { | |
openRepository(); | |
@@ -791,8 +791,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); | |
} | |
} | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/SVNConnection.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/SVNConnection.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/SVNConnection.java 2014-07-01 03:14:21.778131516 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/SVNConnection.java 2014-07-01 03:12:33.452138128 +0000 | |
@@ -117,11 +117,7 @@ | |
if (r >= 0 && attempt == 0) { | |
return skipLeadingGrabage(attempt + 1); | |
} | |
- if (r <= 0) { | |
- SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_SVN_MALFORMED_DATA, "Handshake failed, data stream ended unexpectedly"); | |
- SVNErrorManager.error(err, SVNLogType.NETWORK); | |
- } | |
- SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_SVN_MALFORMED_DATA, "Handshake failed, received: ''{0}''", new String(bytes, 0, r)); | |
+ SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_SVN_MALFORMED_DATA, "Handshake failed, received: ''{0}''", new String(bytes)); | |
SVNErrorManager.error(err, SVNLogType.NETWORK); | |
return null; | |
} | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/SVNEditModeReader.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/SVNEditModeReader.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/SVNEditModeReader.java 2014-07-01 03:14:21.709130714 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/SVNEditModeReader.java 2014-07-01 03:12:33.453138065 +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_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/SVNReader.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/SVNReader.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/SVNReader.java 2014-07-01 03:14:21.782130902 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/SVNReader.java 2014-07-01 03:12:33.454138128 +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_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/SVNRepositoryImpl.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/SVNRepositoryImpl.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/SVNRepositoryImpl.java 2014-07-01 03:14:21.780132066 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/SVNRepositoryImpl.java 2014-07-01 03:13:45.855133418 +0000 | |
@@ -1376,7 +1376,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_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/sasl/SVNSaslAuthenticator.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/sasl/SVNSaslAuthenticator.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/sasl/SVNSaslAuthenticator.java 2014-07-01 03:14:21.737131330 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/sasl/SVNSaslAuthenticator.java 2014-07-01 03:12:33.456138123 +0000 | |
@@ -94,8 +94,6 @@ | |
if (myClient == null) { | |
return new SVNPlainAuthenticator(getConnection()).authenticate(mechs, realm, repository); | |
} | |
- // reiterate from the first available credentials next time: | |
- boolean startOver = false; | |
try { | |
if (tryAuthentication(repository, getMechanismName(myClient, isAnonymous))) { | |
if (myAuthenticationManager != null && myAuthentication != null) { | |
@@ -112,7 +110,6 @@ | |
// it may be plain replaced with anonymous. | |
String mechName = getMechanismName(myClient, isAnonymous); | |
mechs.remove(mechName); | |
- startOver = true; | |
} | |
if (myAuthenticationManager != null) { | |
SVNErrorMessage error = getLastError(); | |
@@ -134,9 +131,6 @@ | |
failed = true; | |
break; | |
} | |
- if (startOver) { | |
- myAuthentication = null; | |
- } | |
myClient = createSaslClient(mechs, realm, repository, repository.getLocation()); | |
} | |
} finally { | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/ssh/SshSession.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/ssh/SshSession.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/ssh/SshSession.java 2014-07-01 03:14:21.713130845 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/io/svn/ssh/SshSession.java 2014-07-01 03:12:33.458137982 +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_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/util/jna/SVNMacOsKeychain.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/util/jna/SVNMacOsKeychain.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/util/jna/SVNMacOsKeychain.java 2014-07-01 03:14:27.836130077 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/util/jna/SVNMacOsKeychain.java 2014-07-01 03:12:33.470138246 +0000 | |
@@ -32,9 +32,8 @@ | |
private static final int ERR_SEC_ITEM_NOT_FOUND = -25300; | |
- public static boolean isEnabled() { | |
- final boolean enabled = Boolean.valueOf(System.getProperty("svnkit.library.osxkeychain.enabled", "true")); | |
- return enabled && SVNFileUtil.isOSX && JNALibraryLoader.getMacOsSecurityLibrary() != null; | |
+ static boolean isEnabled() { | |
+ return SVNFileUtil.isOSX && JNALibraryLoader.getMacOsSecurityLibrary() != null; | |
} | |
public static synchronized boolean setPassword(String realm, String userName, String password, boolean nonInteractive) throws SVNException { | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/DefaultSVNAuthenticationManager.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/DefaultSVNAuthenticationManager.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/DefaultSVNAuthenticationManager.java 2014-07-01 03:14:24.272129955 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/DefaultSVNAuthenticationManager.java 2014-07-01 03:13:45.859133631 +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) { | |
} | |
@@ -332,7 +346,7 @@ | |
public boolean isSSLPassphrasePromptSupported() { | |
if (getAuthenticationStorageOptions() == ISVNAuthenticationStorageOptions.DEFAULT) { | |
return DefaultSVNAuthenticationManager.this.isSSLPassphrasePromtSupported(); | |
- } | |
+ } | |
return getAuthenticationStorageOptions().isSSLPassphrasePromptSupported(); | |
} | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/DefaultSVNPersistentAuthenticationProvider.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/DefaultSVNPersistentAuthenticationProvider.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/DefaultSVNPersistentAuthenticationProvider.java 2014-07-01 03:14:24.273130211 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/DefaultSVNPersistentAuthenticationProvider.java 2014-07-01 03:13:45.860133444 +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 | |
@@ -257,7 +260,7 @@ | |
} else if (ISVNAuthenticationManager.USERNAME.equals(kind)) { | |
return new SVNUserNameAuthentication(userName, authMayBeStored, url, false); | |
} else if (ISVNAuthenticationManager.SSL.equals(kind)) { | |
- if (isMSCapi(sslKind)) { | |
+ if (isMSCapi(sslKind)) { | |
final String alias = SVNPropertyValue.getPropertyAsString(values.getSVNPropertyValue("alias")); | |
return new SVNSSLAuthentication(SVNSSLAuthentication.MSCAPI, alias, authMayBeStored, url, false); | |
} | |
@@ -491,12 +494,13 @@ | |
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())) { | |
values.put("ssl-kind", sslAuth.getSSLKind()); | |
if (sslAuth.getAlias() != null) { | |
- values.put("alias", sslAuth.getAlias()); | |
+ values.put("alias", sslAuth.getAlias()); | |
} | |
modified = true; | |
} | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/SVNAdminUtil.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/SVNAdminUtil.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/SVNAdminUtil.java 2014-07-01 03:14:23.377131120 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/SVNAdminUtil.java 2014-07-01 03:12:33.480138699 +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_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/SVNErrorManager.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/SVNErrorManager.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/SVNErrorManager.java 2014-07-01 03:14:23.442130123 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/SVNErrorManager.java 2014-07-01 03:12:33.485138250 +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_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/SVNEventFactory.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/SVNEventFactory.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/SVNEventFactory.java 2014-07-01 03:14:23.394130653 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/SVNEventFactory.java 2014-07-01 03:12:33.485138250 +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_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/admin/SVNAdminArea.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/admin/SVNAdminArea.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/admin/SVNAdminArea.java 2014-07-01 03:14:24.724130827 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/admin/SVNAdminArea.java 2014-07-01 03:12:33.497138494 +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_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/admin/SVNLogRunner.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/admin/SVNLogRunner.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/admin/SVNLogRunner.java 2014-07-01 03:14:24.324130166 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/admin/SVNLogRunner.java 2014-07-01 03:12:33.502138547 +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_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/admin/SVNXMLAdminAreaFactory.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/admin/SVNXMLAdminAreaFactory.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/admin/SVNXMLAdminAreaFactory.java 2014-07-01 03:14:24.739130461 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc/admin/SVNXMLAdminAreaFactory.java 2014-07-01 03:12:33.505138739 +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_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc16/SVNUpdateClient16.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc16/SVNUpdateClient16.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc16/SVNUpdateClient16.java 2014-07-01 03:14:19.357131263 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc16/SVNUpdateClient16.java 2014-07-01 03:12:33.512138350 +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_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/SVNRemoteStatusEditor17.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/SVNRemoteStatusEditor17.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/SVNRemoteStatusEditor17.java 2014-07-01 03:14:21.613130655 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/SVNRemoteStatusEditor17.java 2014-07-01 03:13:45.865133411 +0000 | |
@@ -105,9 +105,6 @@ | |
/* Use the public API to get a statstruct, and put it into the hash. */ | |
statstruct = internalStatus(myWCContext, localAbsPath); | |
- if (statstruct.getNodeStatus() == SVNStatusType.STATUS_UNVERSIONED || statstruct.getNodeStatus() == SVNStatusType.STATUS_NONE) { | |
- statstruct.setWorkingCopyFormat(myAnchorStatus.getWorkingCopyFormat()); | |
- } | |
statstruct.setRepositoryLock(reposLock); | |
statushash.put(localAbsPath, statstruct); | |
} | |
@@ -451,9 +448,6 @@ | |
return; | |
statstruct = internalStatus(myWCContext, localAbsPath); | |
statstruct.setRepositoryLock(reposLock); | |
- if (statstruct.getNodeStatus() == SVNStatusType.STATUS_UNVERSIONED || statstruct.getNodeStatus() == SVNStatusType.STATUS_NONE) { | |
- statstruct.setWorkingCopyFormat(myAnchorStatus.getWorkingCopyFormat()); | |
- } | |
statushash.put(localAbsPath, statstruct); | |
} | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/SVNStatusEditor17.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/SVNStatusEditor17.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/SVNStatusEditor17.java 2014-07-01 03:14:21.630130884 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/SVNStatusEditor17.java 2014-07-01 03:13:45.876132611 +0000 | |
@@ -206,7 +206,7 @@ | |
return status; | |
} | |
- private void sendUnversionedItem(File nodeAbsPath, SVNNodeKind pathKind, boolean treeConflicted, Collection<String> patterns, boolean noIgnore, int workingCopyFormat, ISvnObjectReceiver<SvnStatus> handler) throws SVNException { | |
+ private void sendUnversionedItem(File nodeAbsPath, SVNNodeKind pathKind, boolean treeConflicted, Collection<String> patterns, boolean noIgnore, ISvnObjectReceiver<SvnStatus> handler) throws SVNException { | |
boolean isIgnored = SvnNgPropertiesManager.isIgnored(SVNFileUtil.getFileName(nodeAbsPath), patterns); | |
boolean isExternal = isExternal(nodeAbsPath); | |
SvnStatus status = assembleUnversioned17(nodeAbsPath, pathKind, treeConflicted, isIgnored); | |
@@ -217,9 +217,6 @@ | |
if (status.isConflicted()) { | |
isIgnored = false; | |
} | |
- if (workingCopyFormat > 0) { | |
- status.setWorkingCopyFormat(workingCopyFormat); | |
- } | |
if (handler != null && (noIgnore || !isIgnored || isExternal)) { | |
handler.receive(SvnTarget.fromFile(nodeAbsPath), status); | |
} | |
@@ -725,7 +722,7 @@ | |
if (ignorePatterns != null && patterns == null) { | |
patterns = collectIgnorePatterns(wcRoot, wcRoot.computeRelPath(localAbsPath), ignorePatterns); | |
} | |
- sendUnversionedItem(nodeAbsPath, SVNFileType.getNodeKind(nodeFileType), true, patterns, noIgnore, wcRoot.getFormat(), handler); | |
+ sendUnversionedItem(nodeAbsPath, SVNFileType.getNodeKind(nodeFileType), true, patterns, noIgnore, handler); | |
continue; | |
} | |
if (nodeFileType == null) { | |
@@ -740,7 +737,7 @@ | |
if (ignorePatterns != null && patterns == null) { | |
patterns = collectIgnorePatterns(wcRoot, wcRoot.computeRelPath(localAbsPath), ignorePatterns); | |
} | |
- sendUnversionedItem(nodeAbsPath, SVNFileType.getNodeKind(nodeFileType), false, patterns, noIgnore || selected != null, wcRoot.getFormat(), handler); | |
+ sendUnversionedItem(nodeAbsPath, SVNFileType.getNodeKind(nodeFileType), false, patterns, noIgnore || selected != null, handler); | |
} | |
} | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/SVNWCContext.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/SVNWCContext.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/SVNWCContext.java 2014-07-01 03:14:21.612130378 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/SVNWCContext.java 2014-07-01 03:13:45.880132410 +0000 | |
@@ -2339,11 +2339,7 @@ | |
boolean didMerge = false; | |
- if (toVal == null) { | |
- theirProps.remove(propertyName); | |
- } else { | |
- theirProps.put(propertyName, toVal); | |
- } | |
+ theirProps.put(propertyName, toVal); | |
mergePropertiesInfo.mergeOutcome = setPropMergeState(mergePropertiesInfo.mergeOutcome, SVNStatusType.CHANGED); | |
SVNPropertyValue resultVal = workingVal; | |
@@ -5366,10 +5362,8 @@ | |
new QSequenceLineRAByteData(SVNPropertyValue.getPropertyAsBytes(workingVal)), | |
new QSequenceLineRAByteData(SVNPropertyValue.getPropertyAsBytes(incomingNewVal)), | |
svnDiffOptions, byteArrayOutputStream, SVNDiffConflictChoiceStyle.CHOOSE_MODIFIED_LATEST); | |
- File tempDir = getDb().getWCRootTempDir(localAbsPath); | |
- File mergedFile = SVNFileUtil.createUniqueFile(tempDir, SVNFileUtil.getFileName(localAbsPath), ".prej", false); | |
+ File mergedFile = SVNFileUtil.createUniqueFile(conflictDescription.getMergedFile(), null, null, false); | |
SVNFileUtil.writeToFile(mergedFile, byteArrayOutputStream.toByteArray()); | |
- conflictDescription.setMergedFile(mergedFile); | |
} catch (IOException e) { | |
SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.IO_ERROR); | |
SVNErrorManager.error(errorMessage, SVNLogType.WC); | |
@@ -5442,9 +5436,6 @@ | |
if (conflictDescription.getTheirFile() != null) { | |
SVNFileUtil.deleteFile(conflictDescription.getTheirFile()); | |
} | |
- if (conflictDescription.getMergedFile() != null) { | |
- SVNFileUtil.deleteFile(conflictDescription.getMergedFile()); | |
- } | |
} | |
} catch (SVNException e) { | |
SVNDebugLog.getDefaultLog().logError(SVNLogType.WC, e); | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/ISVNWCDb.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/ISVNWCDb.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/ISVNWCDb.java 2014-07-01 03:14:20.792131994 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/ISVNWCDb.java 2014-07-01 03:13:45.881132763 +0000 | |
@@ -1633,7 +1633,7 @@ | |
public SVNWCDbRoot root; | |
} | |
- void upgradeBegin(File localAbspath, SVNWCDbUpgradeData upgradeData, SVNURL repositoryRootUrl, String repositoryUUID, int targetWorkingCopyFormat) throws SVNException; | |
+ void upgradeBegin(File localAbspath, SVNWCDbUpgradeData upgradeData, SVNURL repositoryRootUrl, String repositoryUUID) throws SVNException; | |
class SVNWCDbNodeCheckReplaceData { | |
public static SVNWCDbNodeCheckReplaceData NO_REPLACE = new SVNWCDbNodeCheckReplaceData(false, false, false); | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/SVNWCDb.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/SVNWCDb.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/SVNWCDb.java 2014-07-01 03:14:20.783131157 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/SVNWCDb.java 2014-07-01 03:13:45.884132653 +0000 | |
@@ -100,13 +100,20 @@ | |
import org.tmatesoft.svn.core.internal.wc17.db.SvnWcDbConflicts.ConflictInfo; | |
import org.tmatesoft.svn.core.internal.wc17.db.SvnWcDbConflicts.TextConflictInfo; | |
import org.tmatesoft.svn.core.internal.wc17.db.SvnWcDbConflicts.TreeConflictInfo; | |
-import org.tmatesoft.svn.core.internal.wc17.db.statement.*; | |
+import org.tmatesoft.svn.core.internal.wc17.db.statement.SVNWCDbCreateSchema; | |
+import org.tmatesoft.svn.core.internal.wc17.db.statement.SVNWCDbInsertDeleteList; | |
+import org.tmatesoft.svn.core.internal.wc17.db.statement.SVNWCDbSchema; | |
import org.tmatesoft.svn.core.internal.wc17.db.statement.SVNWCDbSchema.ACTUAL_NODE__Fields; | |
import org.tmatesoft.svn.core.internal.wc17.db.statement.SVNWCDbSchema.DELETE_LIST__Fields; | |
import org.tmatesoft.svn.core.internal.wc17.db.statement.SVNWCDbSchema.NODES__Fields; | |
import org.tmatesoft.svn.core.internal.wc17.db.statement.SVNWCDbSchema.PRISTINE__Fields; | |
import org.tmatesoft.svn.core.internal.wc17.db.statement.SVNWCDbSchema.REPOSITORY__Fields; | |
import org.tmatesoft.svn.core.internal.wc17.db.statement.SVNWCDbSchema.WC_LOCK__Fields; | |
+import org.tmatesoft.svn.core.internal.wc17.db.statement.SVNWCDbSelectCommittableExternalsImmediatelyBelow; | |
+import org.tmatesoft.svn.core.internal.wc17.db.statement.SVNWCDbSelectDeletionInfo; | |
+import org.tmatesoft.svn.core.internal.wc17.db.statement.SVNWCDbSelectMinMaxRevisions; | |
+import org.tmatesoft.svn.core.internal.wc17.db.statement.SVNWCDbSelectOpDepthMovedPair; | |
+import org.tmatesoft.svn.core.internal.wc17.db.statement.SVNWCDbStatements; | |
import org.tmatesoft.svn.core.io.SVNRepository; | |
import org.tmatesoft.svn.core.wc.ISVNEventHandler; | |
import org.tmatesoft.svn.core.wc.ISVNOptions; | |
@@ -479,9 +486,9 @@ | |
pdh.getWCRoot().getSDb().runTransaction(ibb); | |
pdh.flushEntries(localAbsPath); | |
} | |
- | |
+ | |
private class Delete implements SVNSqlJetTransaction { | |
- | |
+ | |
public SVNWCDbRoot root; | |
public File localRelPath; | |
public long deleteDepth; | |
@@ -492,261 +499,244 @@ | |
public SVNSkel conflict; | |
public void transaction(SVNSqlJetDb db) throws SqlJetException, SVNException { | |
- int deleteOpDepth = SVNWCUtils.relpathDepth(localRelPath); | |
- | |
- SVNSqlJetStatement stmt = root.getSDb().getStatement(SVNWCDbStatements.SELECT_NODE_INFO); | |
- try { | |
- stmt.bindf("is", root.getWcId(), localRelPath); | |
- boolean haveRow = stmt.next(); | |
- if (!haveRow) { | |
- SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.WC_PATH_NOT_FOUND, "The node ''{0}'' was not found.", SVNFileUtil.createFilePath(root.getAbsPath(), localRelPath)); | |
- SVNErrorManager.error(errorMessage, SVNLogType.WC); | |
+ WCDbInfo info = readInfo(root, localRelPath, InfoField.status, InfoField.opRoot, InfoField.kind); | |
+ SVNWCDbStatus status = info.status; | |
+ if (status == SVNWCDbStatus.Deleted || status == SVNWCDbStatus.NotPresent) { | |
+ return; | |
+ } | |
+ SVNWCDbKind kind = info.kind; | |
+ SVNSqlJetStatement stmt; | |
+ if (status == SVNWCDbStatus.Normal && kind == SVNWCDbKind.Dir) { | |
+ stmt = root.getSDb().getStatement(SVNWCDbStatements.HAS_SERVER_EXCLUDED_NODES); | |
+ try { | |
+ stmt.bindf("is", root.getWcId(), localRelPath); | |
+ if (stmt.next()) { | |
+ File absentPath = getColumnPath(stmt, SVNWCDbSchema.NODES__Fields.local_relpath); | |
+ SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.WC_PATH_UNEXPECTED_STATUS, | |
+ "Cannot delete ''{0}'' as ''{1}'' is excluded by server", localRelPath, absentPath); | |
+ SVNErrorManager.error(err, SVNLogType.WC); | |
+ } | |
+ } finally { | |
+ stmt.reset(); | |
} | |
- int workingOpDepth = (int) stmt.getColumnLong(NODES__Fields.op_depth); | |
- SVNWCDbStatus status = SvnWcDbStatementUtil.getColumnPresence(stmt, NODES__Fields.presence); | |
- SVNWCDbKind kind = SvnWcDbStatementUtil.getColumnKind(stmt, NODES__Fields.kind); | |
- | |
- boolean opRoot; | |
- boolean addWork = false; | |
- int keepOpDepth = 0; | |
- if (workingOpDepth < deleteOpDepth) { | |
- opRoot = false; | |
- addWork = true; | |
- keepOpDepth = workingOpDepth; | |
- } else { | |
- opRoot = true; | |
+ } else if (status == SVNWCDbStatus.ServerExcluded) { | |
+ SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.WC_PATH_UNEXPECTED_STATUS, "Cannot delete '{0}' as it is excluded by server", SVNFileUtil.createFilePath(root.getAbsPath(), localRelPath)); | |
+ SVNErrorManager.error(errorMessage, SVNLogType.WC); | |
+ } else if (status == SVNWCDbStatus.Excluded) { | |
+ SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.WC_PATH_UNEXPECTED_STATUS, "Cannot delete '{0}' as it is excluded", SVNFileUtil.createFilePath(root.getAbsPath(), localRelPath)); | |
+ SVNErrorManager.error(errorMessage, SVNLogType.WC); | |
+ } | |
- haveRow = stmt.next(); | |
- if (haveRow) { | |
- int belowOpDepth = (int) stmt.getColumnLong(NODES__Fields.op_depth); | |
- SVNWCDbStatus belowStatus = SvnWcDbStatementUtil.getColumnPresence(stmt, NODES__Fields.presence); | |
+ List<MovedNode> movedNodes = null; | |
+ if (movedToRelPath != null) { | |
+ movedNodes = new ArrayList<MovedNode>(); | |
- if (belowStatus != SVNWCDbStatus.NotPresent && belowStatus != SVNWCDbStatus.BaseDeleted) { | |
- addWork = true; | |
- keepOpDepth = belowOpDepth; | |
- } else { | |
- keepOpDepth = 0; | |
- } | |
+ int movedOpDepth = 0; | |
+ File movedFromRelPath = null; | |
+ if (status == SVNWCDbStatus.Added) { | |
+ Structure<StructureFields.AdditionInfo> additionInfoStructure = SvnWcDbShared.scanAddition(root, localRelPath, StructureFields.AdditionInfo.status, StructureFields.AdditionInfo.movedFromRelPath, StructureFields.AdditionInfo.movedFromOpDepth); | |
+ status = additionInfoStructure.get(StructureFields.AdditionInfo.status); | |
+ movedFromRelPath = additionInfoStructure.get(StructureFields.AdditionInfo.movedFromRelPath); | |
+ movedOpDepth = (int) additionInfoStructure.lng(StructureFields.AdditionInfo.movedFromOpDepth); | |
+ } | |
+ | |
+ if (info.opRoot && movedFromRelPath != null) { | |
+ File part = SVNFileUtil.skipAncestor(localRelPath, movedFromRelPath); | |
+ MovedNode movedNode = new MovedNode(); | |
+ if (part == null) { | |
+ movedNode.localRelPath = movedFromRelPath; | |
} else { | |
- keepOpDepth = -1; | |
+ movedNode.localRelPath = SVNFileUtil.createFilePath(movedToRelPath, part); | |
} | |
- } | |
- | |
- stmt.reset(); | |
+ movedNode.opDepth = movedOpDepth; | |
+ movedNode.movedToRelPath = movedToRelPath; | |
+ movedNodes.add(movedNode); | |
- if (workingOpDepth != 0) { | |
- status = convertToWorkingStatus(status); | |
+ } else if (!info.opRoot && (status == SVNWCDbStatus.Normal || status == SVNWCDbStatus.Copied || status == SVNWCDbStatus.MovedHere)) { | |
+ MovedNode movedNode = new MovedNode(); | |
+ movedNode.localRelPath = localRelPath; | |
+ movedNode.opDepth = (int) deleteDepth; | |
+ movedNode.movedToRelPath = movedToRelPath; | |
+ movedNodes.add(movedNode); | |
} | |
- if (status == SVNWCDbStatus.Deleted || status == SVNWCDbStatus.NotPresent) { | |
- return; | |
- } | |
- | |
- if (status == SVNWCDbStatus.Normal && kind == SVNWCDbKind.Dir) { | |
+ stmt = root.getSDb().getStatement(SVNWCDbStatements.UPDATE_MOVED_TO_DESCENDANTS); | |
+ try { | |
+ stmt.bindf("iss", root.getWcId(), localRelPath, movedToRelPath); | |
+ stmt.done(); | |
+ } finally { | |
stmt.reset(); | |
- stmt = root.getSDb().getStatement(SVNWCDbStatements.HAS_SERVER_EXCLUDED_DESCENDANTS); | |
- stmt.bindf("is", root.getWcId(), localRelPath); | |
- haveRow = stmt.next(); | |
- if (haveRow) { | |
- String absentPath = stmt.getColumnString(NODES__Fields.local_relpath); | |
- | |
- SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.WC_PATH_UNEXPECTED_STATUS, "Cannot delete ''{0}'' as ''{1}'' is excluded by server", SVNFileUtil.createFilePath(root.getAbsPath(), localRelPath), SVNFileUtil.createFilePath(root.getAbsPath(), absentPath)); | |
- SVNErrorManager.error(errorMessage, SVNLogType.WC); | |
- } | |
- } else if (status == SVNWCDbStatus.ServerExcluded) { | |
- SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.WC_PATH_UNEXPECTED_STATUS, "Cannot delete ''{0}'' as it is excluded by server", SVNFileUtil.createFilePath(root.getAbsPath(), localRelPath)); | |
- SVNErrorManager.error(errorMessage, SVNLogType.WC); | |
- } else if (status == SVNWCDbStatus.Excluded) { | |
- SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.WC_PATH_UNEXPECTED_STATUS, "Cannot delete ''{0}'' as it is excluded", SVNFileUtil.createFilePath(root.getAbsPath(), localRelPath)); | |
- SVNErrorManager.error(errorMessage, SVNLogType.WC); | |
} | |
- | |
- List<MovedNode> movedNodes = null; | |
- if (movedToRelPath != null) { | |
- movedNodes = new ArrayList<MovedNode>(); | |
- | |
- int movedOpDepth = 0; | |
- File movedFromRelPath = null; | |
- if (status == SVNWCDbStatus.Added) { | |
- Structure<StructureFields.AdditionInfo> additionInfoStructure = SvnWcDbShared.scanAddition(root, localRelPath, StructureFields.AdditionInfo.status, StructureFields.AdditionInfo.movedFromRelPath, StructureFields.AdditionInfo.movedFromOpDepth); | |
- status = additionInfoStructure.get(StructureFields.AdditionInfo.status); | |
- movedFromRelPath = additionInfoStructure.get(StructureFields.AdditionInfo.movedFromRelPath); | |
- movedOpDepth = (int) additionInfoStructure.lng(StructureFields.AdditionInfo.movedFromOpDepth); | |
- } | |
- | |
- if (opRoot && movedFromRelPath != null) { | |
- File part = SVNFileUtil.skipAncestor(localRelPath, movedFromRelPath); | |
- MovedNode movedNode = new MovedNode(); | |
- if (part == null) { | |
- movedNode.localRelPath = movedFromRelPath; | |
- } else { | |
- movedNode.localRelPath = SVNFileUtil.createFilePath(movedToRelPath, part); | |
- } | |
- movedNode.opDepth = movedOpDepth; | |
- movedNode.movedToRelPath = movedToRelPath; | |
- movedNode.movedFromDepth = -1; | |
- movedNodes.add(movedNode); | |
- } else if (!opRoot && (status == SVNWCDbStatus.Normal || status == SVNWCDbStatus.Copied || status == SVNWCDbStatus.MovedHere)) { | |
- MovedNode movedNode = new MovedNode(); | |
- movedNode.localRelPath = localRelPath; | |
- movedNode.opDepth = deleteOpDepth; | |
- movedNode.movedToRelPath = movedToRelPath; | |
- movedNode.movedFromDepth = -1; | |
- movedNodes.add(movedNode); | |
- } | |
- | |
- stmt.reset(); | |
- stmt = root.getSDb().getStatement(SVNWCDbStatements.UPDATE_MOVED_TO_DESCENDANTS); | |
- stmt.bindf("iss", root.getWcId(), localRelPath, movedToRelPath); | |
+ } else { | |
+ stmt = root.getSDb().getStatement(SVNWCDbStatements.CLEAR_MOVED_TO_DESCENDANTS); | |
+ try { | |
+ stmt.bindf("is", root.getWcId(), localRelPath); | |
stmt.done(); | |
+ } finally { | |
+ stmt.reset(); | |
} | |
- stmt.reset(); | |
- stmt = root.getSDb().getStatement(SVNWCDbStatements.SELECT_MOVED_FOR_DELETE); | |
- stmt.bindf("isi", root.getWcId(), localRelPath, deleteOpDepth); | |
- haveRow = stmt.next(); | |
+ } | |
+ | |
+ stmt = root.getSDb().getStatement(SVNWCDbStatements.SELECT_MOVED_FOR_DELETE); | |
+ try { | |
+ stmt.bindf("is", root.getWcId(), localRelPath); | |
+ boolean haveRow = stmt.next(); | |
while (haveRow) { | |
File childRelPath = SVNFileUtil.createFilePath(stmt.getColumnString(NODES__Fields.local_relpath)); | |
File mvToRelPath = SVNFileUtil.createFilePath(stmt.getColumnString(NODES__Fields.moved_to)); | |
- int childOpDepth = (int) stmt.getColumnLong(NODES__Fields.op_depth); | |
- int movedFromDepth = -1; | |
+ long childOpDepth = stmt.getColumnLong(NODES__Fields.op_depth); | |
boolean fixUp = false; | |
if (movedToRelPath == null && SVNFileUtil.skipAncestor(localRelPath, mvToRelPath) == null) { | |
- int movedHereDepth = ((SVNWCDbSelectMovedForDelete) stmt).getMovedHereDepth(); | |
- if (movedHereDepth >= deleteOpDepth) { | |
- fixUp = true; | |
- movedFromDepth = movedHereDepth; | |
- } else { | |
- fixUp = true; | |
- childOpDepth = deleteOpDepth; | |
- } | |
- } else if (movedToRelPath != null) { | |
- if (deleteOpDepth == childOpDepth) { | |
- fixUp = true; | |
- } else if (childOpDepth >= deleteOpDepth && SVNFileUtil.skipAncestor(localRelPath, mvToRelPath) == null) { | |
- childRelPath = SVNFileUtil.skipAncestor(localRelPath, childRelPath); | |
- if (childRelPath != null) { | |
- childRelPath = SVNFileUtil.createFilePath(movedToRelPath, childRelPath); | |
- if (childOpDepth > deleteOpDepth && SVNFileUtil.skipAncestor(localRelPath, childRelPath) != null) { | |
- childOpDepth = deleteOpDepth; | |
- } else { | |
- childOpDepth = SVNWCUtils.relpathDepth(childRelPath); | |
- } | |
- fixUp = true; | |
+ fixUp = true; | |
+ childOpDepth = deleteDepth; | |
+ } else if (movedToRelPath != null && deleteDepth == childOpDepth) { | |
+ fixUp = true; | |
+ childOpDepth = deleteDepth; | |
+ } else if (movedToRelPath != null && childOpDepth >= deleteDepth && SVNFileUtil.skipAncestor(localRelPath, mvToRelPath) == null) { | |
+ childRelPath = SVNFileUtil.skipAncestor(localRelPath, childRelPath); | |
+ if (childRelPath != null) { | |
+ childRelPath = SVNFileUtil.createFilePath(movedToRelPath, childRelPath); | |
+ | |
+ if (childOpDepth > deleteDepth && SVNFileUtil.skipAncestor(localRelPath, childRelPath) != null) { | |
+ childOpDepth = deleteDepth; | |
+ } else { | |
+ childOpDepth = SVNWCUtils.relpathDepth(childRelPath); | |
} | |
+ | |
+ fixUp = true; | |
} | |
} | |
if (fixUp) { | |
- MovedNode mn = new MovedNode(); | |
- mn.localRelPath = childRelPath; | |
- mn.movedToRelPath = mvToRelPath; | |
- mn.opDepth = childOpDepth; | |
- mn.movedFromDepth = movedFromDepth; | |
+ MovedNode movedNode = new MovedNode(); | |
+ movedNode.localRelPath = childRelPath; | |
+ movedNode.movedToRelPath = mvToRelPath; | |
+ movedNode.opDepth = (int) childOpDepth; | |
if (movedNodes == null) { | |
movedNodes = new ArrayList<MovedNode>(); | |
} | |
- movedNodes.add(mn); | |
+ movedNodes.add(movedNode); | |
} | |
haveRow = stmt.next(); | |
} | |
+ } finally { | |
stmt.reset(); | |
+ } | |
- if (movedNodes != null) { | |
- for (Iterator<MovedNode> iterator = movedNodes.iterator(); iterator.hasNext(); ) { | |
- final MovedNode movedNode = iterator.next(); | |
- if (movedNode.movedFromDepth > 0) { | |
- ResolveMovedFrom resolveMovedFrom = resolveMovedFrom(root, localRelPath, movedNode.localRelPath, movedNode.movedFromDepth); | |
- movedNode.localRelPath = resolveMovedFrom.movedFromRelPath; | |
- movedNode.opDepth = resolveMovedFrom.movedFromOpDepth; | |
- if (movedNode.localRelPath == null) { | |
- iterator.remove(); | |
- } | |
- } | |
- } | |
- } | |
+ boolean addWork = false; | |
+ boolean refetchDepth = false; | |
+ long selectDepth; | |
- if (movedToRelPath == null) { | |
- stmt.reset(); | |
- stmt = root.getSDb().getStatement(SVNWCDbStatements.CLEAR_MOVED_TO_DESCENDANTS); | |
- stmt.bindf("is", root.getWcId(), localRelPath); | |
- stmt.done(); | |
- if (opRoot) { | |
- stmt.reset(); | |
- stmt = root.getSDb().getStatement(SVNWCDbStatements.CLEAR_MOVED_TO_FROM_DEST); | |
- stmt.bindf("is", root.getWcId(), localRelPath); | |
- stmt.done(); | |
- } | |
+ if (info.opRoot) { | |
+ WCDbInfo infoBelow = readInfoBelowWorking(root, localRelPath, -1); | |
+ if ((infoBelow.haveBase || infoBelow.haveWork) | |
+ && infoBelow.status != SVNWCDbStatus.NotPresent | |
+ && infoBelow.status != SVNWCDbStatus.Deleted) { | |
+ addWork = true; | |
+ refetchDepth = true; | |
+ } | |
+ selectDepth = SVNWCUtils.relpathDepth(localRelPath); | |
+ } else { | |
+ addWork = true; | |
+ if (status != SVNWCDbStatus.Normal) { | |
+ selectDepth = readOpDepth(root, localRelPath); | |
+ } else { | |
+ selectDepth = 0; | |
} | |
+ } | |
+ // collect files to delete. | |
+ stmt = new SVNWCDbCreateSchema(root.getSDb().getTemporaryDb(), SVNWCDbCreateSchema.DELETE_LIST, -1); | |
+ try { | |
+ stmt.done(); | |
+ } finally { | |
+ stmt.reset(); | |
+ } | |
- stmt = new SVNWCDbCreateSchema(root.getSDb().getTemporaryDb(), SVNWCDbCreateSchema.DELETE_LIST, -1); | |
+ if (eventHandler != null) { | |
+ stmt = new SVNWCDbInsertDeleteList(root.getSDb()); | |
try { | |
+ stmt.bindf("isi", root.getWcId(), localRelPath, selectDepth); | |
stmt.done(); | |
} finally { | |
stmt.reset(); | |
} | |
+ } | |
+ SVNSqlJetStatement deleteStmt = root.getSDb().getStatement(SVNWCDbStatements.DELETE_NODES_ABOVE_DEPTH_RECURSIVE); | |
+ try { | |
+ deleteStmt.bindf("isi", root.getWcId(), localRelPath, deleteDepth); | |
+ deleteStmt.done(); | |
+ } finally { | |
+ deleteStmt.reset(); | |
+ } | |
- if (eventHandler != null) { | |
- stmt.reset(); | |
- stmt = root.getSDb().getStatement(SVNWCDbStatements.INSERT_DELETE_LIST); | |
- stmt.bindf("isi", root.getWcId(), localRelPath, workingOpDepth); | |
- stmt.done(); | |
- } | |
- | |
- stmt.reset(); | |
- stmt = root.getSDb().getStatement(SVNWCDbStatements.DELETE_NODES_ABOVE_DEPTH_RECURSIVE); | |
- stmt.bindf("isi", root.getWcId(), localRelPath, deleteOpDepth); | |
- stmt.done(); | |
- | |
- stmt.reset(); | |
- stmt = root.getSDb().getStatement(SVNWCDbStatements.DELETE_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE); | |
- stmt.bindf("is", root.getWcId(), localRelPath); | |
- stmt.done(); | |
+ if (refetchDepth) { | |
+ selectDepth = readOpDepth(root, localRelPath); | |
+ } | |
+ deleteStmt = root.getSDb().getStatement(SVNWCDbStatements.DELETE_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE); | |
+ try { | |
+ deleteStmt.bindf("is", root.getWcId(), localRelPath); | |
+ deleteStmt.done(); | |
+ } finally { | |
+ deleteStmt.reset(); | |
+ } | |
- stmt.reset(); | |
- stmt = root.getSDb().getStatement(SVNWCDbStatements.CLEAR_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE); | |
- stmt.bindf("is", root.getWcId(), localRelPath); | |
- stmt.done(); | |
+ deleteStmt = root.getSDb().getStatement(SVNWCDbStatements.CLEAR_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE); | |
+ try { | |
+ deleteStmt.bindf("is", root.getWcId(), localRelPath); | |
+ deleteStmt.done(); | |
+ } finally { | |
+ deleteStmt.reset(); | |
+ } | |
- stmt.reset(); | |
- stmt = root.getSDb().getStatement(SVNWCDbStatements.DELETE_WC_LOCK_ORPHAN_RECURSIVE); | |
- stmt.bindf("is", root.getWcId(), localRelPath); | |
- stmt.done(); | |
+ deleteStmt = root.getSDb().getStatement(SVNWCDbStatements.DELETE_WC_LOCK_ORPHAN_RECURSIVE); | |
+ try { | |
+ deleteStmt.bindf("is", root.getWcId(), localRelPath); | |
+ deleteStmt.done(); | |
+ } finally { | |
+ deleteStmt.reset(); | |
+ } | |
- if (addWork) { | |
- stmt.reset(); | |
- stmt = root.getSDb().getStatement(SVNWCDbStatements.INSERT_DELETE_FROM_NODE_RECURSIVE); | |
- stmt.bindf("isii", root.getWcId(), localRelPath, keepOpDepth, deleteOpDepth); | |
- stmt.done(); | |
+ if (addWork) { | |
+ SVNSqlJetStatement insertStmt = root.getSDb().getStatement(SVNWCDbStatements.INSERT_DELETE_FROM_NODE_RECURSIVE); | |
+ try { | |
+ insertStmt.bindf("isii", root.getWcId(), localRelPath, selectDepth, deleteDepth); | |
+ insertStmt.done(); | |
+ } finally { | |
+ insertStmt.reset(); | |
} | |
+ } | |
- if (movedNodes != null) { | |
- for (MovedNode movedNode : movedNodes) { | |
- deleteUpdateMovedTo(root, movedNode.localRelPath, movedNode.opDepth, movedNode.movedToRelPath); | |
- } | |
+ if (movedNodes != null) { | |
+ for (MovedNode movedNode : movedNodes) { | |
+ deleteUpdateMovedTo(root, movedNode.localRelPath, movedNode.opDepth, movedNode.movedToRelPath); | |
} | |
+ } | |
- stmt.reset(); | |
- stmt = root.getSDb().getStatement(SVNWCDbStatements.DELETE_FILE_EXTERNALS); | |
+ stmt = root.getSDb().getStatement(SVNWCDbStatements.DELETE_FILE_EXTERNALS); | |
+ try { | |
stmt.bindf("is", root.getWcId(), localRelPath); | |
stmt.done(); | |
- | |
+ } finally { | |
stmt.reset(); | |
- stmt = root.getSDb().getStatement(deleteDirExternals ? SVNWCDbStatements.DELETE_EXTERNAL_REGISTRATIONS : SVNWCDbStatements.DELETE_FILE_EXTERNAL_REGISTRATIONS); | |
+ } | |
+ | |
+ stmt = root.getSDb().getStatement(deleteDirExternals ? SVNWCDbStatements.DELETE_EXTERNAL_REGISTRATIONS : SVNWCDbStatements.DELETE_FILE_EXTERNAL_REGISTRATIONS); | |
+ try { | |
stmt.bindf("is", root.getWcId(), localRelPath); | |
stmt.done(); | |
- | |
- addWorkItems(root.getSDb(), workItems); | |
- if (conflict != null) { | |
- markConflictInternal(root, localRelPath, conflict); | |
- } | |
} finally { | |
stmt.reset(); | |
} | |
+ | |
+ addWorkItems(root.getSDb(), workItems); | |
+ if (conflict != null) { | |
+ markConflictInternal(root, localRelPath, conflict); | |
+ } | |
} | |
} | |
@@ -761,52 +751,10 @@ | |
} | |
} | |
- private ResolveMovedFrom resolveMovedFrom(SVNWCDbRoot root, File rootRelPath, File localRelPath, int opDepth) throws SVNException { | |
- ResolveMovedFrom resolveMovedFrom = new ResolveMovedFrom(); | |
- String suffix = ""; | |
- while (SVNWCUtils.relpathDepth(localRelPath) > opDepth) { | |
- suffix = SVNPathUtil.append(suffix, SVNFileUtil.getFileName(localRelPath)); | |
- } | |
- File fromRelPath; | |
- int moveFromDepth; | |
- SVNSqlJetStatement stmt = root.getSDb().getStatement(SVNWCDbStatements.SELECT_MOVED_FROM_FOR_DELETE); | |
- try { | |
- stmt.bindf("is", root.getWcId(), localRelPath); | |
- boolean haveRow = stmt.next(); | |
- if (!haveRow) { | |
- return resolveMovedFrom; | |
- } | |
- fromRelPath = SVNFileUtil.createFilePath(stmt.getColumnString(NODES__Fields.local_relpath)); | |
- int fromOpDepth = (int) stmt.getColumnLong(NODES__Fields.op_depth); | |
- moveFromDepth = (int) ((SVNWCDbSelectMovedFromForDelete)stmt).getMovedHereOpDepth(); | |
- | |
- if (SVNFileUtil.skipAncestor(rootRelPath, fromRelPath) == null) { | |
- resolveMovedFrom.movedFromRelPath = SVNFileUtil.createFilePath(fromRelPath, suffix); | |
- resolveMovedFrom.movedFromOpDepth = fromOpDepth; | |
- return resolveMovedFrom; | |
- } else if (moveFromDepth == 0) { | |
- return resolveMovedFrom; | |
- } | |
- } finally { | |
- stmt.reset(); | |
- } | |
- return resolveMovedFrom(root, rootRelPath, SVNFileUtil.createFilePath(fromRelPath, suffix), moveFromDepth); | |
- } | |
- | |
- private static class ResolveMovedFrom { | |
- File movedFromRelPath; | |
- int movedFromOpDepth; | |
- | |
- private ResolveMovedFrom() { | |
- movedFromOpDepth = -1; | |
- } | |
- } | |
- | |
private static class MovedNode { | |
public File localRelPath; | |
public File movedToRelPath; | |
- public int opDepth; | |
- public int movedFromDepth; | |
+ int opDepth; | |
} | |
private class InsertLock implements SVNSqlJetTransaction { | |
@@ -2647,8 +2595,8 @@ | |
} else { | |
stmt = wcRoot.getSDb().getStatement(SVNWCDbStatements.INSERT_ACTUAL_CONFLICT_DATA_17); | |
stmt.bindf("is", wcRoot.getWcId(), localRelPath); | |
- if (SVNFileUtil.getFilePath(localRelPath).length() > 0) { | |
- stmt.bindString(8, SVNPathUtil.removeTail(SVNFileUtil.getFilePath(localRelPath))); | |
+ if (localRelPath.getPath().length() > 0) { | |
+ stmt.bindString(8, SVNPathUtil.removeTail(localRelPath.getPath())); | |
} | |
} | |
stmt.bindString(3, SVNFileUtil.getFilePath(conflictOldRelPath)); | |
@@ -6308,8 +6256,8 @@ | |
pdh.flushEntries(localAbspath); | |
} | |
- public void upgradeBegin(File localAbspath, SVNWCDbUpgradeData upgradeData, SVNURL repositoryRootUrl, String repositoryUUID, int targetWorkingCopyFormat) throws SVNException { | |
- CreateDbInfo dbInfo = createDb(localAbspath, repositoryRootUrl, repositoryUUID, SDB_FILE, targetWorkingCopyFormat); | |
+ public void upgradeBegin(File localAbspath, SVNWCDbUpgradeData upgradeData, SVNURL repositoryRootUrl, String repositoryUUID) throws SVNException { | |
+ CreateDbInfo dbInfo = createDb(localAbspath, repositoryRootUrl, repositoryUUID, SDB_FILE, ISVNWCDb.WC_FORMAT_18); | |
upgradeData.repositoryId = dbInfo.reposId; | |
upgradeData.workingCopyId = dbInfo.wcId; | |
@@ -7479,17 +7427,14 @@ | |
if (haveRow && ( | |
!stmt.isColumnNull(ACTUAL_NODE__Fields.conflict_old) || | |
!stmt.isColumnNull(ACTUAL_NODE__Fields.conflict_new) || | |
- !stmt.isColumnNull(ACTUAL_NODE__Fields.conflict_working)) || | |
- !stmt.isColumnNull(ACTUAL_NODE__Fields.prop_reject)) { | |
+ !stmt.isColumnNull(ACTUAL_NODE__Fields.conflict_working))) { | |
String conflictOldRelPath = stmt.getColumnString(ACTUAL_NODE__Fields.conflict_old); | |
String conflictNewRelPath = stmt.getColumnString(ACTUAL_NODE__Fields.conflict_new); | |
String conflictWorkingRelPath = stmt.getColumnString(ACTUAL_NODE__Fields.conflict_working); | |
- String prejRelPath = stmt.getColumnString(ACTUAL_NODE__Fields.prop_reject); | |
File conflictOldAbsPath = conflictOldRelPath == null ? null : SVNFileUtil.createFilePath(wcRoot.getAbsPath(), conflictOldRelPath); | |
File conflictNewAbsPath = conflictNewRelPath == null ? null : SVNFileUtil.createFilePath(wcRoot.getAbsPath(), conflictNewRelPath); | |
File conflictWorkingAbsPath = conflictWorkingRelPath == null ? null : SVNFileUtil.createFilePath(wcRoot.getAbsPath(), conflictWorkingRelPath); | |
- File prejAbsPath = prejRelPath == null ? null : SVNFileUtil.createFilePath(wcRoot.getAbsPath(), prejRelPath); | |
if (conflictOldAbsPath != null) { | |
markerFiles.add(conflictOldAbsPath); | |
@@ -7500,9 +7445,6 @@ | |
if (conflictWorkingAbsPath != null) { | |
markerFiles.add(conflictWorkingAbsPath); | |
} | |
- if (prejAbsPath != null) { | |
- markerFiles.add(prejAbsPath); | |
- } | |
} | |
} finally { | |
stmt.reset(); | |
@@ -7517,24 +7459,15 @@ | |
String conflictOldRelPath = stmt.getColumnString(ACTUAL_NODE__Fields.conflict_old); | |
String conflictNewRelPath = stmt.getColumnString(ACTUAL_NODE__Fields.conflict_new); | |
String conflictWorkingRelPath = stmt.getColumnString(ACTUAL_NODE__Fields.conflict_working); | |
- String prejRelPath = stmt.getColumnString(ACTUAL_NODE__Fields.prop_reject); | |
- File conflictOldAbsPath = conflictOldRelPath == null ? null : SVNFileUtil.createFilePath(wcRoot.getAbsPath(), conflictOldRelPath); | |
- File conflictNewAbsPath = conflictNewRelPath == null ? null : SVNFileUtil.createFilePath(wcRoot.getAbsPath(), conflictNewRelPath); | |
- File conflictWorkingAbsPath = conflictWorkingRelPath == null ? null : SVNFileUtil.createFilePath(wcRoot.getAbsPath(), conflictWorkingRelPath); | |
- File prejAbsPath = prejRelPath == null ? null : SVNFileUtil.createFilePath(wcRoot.getAbsPath(), prejRelPath); | |
- | |
- if (conflictOldAbsPath != null) { | |
- markerFiles.add(conflictOldAbsPath); | |
+ if (conflictOldRelPath != null) { | |
+ markerFiles.add(SVNFileUtil.createFilePath(wcRoot.getAbsPath(), conflictOldRelPath)); | |
} | |
- if (conflictNewAbsPath != null) { | |
- markerFiles.add(conflictNewAbsPath); | |
- } | |
- if (conflictWorkingAbsPath != null) { | |
- markerFiles.add(conflictWorkingAbsPath); | |
+ if (conflictNewRelPath != null) { | |
+ markerFiles.add(SVNFileUtil.createFilePath(wcRoot.getAbsPath(), conflictNewRelPath)); | |
} | |
- if (prejAbsPath != null) { | |
- markerFiles.add(prejAbsPath); | |
+ if (conflictWorkingRelPath != null) { | |
+ markerFiles.add(SVNFileUtil.createFilePath(wcRoot.getAbsPath(), conflictWorkingRelPath)); | |
} | |
haveRow = stmt.next(); | |
} | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/SvnWcDbConflicts.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/SvnWcDbConflicts.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/SvnWcDbConflicts.java 2014-07-01 03:14:20.790130660 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/SvnWcDbConflicts.java 2014-07-01 03:13:45.887132718 +0000 | |
@@ -26,36 +26,6 @@ | |
private static final String CONFLICT_OP_SWITCH = "switch"; | |
private static final String CONFLICT_OP_MERGE = "merge"; | |
- public static SVNSkel convertToConflictSkel(String conflictOld, String conflictWorking, String conflictNew, String propReject, byte[] treeConflictData) throws SVNException { | |
- SVNSkel conflictData = null; | |
- if (conflictOld != null || conflictNew != null || conflictWorking != null) { | |
- conflictData = createConflictSkel(); | |
- | |
- addTextConflict(conflictData, conflictWorking, conflictOld, conflictNew); | |
- } | |
- if (propReject != null) { | |
- if (conflictData == null) { | |
- conflictData = createConflictSkel(); | |
- } | |
- addPropConflict(conflictData, propReject); | |
- } | |
- if (treeConflictData != null) { | |
- if (conflictData == null) { | |
- conflictData = createConflictSkel(); | |
- } | |
- final SVNSkel tcSkel = SVNSkel.parse(treeConflictData); | |
- final File fakePath = SVNFileUtil.createFilePath(""); | |
- final SVNTreeConflictDescription tcDesc = SVNTreeConflictUtil.readSingleTreeConflict(tcSkel, fakePath); | |
- addTreeConflict(conflictData, tcDesc.getConflictReason(), tcDesc.getConflictAction()); | |
- if (tcDesc.getOperation() != null && tcDesc.getOperation() != SVNOperation.NONE) { | |
- setConflictOperation(conflictData, tcDesc.getOperation(), tcDesc.getSourceLeftVersion(), tcDesc.getSourceRightVersion()); | |
- } | |
- } else if (conflictData != null) { | |
- setConflictOperation(conflictData, SVNOperation.UPDATE, null, null); | |
- } | |
- return conflictData; | |
- } | |
- | |
public static SVNSkel convertToConflictSkel(File wcRootAbsPath, SVNWCDb db, String localRelpath, String conflictOld, String conflictWorking, String conflictNew, String propReject, byte[] treeConflictData) throws SVNException { | |
SVNSkel conflictData = null; | |
if (conflictOld != null || conflictNew != null || conflictWorking != null) { | |
@@ -970,57 +940,4 @@ | |
return conflictData; | |
} | |
- | |
- private static void addTextConflict(SVNSkel skel, String mineRelPath, String theirOldRelPath, String theirRelPath) throws SVNException { | |
- final SVNSkel textConflict = SVNSkel.createEmptyList(); | |
- final SVNSkel markers = SVNSkel.createEmptyList(); | |
- | |
- if (theirRelPath != null) { | |
- markers.prepend(SVNSkel.createAtom(theirRelPath)); | |
- } else { | |
- markers.prepend(SVNSkel.createEmptyList()); | |
- } | |
- if (mineRelPath != null) { | |
- markers.prepend(SVNSkel.createAtom(mineRelPath)); | |
- } else { | |
- markers.prepend(SVNSkel.createEmptyList()); | |
- } | |
- if (theirOldRelPath != null) { | |
- markers.prepend(SVNSkel.createAtom(theirOldRelPath)); | |
- } else { | |
- markers.prepend(SVNSkel.createEmptyList()); | |
- } | |
- textConflict.prepend(markers); | |
- textConflict.prepend(SVNSkel.createAtom(ConflictKind.text.toString())); | |
- | |
- skel.first().next().prepend(textConflict); | |
- } | |
- | |
- private static void addPropConflict(SVNSkel skel, String propReject) throws SVNException { | |
- final SVNSkel propConflict = SVNSkel.createEmptyList(); | |
- | |
- final SVNSkel conflictNames = SVNSkel.createEmptyList(); | |
- propConflict.prepend(conflictNames); | |
- final SVNSkel markers = SVNSkel.createEmptyList(); | |
- if (propReject != null) { | |
- markers.prepend(SVNSkel.createAtom(propReject)); | |
- } | |
- propConflict.prepend(markers); | |
- propConflict.prepend(SVNSkel.createAtom(ConflictKind.prop.toString())); | |
- | |
- skel.first().next().prepend(propConflict); | |
- } | |
- | |
- private static void addTreeConflict(SVNSkel skel, SVNConflictReason localChange, SVNConflictAction incomingChange) throws SVNException { | |
- final SVNSkel treeConflict = SVNSkel.createEmptyList(); | |
- | |
- treeConflict.prepend(SVNSkel.createAtom(incomingChange.getName())); | |
- treeConflict.prepend(SVNSkel.createAtom(localChange.getName())); | |
- | |
- final SVNSkel markers = SVNSkel.createEmptyList(); | |
- treeConflict.prepend(markers); | |
- treeConflict.prepend(SVNSkel.createAtom(ConflictKind.tree.toString())); | |
- | |
- skel.first().next().prepend(treeConflict); | |
- } | |
} | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/SvnWcDbCopy.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/SvnWcDbCopy.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/SvnWcDbCopy.java 2014-07-01 03:14:20.777130688 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/SvnWcDbCopy.java 2014-07-01 03:13:45.887132718 +0000 | |
@@ -401,7 +401,7 @@ | |
if (srcPdh.getWCRoot() == dstPdh.getWCRoot()) { | |
File dstParentRelpath = SVNFileUtil.getFileDir(localDstRelpath); | |
- SVNSqlJetStatement stmt = srcPdh.getWCRoot().getSDb().getStatement(SVNWCDbStatements.INSERT_WORKING_NODE_COPY_FROM); | |
+ SVNSqlJetStatement stmt = new InsertWorkingNodeCopy(srcPdh.getWCRoot().getSDb(), false); | |
try { | |
stmt.bindf("issist", srcPdh.getWCRoot().getWcId(), localSrcRelpath, localDstRelpath, dstOpDepths[0], dstParentRelpath, | |
SvnWcDbStatementUtil.getPresenceText(dstPresence)); | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/SvnWcDbRevert.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/SvnWcDbRevert.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/SvnWcDbRevert.java 2014-07-01 03:14:21.086130896 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/SvnWcDbRevert.java 2014-07-01 03:13:45.889132380 +0000 | |
@@ -22,7 +22,6 @@ | |
import org.tmatesoft.svn.core.internal.wc17.db.statement.SVNWCDbSchema.NODES__Fields; | |
import org.tmatesoft.svn.core.internal.wc17.db.statement.SVNWCDbSchema.REVERT_LIST__Fields; | |
import org.tmatesoft.svn.core.internal.wc17.db.statement.SVNWCDbStatements; | |
-import org.tmatesoft.svn.core.internal.wc17.db.statement17.SvnRevertActualNodesTrigger17; | |
import org.tmatesoft.svn.core.wc.*; | |
import org.tmatesoft.svn.util.SVNLogType; | |
@@ -43,9 +42,7 @@ | |
SVNSqlJetDb sdb = root.getSDb(); | |
SvnRevertNodesTrigger nodesTableTrigger = new SvnRevertNodesTrigger(sdb); | |
- ISVNSqlJetTrigger actualNodesTableTrigger = root.getFormat() == ISVNWCDb.WC_FORMAT_17 ? | |
- new SvnRevertActualNodesTrigger17(sdb) : | |
- new SvnRevertActualNodesTrigger(sdb); | |
+ SvnRevertActualNodesTrigger actualNodesTableTrigger = new SvnRevertActualNodesTrigger(sdb); | |
SVNSqlJetStatement stmt = sdb.getStatement(SVNWCDbStatements.SELECT_NODE_INFO); | |
long opDepth; | |
@@ -223,10 +220,7 @@ | |
SVNSqlJetDb sdb = root.getSDb(); | |
SvnRevertNodesTrigger nodesTableTrigger = new SvnRevertNodesTrigger(sdb); | |
- ISVNSqlJetTrigger actualNodesTableTrigger = root.getFormat() == ISVNWCDb.WC_FORMAT_17 ? | |
- new SvnRevertActualNodesTrigger17(sdb) : | |
- new SvnRevertActualNodesTrigger(sdb); | |
- | |
+ SvnRevertActualNodesTrigger actualNodesTableTrigger = new SvnRevertActualNodesTrigger(sdb); | |
SVNSqlJetStatement stmt = sdb.getStatement(SVNWCDbStatements.SELECT_NODE_INFO); | |
long opDepth; | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/statement/SVNWCDbClearMovedToFromDest.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/statement/SVNWCDbClearMovedToFromDest.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/statement/SVNWCDbClearMovedToFromDest.java 2014-07-01 03:14:20.942130960 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/statement/SVNWCDbClearMovedToFromDest.java 1970-01-01 00:00:00.000000000 +0000 | |
@@ -1,43 +0,0 @@ | |
-package org.tmatesoft.svn.core.internal.wc17.db.statement; | |
- | |
-import org.tmatesoft.svn.core.SVNException; | |
-import org.tmatesoft.svn.core.internal.db.SVNSqlJetDb; | |
-import org.tmatesoft.svn.core.internal.db.SVNSqlJetUpdateStatement; | |
- | |
-import java.util.HashMap; | |
-import java.util.Map; | |
- | |
-/** | |
- * UPDATE NODES SET moved_to = NULL | |
- * WHERE wc_id = ?1 | |
- * AND moved_to = ?2 | |
- * | |
- * | |
- * | |
- * | |
- * | |
- * | |
- */ | |
-public class SVNWCDbClearMovedToFromDest extends SVNSqlJetUpdateStatement { | |
- | |
- public SVNWCDbClearMovedToFromDest(SVNSqlJetDb sDb) throws SVNException { | |
- super(sDb, SVNWCDbSchema.NODES); | |
- } | |
- | |
- @Override | |
- public Map<String, Object> getUpdateValues() throws SVNException { | |
- Map<String, Object> values = new HashMap<String, Object>(); | |
- values.put(SVNWCDbSchema.NODES__Fields.moved_to.name(), null); | |
- return values; | |
- } | |
- | |
- @Override | |
- protected boolean isFilterPassed() throws SVNException { | |
- return getBind(2).equals(getColumnString(SVNWCDbSchema.NODES__Fields.moved_to)); | |
- } | |
- | |
- @Override | |
- protected Object[] getWhere() throws SVNException { | |
- return new Object[] {getBind(1)}; | |
- } | |
-} | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/statement/SVNWCDbInsertWorkingNodeCopyFrom.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/statement/SVNWCDbInsertWorkingNodeCopyFrom.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/statement/SVNWCDbInsertWorkingNodeCopyFrom.java 2014-07-01 03:14:20.944130828 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/statement/SVNWCDbInsertWorkingNodeCopyFrom.java 1970-01-01 00:00:00.000000000 +0000 | |
@@ -1,153 +0,0 @@ | |
-package org.tmatesoft.svn.core.internal.wc17.db.statement; | |
- | |
-import org.tmatesoft.sqljet.core.schema.SqlJetConflictAction; | |
-import org.tmatesoft.svn.core.SVNException; | |
-import org.tmatesoft.svn.core.internal.db.SVNSqlJetDb; | |
-import org.tmatesoft.svn.core.internal.db.SVNSqlJetInsertStatement; | |
-import org.tmatesoft.svn.core.internal.db.SVNSqlJetSelectFieldsStatement; | |
-import org.tmatesoft.svn.core.internal.db.SVNSqlJetSelectStatement; | |
- | |
-import java.util.HashMap; | |
-import java.util.Map; | |
- | |
-/* | |
-* INSERT OR REPLACE INTO nodes ( | |
-* wc_id, local_relpath, op_depth, parent_relpath, repos_id, | |
-* repos_path, revision, presence, depth, moved_here, kind, changed_revision, | |
-* changed_date, changed_author, checksum, properties, translated_size, | |
-* last_mod_time, symlink_target, moved_to ) | |
-* SELECT wc_id, ?3 /local_relpath/, ?4 /op_depth/, ?5 /parent_relpath/, | |
-* repos_id, repos_path, revision, ?6 /presence/, depth, | |
-* ?7/moved_here/, kind, changed_revision, changed_date, | |
-* changed_author, checksum, properties, translated_size, | |
-* last_mod_time, symlink_target, | |
-* (SELECT dst.moved_to FROM nodes AS dst | |
-* WHERE dst.wc_id = ?1 | |
-* AND dst.local_relpath = ?3 | |
-* AND dst.op_depth = ?4) | |
-* FROM nodes_current | |
-* WHERE wc_id = ?1 AND local_relpath = ?2 | |
-*/ | |
- | |
-public class SVNWCDbInsertWorkingNodeCopyFrom extends SVNSqlJetInsertStatement { | |
- | |
- private SVNSqlJetSelectStatement internalStatement1; | |
- private SVNSqlJetSelectStatement internalStatement2; | |
- | |
- public SVNWCDbInsertWorkingNodeCopyFrom(SVNSqlJetDb sDb) throws SVNException { | |
- super(sDb, SVNWCDbSchema.NODES, SqlJetConflictAction.REPLACE); | |
- } | |
- | |
- protected Map<String, Object> getInsertValues() throws SVNException { | |
- if (internalStatement1 == null) { | |
- internalStatement1 = new InternalStatement1(sDb); | |
- internalStatement1.bindf("is", getBind(1), getBind(2)); | |
- internalStatement1.next(); | |
- } | |
- if (internalStatement2 == null) { | |
- internalStatement2 = new InternalStatement2(sDb); | |
- internalStatement2.bindf("isi", getBind(1), getBind(3), getBind(4)); | |
- internalStatement2.next(); | |
- } | |
- Map<String, Object> values = new HashMap<String, Object>(); | |
- values.put(SVNWCDbSchema.NODES__Fields.wc_id.name(), internalStatement1.getColumnLong(SVNWCDbSchema.NODES__Fields.wc_id)); | |
- values.put(SVNWCDbSchema.NODES__Fields.local_relpath.name(), getBind(3)); | |
- values.put(SVNWCDbSchema.NODES__Fields.op_depth.name(), getBind(4)); | |
- values.put(SVNWCDbSchema.NODES__Fields.parent_relpath.name(), getBind(5)); | |
- values.put(SVNWCDbSchema.NODES__Fields.repos_id.name(), internalStatement1.getColumnString(SVNWCDbSchema.NODES__Fields.repos_id)); | |
- values.put(SVNWCDbSchema.NODES__Fields.repos_path.name(), internalStatement1.getColumnString(SVNWCDbSchema.NODES__Fields.repos_path)); | |
- values.put(SVNWCDbSchema.NODES__Fields.revision.name(), internalStatement1.getColumnString(SVNWCDbSchema.NODES__Fields.revision)); | |
- values.put(SVNWCDbSchema.NODES__Fields.presence.name(), getBind(6)); | |
- values.put(SVNWCDbSchema.NODES__Fields.depth.name(), internalStatement1.getColumnString(SVNWCDbSchema.NODES__Fields.depth)); | |
- values.put(SVNWCDbSchema.NODES__Fields.moved_here.name(), getBind(7)); | |
- values.put(SVNWCDbSchema.NODES__Fields.kind.name(), internalStatement1.getColumnString(SVNWCDbSchema.NODES__Fields.kind)); | |
- values.put(SVNWCDbSchema.NODES__Fields.changed_revision.name(), internalStatement1.getColumnString(SVNWCDbSchema.NODES__Fields.changed_revision)); | |
- values.put(SVNWCDbSchema.NODES__Fields.changed_date.name(), internalStatement1.getColumnString(SVNWCDbSchema.NODES__Fields.changed_date)); | |
- values.put(SVNWCDbSchema.NODES__Fields.changed_author.name(), internalStatement1.getColumnString(SVNWCDbSchema.NODES__Fields.changed_author)); | |
- values.put(SVNWCDbSchema.NODES__Fields.checksum.name(), internalStatement1.getColumnString(SVNWCDbSchema.NODES__Fields.checksum)); | |
- values.put(SVNWCDbSchema.NODES__Fields.properties.name(), internalStatement1.getColumnBlob(SVNWCDbSchema.NODES__Fields.properties)); | |
- values.put(SVNWCDbSchema.NODES__Fields.translated_size.name(), internalStatement1.getColumnString(SVNWCDbSchema.NODES__Fields.translated_size)); | |
- values.put(SVNWCDbSchema.NODES__Fields.last_mod_time.name(), internalStatement1.getColumnString(SVNWCDbSchema.NODES__Fields.last_mod_time)); | |
- values.put(SVNWCDbSchema.NODES__Fields.symlink_target.name(), internalStatement1.getColumnString(SVNWCDbSchema.NODES__Fields.symlink_target)); | |
- values.put(SVNWCDbSchema.NODES__Fields.moved_to.name(), internalStatement2.getColumnString(SVNWCDbSchema.NODES__Fields.moved_to)); | |
- return values; | |
- } | |
- | |
- public void reset() throws SVNException { | |
- super.reset(); | |
- if (internalStatement1 != null) { | |
- internalStatement1.reset(); | |
- internalStatement1 = null; | |
- } | |
- if (internalStatement2 != null) { | |
- internalStatement2.reset(); | |
- internalStatement2 = null; | |
- } | |
- } | |
- | |
- private static class InternalStatement1 extends SVNSqlJetSelectFieldsStatement<SVNWCDbSchema.NODES__Fields> { | |
- | |
- private long maxOpDepth; | |
- | |
- public InternalStatement1(SVNSqlJetDb sDb) throws SVNException { | |
- super(sDb, SVNWCDbSchema.NODES); | |
- maxOpDepth = -1; | |
- } | |
- | |
- @Override | |
- protected void defineFields() { | |
- fields.add(SVNWCDbSchema.NODES__Fields.wc_id); | |
- fields.add(SVNWCDbSchema.NODES__Fields.local_relpath); | |
- fields.add(SVNWCDbSchema.NODES__Fields.op_depth); | |
- fields.add(SVNWCDbSchema.NODES__Fields.parent_relpath); | |
- fields.add(SVNWCDbSchema.NODES__Fields.repos_path); | |
- fields.add(SVNWCDbSchema.NODES__Fields.revision); | |
- fields.add(SVNWCDbSchema.NODES__Fields.presence); | |
- fields.add(SVNWCDbSchema.NODES__Fields.depth); | |
- fields.add(SVNWCDbSchema.NODES__Fields.moved_here); | |
- fields.add(SVNWCDbSchema.NODES__Fields.kind); | |
- fields.add(SVNWCDbSchema.NODES__Fields.changed_revision); | |
- fields.add(SVNWCDbSchema.NODES__Fields.changed_date); | |
- fields.add(SVNWCDbSchema.NODES__Fields.changed_author); | |
- fields.add(SVNWCDbSchema.NODES__Fields.checksum); | |
- fields.add(SVNWCDbSchema.NODES__Fields.properties); | |
- fields.add(SVNWCDbSchema.NODES__Fields.translated_size); | |
- fields.add(SVNWCDbSchema.NODES__Fields.last_mod_time); | |
- fields.add(SVNWCDbSchema.NODES__Fields.symlink_target); | |
- } | |
- | |
- private long getMaxOpDepth() throws SVNException { | |
- if (maxOpDepth == -1) { | |
- SVNWCDbNodesMaxOpDepth maxOpDepth = new SVNWCDbNodesMaxOpDepth(sDb, 0); | |
- try { | |
- this.maxOpDepth = maxOpDepth.getMaxOpDepth((Long) getBind(1), (String) getBind(2)); | |
- } finally { | |
- maxOpDepth.reset(); | |
- } | |
- } | |
- return maxOpDepth; | |
- } | |
- | |
- @Override | |
- protected boolean isFilterPassed() throws SVNException { | |
- return getColumnLong(SVNWCDbSchema.NODES__Fields.op_depth) >= getMaxOpDepth(); | |
- } | |
- | |
- @Override | |
- protected Object[] getWhere() throws SVNException { | |
- return new Object[] {getBind(1), getBind(2)}; | |
- } | |
- } | |
- | |
- private static class InternalStatement2 extends SVNSqlJetSelectFieldsStatement<SVNWCDbSchema.NODES__Fields> { | |
- | |
- public InternalStatement2(SVNSqlJetDb sDb) throws SVNException { | |
- super(sDb, SVNWCDbSchema.NODES); | |
- } | |
- | |
- @Override | |
- protected void defineFields() { | |
- fields.add(SVNWCDbSchema.NODES__Fields.moved_to); | |
- } | |
- } | |
-} | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/statement/SVNWCDbSelectMovedForDelete.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/statement/SVNWCDbSelectMovedForDelete.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/statement/SVNWCDbSelectMovedForDelete.java 2014-07-01 03:14:20.898130474 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/statement/SVNWCDbSelectMovedForDelete.java 2014-07-01 03:13:45.902132757 +0000 | |
@@ -1,36 +1,27 @@ | |
package org.tmatesoft.svn.core.internal.wc17.db.statement; | |
-import org.tmatesoft.sqljet.core.SqlJetException; | |
-import org.tmatesoft.sqljet.core.table.ISqlJetCursor; | |
-import org.tmatesoft.svn.core.SVNErrorCode; | |
-import org.tmatesoft.svn.core.SVNErrorMessage; | |
import org.tmatesoft.svn.core.SVNException; | |
import org.tmatesoft.svn.core.internal.db.SVNSqlJetDb; | |
import org.tmatesoft.svn.core.internal.db.SVNSqlJetSelectFieldsStatement; | |
-import org.tmatesoft.svn.core.internal.wc.SVNErrorManager; | |
-import org.tmatesoft.svn.util.SVNLogType; | |
/** | |
- * SELECT local_relpath, moved_to, op_depth, | |
- * (SELECT CASE WHEN r.moved_here THEN r.op_depth END FROM nodes r | |
- * WHERE r.wc_id = ?1 | |
- * AND r.local_relpath = n.local_relpath | |
- * AND r.op_depth < n.op_depth | |
- * BY r.op_depth DESC LIMIT 1) AS moved_here_op_depth | |
- * FROM nodes n | |
+ * SELECT local_relpath, moved_to, op_depth FROM nodes | |
* WHERE wc_id = ?1 | |
- * AND (local_relpath = ?2 OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2)) | |
- * AND moved_to IS NOT NULL | |
- * AND op_depth >= ?3 | |
+ * AND (local_relpath = ?2 OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2)) | |
+ * AND moved_to IS NOT NULL | |
+ * AND op_depth >= (SELECT MAX(op_depth) FROM nodes o | |
+ * WHERE o.wc_id = ?1 | |
+ * AND o.local_relpath = ?2) | |
* | |
* @version 1.8 | |
*/ | |
public class SVNWCDbSelectMovedForDelete extends SVNSqlJetSelectFieldsStatement<SVNWCDbSchema.NODES__Fields> { | |
- private InternalStatement internalStatement; | |
+ private long maxOpDepth; | |
public SVNWCDbSelectMovedForDelete(SVNSqlJetDb sDb) throws SVNException { | |
super(sDb, SVNWCDbSchema.NODES); | |
+ maxOpDepth = -1; | |
} | |
@Override | |
@@ -42,10 +33,7 @@ | |
@Override | |
public void reset() throws SVNException { | |
- if (internalStatement != null) { | |
- internalStatement.reset(); | |
- internalStatement = null; | |
- } | |
+ maxOpDepth = -1; | |
super.reset(); | |
} | |
@@ -61,60 +49,23 @@ | |
@Override | |
protected boolean isFilterPassed() throws SVNException { | |
- long opDepth = getColumnLong(SVNWCDbSchema.NODES__Fields.op_depth); | |
- if (internalStatement == null) { | |
- internalStatement = new InternalStatement(sDb); | |
- internalStatement.bindf("isi", getBind(1), getBind(2), opDepth); | |
- internalStatement.next(); | |
- } | |
- return !isColumnNull(SVNWCDbSchema.NODES__Fields.moved_to) && opDepth >= (Long)getBind(3); | |
+ return !isColumnNull(SVNWCDbSchema.NODES__Fields.moved_to) && getColumnLong(SVNWCDbSchema.NODES__Fields.op_depth) >= getMaxOpDepth(); | |
} | |
- @Override | |
- protected Object[] getWhere() throws SVNException { | |
- return new Object[]{getBind(1)}; | |
- } | |
- | |
- public int getMovedHereDepth() throws SVNException { | |
- if (internalStatement == null) { | |
- return -1; | |
- } else { | |
- return (int) internalStatement.getColumnLong(SVNWCDbSchema.NODES__Fields.op_depth); | |
- } | |
- } | |
- | |
- private static class InternalStatement extends SVNSqlJetSelectFieldsStatement<SVNWCDbSchema.NODES__Fields> { | |
- | |
- public InternalStatement(SVNSqlJetDb sDb) throws SVNException { | |
- super(sDb, SVNWCDbSchema.NODES); | |
- } | |
- | |
- @Override | |
- protected void defineFields() { | |
- fields.add(SVNWCDbSchema.NODES__Fields.op_depth); | |
- } | |
- | |
- @Override | |
- protected ISqlJetCursor openCursor() throws SVNException { | |
+ private long getMaxOpDepth() throws SVNException { | |
+ if (maxOpDepth == -1) { | |
+ SVNWCDbNodesMaxOpDepth maxOpDepth = new SVNWCDbNodesMaxOpDepth(sDb, 0); | |
try { | |
- ISqlJetCursor cursor = super.openCursor().reverse(); | |
- cursor.setLimit(1); | |
- return cursor; | |
- } catch (SqlJetException e) { | |
- SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.WC_DB_ERROR, e); | |
- SVNErrorManager.error(errorMessage, SVNLogType.WC); | |
+ this.maxOpDepth = maxOpDepth.getMaxOpDepth((Long)getBind(1), (String) getBind(2)); | |
+ } finally { | |
+ maxOpDepth.reset(); | |
} | |
- return null; | |
- } | |
- | |
- @Override | |
- protected boolean isFilterPassed() throws SVNException { | |
- return getColumnLong(SVNWCDbSchema.NODES__Fields.op_depth) < (Long)getBind(3) && !isColumnNull(SVNWCDbSchema.NODES__Fields.moved_here); | |
} | |
+ return maxOpDepth; | |
+ } | |
- @Override | |
- protected Object[] getWhere() throws SVNException { | |
- return new Object[] {getBind(1), getBind(2)}; | |
- } | |
+ @Override | |
+ protected Object[] getWhere() throws SVNException { | |
+ return new Object[]{getBind(1)}; | |
} | |
} | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/statement/SVNWCDbSelectMovedFromForDelete.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/statement/SVNWCDbSelectMovedFromForDelete.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/statement/SVNWCDbSelectMovedFromForDelete.java 2014-07-01 03:14:20.943131003 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/statement/SVNWCDbSelectMovedFromForDelete.java 1970-01-01 00:00:00.000000000 +0000 | |
@@ -1,107 +0,0 @@ | |
-package org.tmatesoft.svn.core.internal.wc17.db.statement; | |
- | |
-import org.tmatesoft.sqljet.core.SqlJetException; | |
-import org.tmatesoft.sqljet.core.table.ISqlJetCursor; | |
-import org.tmatesoft.svn.core.SVNErrorCode; | |
-import org.tmatesoft.svn.core.SVNErrorMessage; | |
-import org.tmatesoft.svn.core.SVNException; | |
-import org.tmatesoft.svn.core.internal.db.SVNSqlJetDb; | |
-import org.tmatesoft.svn.core.internal.db.SVNSqlJetSelectFieldsStatement; | |
-import org.tmatesoft.svn.core.internal.wc.SVNErrorManager; | |
-import org.tmatesoft.svn.util.SVNLogType; | |
- | |
-/** | |
- * SELECT local_relpath, op_depth, | |
- * (SELECT CASE WHEN r.moved_here THEN r.op_depth END FROM nodes r | |
- * WHERE r.wc_id = ?1 | |
- * AND r.local_relpath = n.local_relpath | |
- * AND r.op_depth < n.op_depth | |
- * ORDER BY r.op_depth DESC LIMIT 1) AS moved_here_op_depth | |
- * FROM nodes n | |
- * WHERE wc_id = ?1 AND moved_to = ?2 AND op_depth > 0 | |
- * | |
- * @version 1.8 | |
- */ | |
-public class SVNWCDbSelectMovedFromForDelete extends SVNSqlJetSelectFieldsStatement<SVNWCDbSchema.NODES__Fields> { | |
- | |
- InternalStatement internalStatement; | |
- | |
- public SVNWCDbSelectMovedFromForDelete(SVNSqlJetDb sDb) throws SVNException { | |
- super(sDb, SVNWCDbSchema.NODES); | |
- } | |
- | |
- @Override | |
- protected void defineFields() { | |
- fields.add(SVNWCDbSchema.NODES__Fields.local_relpath); | |
- fields.add(SVNWCDbSchema.NODES__Fields.op_depth); | |
- fields.add(SVNWCDbSchema.NODES__Fields.moved_here); | |
- } | |
- | |
- @Override | |
- protected boolean isFilterPassed() throws SVNException { | |
- long opDepth = getColumnLong(SVNWCDbSchema.NODES__Fields.op_depth); | |
- if (internalStatement == null) { | |
- internalStatement = new InternalStatement(sDb); | |
- internalStatement.bindf("isi", getBind(1), getBind(2), opDepth); | |
- internalStatement.next(); | |
- } | |
- return opDepth > 0; | |
- } | |
- | |
- public int getMovedHereOpDepth() throws SVNException { | |
- if (internalStatement == null) { | |
- return -1; | |
- } else { | |
- return (int)internalStatement.getColumnLong(SVNWCDbSchema.NODES__Fields.op_depth); | |
- } | |
- } | |
- | |
- @Override | |
- protected Object[] getWhere() throws SVNException { | |
- return new Object[] {getBind(1), getBind(2)}; | |
- } | |
- | |
- @Override | |
- public void reset() throws SVNException { | |
- if (internalStatement != null) { | |
- internalStatement.reset(); | |
- internalStatement = null; | |
- } | |
- super.reset(); | |
- } | |
- | |
- private static class InternalStatement extends SVNSqlJetSelectFieldsStatement<SVNWCDbSchema.NODES__Fields> { | |
- | |
- public InternalStatement(SVNSqlJetDb sDb) throws SVNException { | |
- super(sDb, SVNWCDbSchema.NODES); | |
- } | |
- | |
- @Override | |
- protected void defineFields() { | |
- fields.add(SVNWCDbSchema.NODES__Fields.op_depth); | |
- } | |
- | |
- @Override | |
- protected ISqlJetCursor openCursor() throws SVNException { | |
- try { | |
- ISqlJetCursor cursor = super.openCursor().reverse(); | |
- cursor.setLimit(1); | |
- return cursor; | |
- } catch (SqlJetException e) { | |
- SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.WC_DB_ERROR, e); | |
- SVNErrorManager.error(errorMessage, SVNLogType.WC); | |
- } | |
- return null; | |
- } | |
- | |
- @Override | |
- protected boolean isFilterPassed() throws SVNException { | |
- return getColumnLong(SVNWCDbSchema.NODES__Fields.op_depth) < (Long)getBind(3) && !isColumnNull(SVNWCDbSchema.NODES__Fields.moved_here); | |
- } | |
- | |
- @Override | |
- protected Object[] getWhere() throws SVNException { | |
- return new Object[] {getBind(1), getBind(2)}; | |
- } | |
- } | |
-} | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/statement/SVNWCDbStatements.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/statement/SVNWCDbStatements.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/statement/SVNWCDbStatements.java 2014-07-01 03:14:20.941131041 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/statement/SVNWCDbStatements.java 2014-07-01 03:13:45.905132668 +0000 | |
@@ -211,9 +211,6 @@ | |
SELECT_DEPTH_NODE(SVNWCDbSelectDepthNode.class), | |
SELECT_BASE_CHILDREN_INFO(SVNWCDbSelectBaseChildrenInfo.class), | |
DELETE_LOCK_RECURSIVELY(SVNWCDbDeleteLockRecursively.class), | |
- INSERT_WORKING_NODE_COPY_FROM(SVNWCDbInsertWorkingNodeCopyFrom.class), | |
- SELECT_MOVED_FROM_FOR_DELETE(SVNWCDbSelectMovedFromForDelete.class), | |
- CLEAR_MOVED_TO_FROM_DEST(SVNWCDbClearMovedToFromDest.class), | |
//1.7 versions of the requests | |
SELECT_ACTUAL_CHILDREN_CONFLICT_17(SVNWCDbSelectActualChildrenConflict17.class), | |
SELECT_ACTUAL_CHILDREN_INFO_17(SVNWCDbSelectActualChildrenInfo17.class), | |
@@ -221,8 +218,7 @@ | |
SELECT_CONFLICT_VICTIMS_17(SVNWCDbSelectConflictVictims17.class), | |
UPDATE_ACTUAL_CONFLICT_DATA_17(SVNWCDbUpdateActualConflictData17.class), | |
INSERT_ACTUAL_CONFLICT_DATA_17(SVNWCDbInsertActualConflictData17.class), | |
- SELECT_MOVED_FROM_RELPATH_17(SVNWCDbSelectMovedFromRelPath17.class), | |
- INSERT_ACTUAL_NODE_17(SVNWCDbInsertActualNode17.class) | |
+ SELECT_MOVED_FROM_RELPATH_17(SVNWCDbSelectMovedFromRelPath17.class) | |
; | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/statement17/SVNWCDbInsertActualNode17.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/statement17/SVNWCDbInsertActualNode17.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/statement17/SVNWCDbInsertActualNode17.java 2014-07-01 03:14:21.070130907 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/statement17/SVNWCDbInsertActualNode17.java 1970-01-01 00:00:00.000000000 +0000 | |
@@ -1,33 +0,0 @@ | |
-package org.tmatesoft.svn.core.internal.wc17.db.statement17; | |
- | |
-import org.tmatesoft.sqljet.core.schema.SqlJetConflictAction; | |
-import org.tmatesoft.svn.core.SVNException; | |
-import org.tmatesoft.svn.core.internal.db.SVNSqlJetDb; | |
-import org.tmatesoft.svn.core.internal.db.SVNSqlJetInsertStatement; | |
-import org.tmatesoft.svn.core.internal.wc17.db.statement.SVNWCDbSchema; | |
- | |
-import java.util.HashMap; | |
-import java.util.Map; | |
- | |
-public class SVNWCDbInsertActualNode17 extends SVNSqlJetInsertStatement { | |
- | |
- public SVNWCDbInsertActualNode17(SVNSqlJetDb sDb) throws SVNException { | |
- super(sDb, SVNWCDbSchema.ACTUAL_NODE, SqlJetConflictAction.REPLACE); | |
- } | |
- | |
- protected Map<String, Object> getInsertValues() throws SVNException { | |
- Map<String, Object> values = new HashMap<String, Object>(); | |
- values.put(SVNWCDbSchema.ACTUAL_NODE__Fields.wc_id.toString(), getBind(1)); | |
- values.put(SVNWCDbSchema.ACTUAL_NODE__Fields.local_relpath.toString(), getBind(2)); | |
- values.put(SVNWCDbSchema.ACTUAL_NODE__Fields.parent_relpath.toString(), getBind(3)); | |
- values.put(SVNWCDbSchema.ACTUAL_NODE__Fields.properties.toString(), getBind(4)); | |
- values.put(SVNWCDbSchema.ACTUAL_NODE__Fields.conflict_old.toString(), getBind(5)); | |
- values.put(SVNWCDbSchema.ACTUAL_NODE__Fields.conflict_new.toString(), getBind(6)); | |
- values.put(SVNWCDbSchema.ACTUAL_NODE__Fields.conflict_working.toString(), getBind(7)); | |
- values.put(SVNWCDbSchema.ACTUAL_NODE__Fields.prop_reject.toString(), getBind(8)); | |
- values.put(SVNWCDbSchema.ACTUAL_NODE__Fields.changelist.toString(), getBind(9)); | |
- values.put(SVNWCDbSchema.ACTUAL_NODE__Fields.text_mod.toString(), null); | |
- values.put(SVNWCDbSchema.ACTUAL_NODE__Fields.tree_conflict_data.toString(), getBind(10)); | |
- return values; | |
- } | |
-} | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/statement17/SvnRevertActualNodesTrigger17.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/statement17/SvnRevertActualNodesTrigger17.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/statement17/SvnRevertActualNodesTrigger17.java 2014-07-01 03:14:21.077131004 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc17/db/statement17/SvnRevertActualNodesTrigger17.java 1970-01-01 00:00:00.000000000 +0000 | |
@@ -1,108 +0,0 @@ | |
-package org.tmatesoft.svn.core.internal.wc17.db.statement17; | |
- | |
-import org.tmatesoft.sqljet.core.SqlJetException; | |
-import org.tmatesoft.sqljet.core.SqlJetTransactionMode; | |
-import org.tmatesoft.sqljet.core.schema.SqlJetConflictAction; | |
-import org.tmatesoft.sqljet.core.table.ISqlJetCursor; | |
-import org.tmatesoft.sqljet.core.table.ISqlJetTable; | |
-import org.tmatesoft.sqljet.core.table.SqlJetDb; | |
-import org.tmatesoft.svn.core.SVNException; | |
-import org.tmatesoft.svn.core.internal.db.ISVNSqlJetTrigger; | |
-import org.tmatesoft.svn.core.internal.db.SVNSqlJetDb; | |
-import org.tmatesoft.svn.core.internal.util.SVNSkel; | |
-import org.tmatesoft.svn.core.internal.wc17.db.SvnWcDbConflicts; | |
-import org.tmatesoft.svn.core.internal.wc17.db.statement.SVNWCDbSchema; | |
- | |
-import java.util.HashMap; | |
-import java.util.Map; | |
- | |
-public class SvnRevertActualNodesTrigger17 implements ISVNSqlJetTrigger { | |
- | |
- private SVNSqlJetDb db; | |
- | |
- public SvnRevertActualNodesTrigger17(SVNSqlJetDb db) { | |
- this.db = db; | |
- } | |
- | |
- public void beforeDelete(ISqlJetCursor cursor) throws SqlJetException { | |
- ISqlJetTable table = db.getDb().getTemporaryDatabase().getTable(SVNWCDbSchema.REVERT_LIST.toString()); | |
- | |
- Map<String, Object> rowValues = new HashMap<String, Object>(); | |
- rowValues.put(SVNWCDbSchema.REVERT_LIST__Fields.local_relpath.toString(), cursor.getValue(SVNWCDbSchema.ACTUAL_NODE__Fields.local_relpath.toString())); | |
- rowValues.put(SVNWCDbSchema.REVERT_LIST__Fields.actual.toString(), 1); | |
- rowValues.put(SVNWCDbSchema.REVERT_LIST__Fields.conflict_data.toString(), getConflictData(cursor)); | |
- | |
- if (!cursor.isNull(SVNWCDbSchema.ACTUAL_NODE__Fields.properties.toString()) | |
- || !cursor.isNull(SVNWCDbSchema.ACTUAL_NODE__Fields.tree_conflict_data.toString())) { | |
- rowValues.put(SVNWCDbSchema.REVERT_LIST__Fields.notify.toString(), 1); | |
- } else if (!exists(db.getDb(), cursor.getInteger(SVNWCDbSchema.ACTUAL_NODE__Fields.wc_id.toString()), cursor.getString(SVNWCDbSchema.ACTUAL_NODE__Fields.local_relpath.toString()))) { | |
- rowValues.put(SVNWCDbSchema.REVERT_LIST__Fields.notify.toString(), 1); | |
- } else { | |
- rowValues.put(SVNWCDbSchema.REVERT_LIST__Fields.notify.toString(), null); | |
- } | |
- table.insertByFieldNamesOr(SqlJetConflictAction.REPLACE, rowValues); | |
- } | |
- | |
- public void beforeUpdate(ISqlJetCursor cursor, Map<String, Object> newValues) throws SqlJetException { | |
- ISqlJetTable table = db.getDb().getTemporaryDatabase().getTable(SVNWCDbSchema.REVERT_LIST.toString()); | |
- | |
- Map<String, Object> rowValues = new HashMap<String, Object>(); | |
- rowValues.put(SVNWCDbSchema.REVERT_LIST__Fields.local_relpath.toString(), cursor.getValue(SVNWCDbSchema.ACTUAL_NODE__Fields.local_relpath.toString())); | |
- rowValues.put(SVNWCDbSchema.REVERT_LIST__Fields.actual.toString(), 1); | |
- rowValues.put(SVNWCDbSchema.REVERT_LIST__Fields.conflict_data.toString(), getConflictData(cursor)); | |
- | |
- if (!cursor.isNull(SVNWCDbSchema.ACTUAL_NODE__Fields.properties.toString()) | |
- || !cursor.isNull(SVNWCDbSchema.ACTUAL_NODE__Fields.tree_conflict_data.toString())) { | |
- rowValues.put(SVNWCDbSchema.REVERT_LIST__Fields.notify.toString(), 1); | |
- } else if (!exists(db.getDb().getTemporaryDatabase(), cursor.getInteger(SVNWCDbSchema.ACTUAL_NODE__Fields.wc_id.toString()), cursor.getString(SVNWCDbSchema.ACTUAL_NODE__Fields.local_relpath.toString()))) { | |
- rowValues.put(SVNWCDbSchema.REVERT_LIST__Fields.notify.toString(), 1); | |
- } else { | |
- rowValues.put(SVNWCDbSchema.REVERT_LIST__Fields.notify.toString(), null); | |
- } | |
- table.insertByFieldNamesOr(SqlJetConflictAction.REPLACE, rowValues); | |
- } | |
- | |
- public void beforeInsert(SqlJetConflictAction conflictAction, ISqlJetTable table, Map<String, Object> newValues) throws SqlJetException { | |
- } | |
- | |
- public void statementStarted(SqlJetDb db) throws SqlJetException { | |
- this.db.getDb().getTemporaryDatabase().beginTransaction(SqlJetTransactionMode.WRITE); | |
- } | |
- | |
- public void statementCompleted(SqlJetDb db, SqlJetException error) throws SqlJetException { | |
- if (error == null) { | |
- this.db.getDb().getTemporaryDatabase().commit(); | |
- } else { | |
- this.db.getDb().getTemporaryDatabase().rollback(); | |
- } | |
- } | |
- | |
- private boolean exists(SqlJetDb db, long wcId, String localRelPath) throws SqlJetException { | |
- ISqlJetTable table = db.getTable(SVNWCDbSchema.NODES.name()); | |
- ISqlJetCursor cursor = table.lookup(null, wcId, localRelPath); | |
- try { | |
- return !cursor.eof(); | |
- } finally { | |
- cursor.close(); | |
- } | |
- } | |
- | |
- private byte[] getConflictData(ISqlJetCursor cursor) throws SqlJetException { | |
- try { | |
- SVNSkel skel = getConflictSkel(cursor); | |
- return skel == null ? null : skel.unparse(); | |
- } catch (SVNException e) { | |
- throw new SqlJetException(e); | |
- } | |
- } | |
- | |
- private SVNSkel getConflictSkel(ISqlJetCursor cursor) throws SqlJetException, SVNException { | |
- String conflictOldRelPath = cursor.getString(SVNWCDbSchema.ACTUAL_NODE__Fields.conflict_old.name()); | |
- String conflictNewRelPath = cursor.getString(SVNWCDbSchema.ACTUAL_NODE__Fields.conflict_new.name()); | |
- String conflictWorkingRelPath = cursor.getString(SVNWCDbSchema.ACTUAL_NODE__Fields.conflict_working.name()); | |
- String propRejectRelPath = cursor.getString(SVNWCDbSchema.ACTUAL_NODE__Fields.prop_reject.name()); | |
- byte[] treeConflictData = cursor.getBlobAsArray(SVNWCDbSchema.ACTUAL_NODE__Fields.tree_conflict_data.name()); | |
- | |
- return SvnWcDbConflicts.convertToConflictSkel(conflictOldRelPath, conflictWorkingRelPath, conflictNewRelPath, propRejectRelPath, treeConflictData); | |
- } | |
-} | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/SvnOperationRunner.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/SvnOperationRunner.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/SvnOperationRunner.java 2014-07-01 03:14:24.963130538 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/SvnOperationRunner.java 2014-07-01 03:12:33.554137927 +0000 | |
@@ -17,11 +17,7 @@ | |
public V run(T operation) throws SVNException { | |
setOperation(operation); | |
- try { | |
- return run(); | |
- } finally { | |
- reset(getWcGeneration()); | |
- } | |
+ return run(); | |
} | |
public void reset(SvnWcGeneration wcGeneration) { | |
@@ -43,7 +39,7 @@ | |
this.operation = operation; | |
} | |
- public T getOperation() { | |
+ protected T getOperation() { | |
return this.operation; | |
} | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/SvnRepositoryAccess.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/SvnRepositoryAccess.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/SvnRepositoryAccess.java 2014-07-01 03:14:26.739129679 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/SvnRepositoryAccess.java 2014-07-01 03:13:45.907132371 +0000 | |
@@ -22,8 +22,6 @@ | |
import org.tmatesoft.svn.core.internal.wc17.SVNWCContext; | |
import org.tmatesoft.svn.core.internal.wc17.db.Structure; | |
import org.tmatesoft.svn.core.internal.wc17.db.StructureFields; | |
-import org.tmatesoft.svn.core.internal.wc2.ng.SvnNgRepositoryAccess; | |
-import org.tmatesoft.svn.core.internal.wc2.old.SvnOldRepositoryAccess; | |
import org.tmatesoft.svn.core.io.ISVNLocationSegmentHandler; | |
import org.tmatesoft.svn.core.io.SVNLocationEntry; | |
import org.tmatesoft.svn.core.io.SVNLocationSegment; | |
@@ -130,7 +128,7 @@ | |
SVNURL url = null; | |
if (path.isFile()) { | |
- if (revision == SVNRevision.WORKING && getWCContext() != null) { | |
+ if (revision == SVNRevision.WORKING) { | |
Structure<StructureFields.NodeOriginInfo> nodeOrigin = getWCContext().getNodeOrigin(path.getFile(), false, StructureFields.NodeOriginInfo.isCopy, StructureFields.NodeOriginInfo.revision, StructureFields.NodeOriginInfo.reposRelpath, StructureFields.NodeOriginInfo.reposRootUrl); | |
boolean isCopy = nodeOrigin.is(StructureFields.NodeOriginInfo.isCopy); | |
long pegRevNum = nodeOrigin.lng(StructureFields.NodeOriginInfo.revision); | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/ng/SvnDiffGenerator.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/ng/SvnDiffGenerator.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/ng/SvnDiffGenerator.java 2014-07-01 03:14:26.565130637 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/ng/SvnDiffGenerator.java 2014-07-01 03:13:45.910132440 +0000 | |
@@ -25,7 +25,6 @@ | |
protected static final String WC_REVISION_LABEL = "(working copy)"; | |
protected static final String PROPERTIES_SEPARATOR = "___________________________________________________________________"; | |
protected static final String HEADER_SEPARATOR = "==================================================================="; | |
- protected static final String HEADER_ENCODING = "UTF-8"; | |
private SvnTarget originalTarget1; | |
private SvnTarget originalTarget2; | |
@@ -517,7 +516,7 @@ | |
diffHeader = header + headerFields; | |
} | |
QDiffGenerator generator = new QDiffUniGenerator(properties, diffHeader); | |
- EmptyDetectionWriter writer = new EmptyDetectionWriter(new OutputStreamWriter(outputStream, HEADER_ENCODING)); | |
+ EmptyDetectionWriter writer = new EmptyDetectionWriter(new OutputStreamWriter(outputStream, getEncoding())); | |
QDiffManager.generateTextDiff(is1, is2, getEncoding(), writer, generator); | |
if (writer.isSomethingWritten()) { | |
visitedPaths.add(displayPath); | |
@@ -553,7 +552,7 @@ | |
try { | |
byteArrayOutputStream.close(); | |
- return byteArrayOutputStream.toString(HEADER_ENCODING); | |
+ return byteArrayOutputStream.toString(getEncoding()); | |
} catch (IOException e) { | |
return ""; | |
} | |
@@ -582,7 +581,7 @@ | |
try { | |
byteArrayOutputStream.close(); | |
- return byteArrayOutputStream.toString(HEADER_ENCODING); | |
+ return byteArrayOutputStream.toString(getEncoding()); | |
} catch (IOException e) { | |
return ""; | |
} | |
@@ -1110,7 +1109,7 @@ | |
} | |
private void displayString(OutputStream outputStream, String s) throws IOException { | |
- outputStream.write(s.getBytes(HEADER_ENCODING)); | |
+ outputStream.write(s.getBytes(getEncoding())); | |
} | |
private void displayEOL(OutputStream os) throws IOException { | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/ng/SvnNgCheckout.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/ng/SvnNgCheckout.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/ng/SvnNgCheckout.java 2014-07-01 03:14:26.598130685 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/ng/SvnNgCheckout.java 2014-07-01 03:13:45.912133316 +0000 | |
@@ -4,20 +4,10 @@ | |
import org.tmatesoft.svn.core.SVNException; | |
import org.tmatesoft.svn.core.internal.wc17.SVNWCContext; | |
import org.tmatesoft.svn.core.internal.wc17.db.ISVNWCDb; | |
-import org.tmatesoft.svn.core.internal.wc2.SvnWcGeneration; | |
import org.tmatesoft.svn.core.wc2.SvnCheckout; | |
import org.tmatesoft.svn.core.wc2.SvnTarget; | |
-public class SvnNgCheckout extends SvnNgAbstractUpdate<Long, SvnCheckout> { | |
- | |
- @Override | |
- public boolean isApplicable(SvnCheckout operation, SvnWcGeneration wcGeneration) throws SVNException { | |
- final int targetWorkingCopyFormat = operation.getTargetWorkingCopyFormat(); | |
- if (targetWorkingCopyFormat > 0) { | |
- return targetWorkingCopyFormat >= SVNWCContext.WC_NG_VERSION; | |
- } | |
- return super.isApplicable(operation, wcGeneration); | |
- } | |
+public class SvnNgCheckout extends SvnNgAbstractUpdate<Long, SvnCheckout>{ | |
@Override | |
protected Long run(SVNWCContext context) throws SVNException { | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/ng/SvnNgMergeCallback2.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/ng/SvnNgMergeCallback2.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/ng/SvnNgMergeCallback2.java 2014-07-01 03:14:26.593130635 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/ng/SvnNgMergeCallback2.java 2014-07-01 03:13:45.918133422 +0000 | |
@@ -675,7 +675,7 @@ | |
recordTreeConflict(localAbsPath, db.parentBaton, SVNNodeKind.DIR, SVNConflictAction.DELETE, SVNConflictReason.EDITED, null, true); | |
} else { | |
if (workingProps != null && workingProps.containsName(SVNProperty.MERGE_INFO)) { | |
- if (mergeDriver.pathsWithDeletedMergeInfo == null) { | |
+ if (mergeDriver.pathsWithDeletedMergeInfo != null) { | |
mergeDriver.pathsWithDeletedMergeInfo = new HashSet<File>(); | |
} | |
mergeDriver.pathsWithDeletedMergeInfo.add(localAbsPath); | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/ng/SvnNgRemoteDiffEditor2.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/ng/SvnNgRemoteDiffEditor2.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/ng/SvnNgRemoteDiffEditor2.java 2014-07-01 03:14:26.599130823 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/ng/SvnNgRemoteDiffEditor2.java 2014-07-01 03:13:45.922133379 +0000 | |
@@ -31,7 +31,6 @@ | |
private FileBaton fileBaton; | |
private Set<File> tempFiles; | |
- private File emptyFile; | |
public SvnNgRemoteDiffEditor2(long revision, boolean textDeltas, SVNRepository repository, ISvnDiffCallback2 callback) { | |
this.revision = revision; | |
@@ -59,19 +58,15 @@ | |
} | |
public void deleteEntry(String path, long revision) throws SVNException { | |
- try { | |
- DirBaton pb = dirBaton; | |
- if (pb.skipChildren) { | |
- return; | |
- } | |
- SVNNodeKind kind = repository.checkPath(path, this.revision); | |
- if (kind == SVNNodeKind.FILE) { | |
- diffDeletedFile(path); | |
- } else if (kind == SVNNodeKind.DIR) { | |
- diffDeletedDirectory(path); | |
- } | |
- } finally { | |
- cleanupTempFiles(); | |
+ DirBaton pb = dirBaton; | |
+ if (pb.skipChildren) { | |
+ return; | |
+ } | |
+ SVNNodeKind kind = repository.checkPath(path, this.revision); | |
+ if (kind == SVNNodeKind.FILE) { | |
+ diffDeletedFile(path); | |
+ } else if (kind == SVNNodeKind.DIR) { | |
+ diffDeletedDirectory(path); | |
} | |
} | |
@@ -233,63 +228,56 @@ | |
} | |
public void closeFile(String path, String textChecksum) throws SVNException { | |
- try { | |
- FileBaton fb = fileBaton; | |
- if (fb.skip) { | |
- return; | |
- } | |
+ FileBaton fb = fileBaton; | |
+ if (fb.skip) { | |
+ return; | |
+ } | |
- if (textChecksum != null && this.textDeltas) { | |
- if (fb.resultMd5Checksum != null && !textChecksum.equals(fb.resultMd5Checksum)) { | |
- SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.CHECKSUM_MISMATCH, "Checksum mismatch for ''{0}''", fb.path); | |
- SVNErrorManager.error(errorMessage, SVNLogType.WC); | |
- } | |
+ if (textChecksum != null && this.textDeltas) { | |
+ if (fb.resultMd5Checksum != null && !textChecksum.equals(fb.resultMd5Checksum)) { | |
+ SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.CHECKSUM_MISMATCH, "Checksum mismatch for ''{0}''", fb.path); | |
+ SVNErrorManager.error(errorMessage, SVNLogType.WC); | |
} | |
+ } | |
- if (fb.added || (fb.pathEndRevision != null || !this.textDeltas) || fb.hasPropChanges) { | |
- SVNProperties rightProps; | |
+ if (fb.added || (fb.pathEndRevision != null || !this.textDeltas) || fb.hasPropChanges) { | |
+ SVNProperties rightProps; | |
- if (!fb.added && fb.pristineProps == null) { | |
- getFileFromRa(fb, true); | |
- } | |
+ if (!fb.added && fb.pristineProps == null) { | |
+ getFileFromRa(fb, true); | |
+ } | |
- String oldChecksum = fb.pristineProps.getStringValue(SVNProperty.CHECKSUM); | |
+ String oldChecksum = fb.pristineProps.getStringValue(SVNProperty.CHECKSUM); | |
- if (fb.pristineProps != null) { | |
- fb.propChanges = removeNonPropChanges(fb.pristineProps, fb.propChanges); | |
- } | |
+ if (fb.pristineProps != null) { | |
+ fb.propChanges = removeNonPropChanges(fb.pristineProps, fb.propChanges); | |
+ } | |
- rightProps = new SVNProperties(fb.pristineProps); | |
- rightProps.putAll(fb.propChanges); | |
- rightProps.removeNullValues(); | |
+ rightProps = new SVNProperties(fb.pristineProps); | |
+ rightProps.putAll(fb.propChanges); | |
+ rightProps.removeNullValues(); | |
- if (fb.added) { | |
- result.reset(); | |
- callback.fileAdded(result, SVNFileUtil.createFilePath(fb.path), null, fb.rightSource, null, fb.pathEndRevision, null, rightProps); | |
- } else { | |
- result.reset(); | |
- boolean fileModified = fb.pathEndRevision != null; | |
- if (textChecksum != null && oldChecksum != null) { | |
- //SVNKit is different from SVN: it always sends applyTextDelta, but Subversion --- only for changed files | |
- fileModified = !textChecksum.equals(oldChecksum); | |
- } | |
- if (fileModified && !textDeltas) { | |
- fb.pathStartRevision = getEmptyFile(); | |
- fb.pathEndRevision = getEmptyFile(); | |
- } | |
- callback.fileChanged(result, SVNFileUtil.createFilePath(fb.path), fb.leftSource, fb.rightSource, fb.pathEndRevision != null ? fb.pathStartRevision : null, fb.pathEndRevision, fb.pristineProps, rightProps, fileModified, fb.propChanges); | |
+ if (fb.added) { | |
+ result.reset(); | |
+ callback.fileAdded(result, SVNFileUtil.createFilePath(fb.path), null, fb.rightSource, null, fb.pathEndRevision, null, rightProps); | |
+ } else { | |
+ result.reset(); | |
+ boolean fileModified = fb.pathEndRevision != null; | |
+ if (textChecksum != null && oldChecksum != null) { | |
+ //SVNKit is different from SVN: it always sends applyTextDelta, but Subversion --- only for changed files | |
+ fileModified = !textChecksum.equals(oldChecksum); | |
+ } | |
+ if (fileModified && !textDeltas) { | |
+ fb.pathStartRevision = getEmptyFile(); | |
+ fb.pathEndRevision = getEmptyFile(); | |
} | |
+ callback.fileChanged(result, SVNFileUtil.createFilePath(fb.path), fb.leftSource, fb.rightSource, fb.pathEndRevision != null ? fb.pathStartRevision : null, fb.pathEndRevision, fb.pristineProps, rightProps, fileModified, fb.propChanges); | |
} | |
- } finally { | |
- cleanupTempFiles(); | |
} | |
} | |
private File getEmptyFile() throws SVNException { | |
- if (this.emptyFile == null) { | |
- this.emptyFile = SVNFileUtil.createTempFile("", ""); | |
- } | |
- return this.emptyFile; | |
+ return SVNFileUtil.createTempFile("", ""); | |
} | |
public SVNCommitInfo closeEdit() throws SVNException { | |
@@ -324,7 +312,7 @@ | |
} | |
if (fb.pathEndRevision == null) { | |
File tmpDir = new File(System.getProperty("java.io.tmpdir")); | |
- fb.pathEndRevision = SVNFileUtil.createUniqueFile(tmpDir, "svn", "tmp", true); | |
+ fb.pathEndRevision = SVNFileUtil.createUniqueFile(tmpDir, "svn", "tmp", false); | |
tempFiles.add(fb.pathEndRevision); | |
} | |
@@ -351,19 +339,6 @@ | |
} | |
public void cleanup() { | |
- cleanupTempFiles(); | |
- | |
- if (emptyFile != null) { | |
- try { | |
- SVNFileUtil.deleteFile(emptyFile); | |
- } catch (SVNException e) { | |
- //ignore | |
- } | |
- emptyFile = null; | |
- } | |
- } | |
- | |
- public void cleanupTempFiles() { | |
for (File tempFile : tempFiles) { | |
try { | |
SVNFileUtil.deleteFile(tempFile); | |
@@ -371,7 +346,6 @@ | |
//ignore | |
} | |
} | |
- tempFiles.clear(); | |
} | |
private void diffDeletedFile(String path) throws SVNException { | |
@@ -461,7 +435,7 @@ | |
} | |
if (!propsOnly) { | |
File tmpDir = new File(System.getProperty("java.io.tmpdir")); | |
- fb.pathStartRevision = SVNFileUtil.createUniqueFile(tmpDir, "svn", "tmp", true); | |
+ fb.pathStartRevision = SVNFileUtil.createUniqueFile(tmpDir, "svn", "tmp", false); | |
tempFiles.add(fb.pathStartRevision); | |
OutputStream outputStream = null; | |
SVNChecksumOutputStream checksumOutputStream = null; | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/ng/SvnNgUpgrade.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/ng/SvnNgUpgrade.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/ng/SvnNgUpgrade.java 2014-07-01 03:14:26.563130424 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/ng/SvnNgUpgrade.java 2014-07-01 03:13:45.924133057 +0000 | |
@@ -43,7 +43,7 @@ | |
SVNWCDb.DirParsedInfo dirParsedInfo = ((SVNWCDb) db).parseDir(localAbsPath, SVNSqlJetDb.Mode.ReadOnly, true, false); | |
int format = dirParsedInfo.wcDbDir.getWCRoot().getFormat(); | |
- if (format < getOperation().getTargetWorkingCopyFormat()) { | |
+ if (format < ISVNWCDb.WC_FORMAT_18) { | |
SvnNgUpgradeSDb.upgrade(localAbsPath, (SVNWCDb) db, db.getSDb(dirParsedInfo.wcDbDir.getWCRoot().getAbsPath()), format, context.getEventHandler()); | |
} | |
@@ -83,7 +83,7 @@ | |
if (status != null) { | |
int workingCopyFormat = status.getWorkingCopyFormat(); | |
- if (workingCopyFormat < getOperation().getTargetWorkingCopyFormat()) { | |
+ if (workingCopyFormat < ISVNWCDb.WC_FORMAT_18) { | |
upgradeRequired = true; | |
} | |
} | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/ng/SvnNgWcToWcCopy.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/ng/SvnNgWcToWcCopy.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/ng/SvnNgWcToWcCopy.java 2014-07-01 03:14:26.633130652 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/ng/SvnNgWcToWcCopy.java 2014-07-01 03:13:45.926133377 +0000 | |
@@ -430,14 +430,12 @@ | |
SVNFileType srcType = SVNFileType.getType(copyPair.source); | |
SVNFileType dstType = SVNFileType.getType(copyPair.dst); | |
- if (!getOperation().isMetadataOnly()) { | |
- if (getOperation().isVirtual()) { | |
- verifyPathsExistenceForVirtualCopy(copyPair.source, copyPair.dst, srcType, dstType, copyPair, move); | |
- } else { | |
- final boolean caseOnlyRename = verifyPaths(srcType, dstType, copyPair, copyPairs.size(), move); | |
- if (caseOnlyRename) { | |
- return; | |
- } | |
+ if (getOperation().isVirtual()) { | |
+ verifyPathsExistenceForVirtualCopy(copyPair.source, copyPair.dst, srcType, dstType, copyPair, move); | |
+ } else { | |
+ final boolean caseOnlyRename = verifyPaths(srcType, dstType, copyPair, copyPairs.size(), move); | |
+ if (caseOnlyRename) { | |
+ return; | |
} | |
} | |
copyPair.dstParent = new File(SVNPathUtil.validateFilePath(SVNFileUtil.getParentFile(copyPair.dst).getAbsolutePath())); | |
@@ -676,12 +674,12 @@ | |
} | |
if (isMove && source.equals(srcWcRootAbsPath)) { | |
- SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.WC_PATH_UNEXPECTED_STATUS, "''{0}'' is the root of a working copy and cannot be moved", source); | |
+ SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.WC_PATH_UNEXPECTED_STATUS, "'{0}' is the root of a working copy and cannot be moved", source); | |
SVNErrorManager.error(errorMessage, SVNLogType.WC); | |
} | |
File srcReposRelPath = srcInfo.get(NodeInfo.reposRelPath); | |
if (isMove && srcReposRelPath != null && "".equals(SVNFileUtil.getFilePath(srcReposRelPath))) { | |
- SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.WC_PATH_UNEXPECTED_STATUS, "''{0}'' represents the repository root and cannot be moved", source); | |
+ SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.WC_PATH_UNEXPECTED_STATUS, "'{0}' represents the repository root and cannot be moved", source); | |
SVNErrorManager.error(errorMessage, SVNLogType.WC); | |
} | |
@@ -691,7 +689,7 @@ | |
readInfo(dstDirectory, NodeInfo.status, NodeInfo.reposRootUrl, NodeInfo.reposUuid); | |
} catch (SVNException e) { | |
if (e.getErrorMessage().getErrorCode() == SVNErrorCode.WC_PATH_NOT_FOUND) { | |
- SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.ENTRY_NOT_FOUND, "''{0}'' is not under version control", dstDirectory); | |
+ SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.ENTRY_NOT_FOUND, "'{0}' is not under version control", dstDirectory); | |
SVNErrorManager.error(errorMessage, SVNLogType.WC); | |
} | |
} | |
@@ -803,7 +801,7 @@ | |
if (srcInfo.get(NodeInfo.kind) == SVNWCDbKind.File || srcInfo.get(NodeInfo.kind) == SVNWCDbKind.Symlink) { | |
final boolean shouldCopyBaseData = shouldCopyBaseData(context, source, metadataOnly, srcStatus); | |
- if (shouldCopyBaseData && getOperation().isVirtual()) {//we check for "virtual" to preserve current behaviour in this case | |
+ if (shouldCopyBaseData) { | |
copyBaseDataOfFile(context, source, dst); | |
} else { | |
copyVersionedFile(context, source, dst, dst, tmpDir, metadataOnly, srcInfo.is(NodeInfo.conflicted), isMove, true); | |
@@ -816,7 +814,7 @@ | |
if (SVNRevision.isValidRevisionNumber(minRevision) && SVNRevision.isValidRevisionNumber(maxRevision) && minRevision != maxRevision) { | |
if (!allowMixedRevisions) { | |
SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.WC_MIXED_REVISIONS, | |
- "Cannot move mixed-revision subtree ''{0}'' [{1}:{2}]; try updating it first", source, minRevision, maxRevision); | |
+ "Cannot move mixed-revision subtree '{0}' [{1}:{2}]; try updating it first", source, minRevision, maxRevision); | |
SVNErrorManager.error(errorMessage, SVNLogType.WC); | |
} | |
isMove = false; | |
@@ -938,17 +936,17 @@ | |
} else if (info.kind == SVNWCDbKind.Dir) { | |
copyVersionedDirectory(wcContext, childSrcAbsPath, childDstAbsPath, dstOpRootAbsPath, tmpDirAbsPath, metadataOnly, isMove, false); | |
} else { | |
- SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.NODE_UNEXPECTED_KIND, "cannot handle node kind for ''{0}''", childSrcAbsPath); | |
+ SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.NODE_UNEXPECTED_KIND, "cannot handle node kind for '{0}'", childSrcAbsPath); | |
SVNErrorManager.error(errorMessage, SVNLogType.WC); | |
} | |
} else if (info.status == SVNWCDbStatus.Deleted || info.status == SVNWCDbStatus.NotPresent || info.status == SVNWCDbStatus.Excluded) { | |
wcContext.getDb().opCopy(childSrcAbsPath, childDstAbsPath, dstOpRootAbsPath, isMove, null); | |
} else if (info.status == SVNWCDbStatus.Incomplete) { | |
- SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.WC_PATH_UNEXPECTED_STATUS, "Cannot handle status of ''{0}''", childSrcAbsPath); | |
+ SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.WC_PATH_UNEXPECTED_STATUS, "Cannot handle status of '{0}'", childSrcAbsPath); | |
SVNErrorManager.error(errorMessage, SVNLogType.WC); | |
} else { | |
assert (info.status == SVNWCDbStatus.ServerExcluded); | |
- SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.WC_PATH_UNEXPECTED_STATUS, "Cannot copy ''{0}'' excluded by server", childSrcAbsPath); | |
+ SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.WC_PATH_UNEXPECTED_STATUS, "Cannot copy '{0}' excluded by server", childSrcAbsPath); | |
SVNErrorManager.error(errorMessage, SVNLogType.WC); | |
} | |
if (diskChildren != null && (info.status == SVNWCDbStatus.Normal || info.status == SVNWCDbStatus.Added)) { | |
@@ -1045,7 +1043,7 @@ | |
if (copyToTmpDir.kind == SVNNodeKind.NONE) { | |
return copyToTmpDir; | |
} else if (copyToTmpDir.kind == SVNNodeKind.UNKNOWN) { | |
- SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.NODE_UNEXPECTED_KIND, "Source ''{0}'' is unexpected kind", srcAbsPath); | |
+ SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.NODE_UNEXPECTED_KIND, "Source '{0}' is unexpected kind", srcAbsPath); | |
SVNErrorManager.error(errorMessage, SVNLogType.WC); | |
} else if (copyToTmpDir.kind == SVNNodeKind.DIR) { | |
deleteOnClose = true; | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/old/SvnOldCheckout.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/old/SvnOldCheckout.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/old/SvnOldCheckout.java 2014-07-01 03:14:27.371130093 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/old/SvnOldCheckout.java 2014-07-01 03:12:33.576138700 +0000 | |
@@ -1,78 +1,26 @@ | |
package org.tmatesoft.svn.core.internal.wc2.old; | |
import org.tmatesoft.svn.core.SVNException; | |
-import org.tmatesoft.svn.core.internal.wc.admin.ISVNAdminAreaFactorySelector; | |
-import org.tmatesoft.svn.core.internal.wc.admin.SVNAdminAreaFactory; | |
import org.tmatesoft.svn.core.internal.wc16.SVNUpdateClient16; | |
-import org.tmatesoft.svn.core.internal.wc17.SVNWCContext; | |
-import org.tmatesoft.svn.core.internal.wc2.SvnWcGeneration; | |
import org.tmatesoft.svn.core.internal.wc2.compat.SvnCodec; | |
import org.tmatesoft.svn.core.wc2.SvnCheckout; | |
-import java.io.File; | |
-import java.util.ArrayList; | |
-import java.util.Collection; | |
-import java.util.Collections; | |
-import java.util.List; | |
- | |
public class SvnOldCheckout extends SvnOldRunner<Long, SvnCheckout> { | |
- @Override | |
- public boolean isApplicable(SvnCheckout operation, SvnWcGeneration wcGeneration) throws SVNException { | |
- final int targetWorkingCopyFormat = operation.getTargetWorkingCopyFormat(); | |
- if (targetWorkingCopyFormat > 0) { | |
- return targetWorkingCopyFormat < SVNWCContext.WC_NG_VERSION; | |
- } | |
- return super.isApplicable(operation, wcGeneration); | |
- } | |
@Override | |
- protected Long run() throws SVNException { | |
- final int targetWorkingCopyFormat = getOperation().getTargetWorkingCopyFormat(); | |
- final ISVNAdminAreaFactorySelector oldSelector = SVNAdminAreaFactory.getSelector(); | |
- try { | |
- if (targetWorkingCopyFormat > 0) { | |
- SVNAdminAreaFactory.setSelector(new ISVNAdminAreaFactorySelector() { | |
- public Collection getEnabledFactories(File path, Collection factories, boolean writeAccess) throws SVNException { | |
- List<SVNAdminAreaFactory> adminAreaFactories = new ArrayList<SVNAdminAreaFactory>(factories); | |
- int index = findFactoryByFormat(adminAreaFactories, targetWorkingCopyFormat); | |
- if (index > 0) { | |
- //move the factory to the start of the list | |
- SVNAdminAreaFactory adminAreaFactory = adminAreaFactories.get(index); | |
- adminAreaFactories.remove(index); | |
- adminAreaFactories.add(0, adminAreaFactory); | |
- } | |
- return adminAreaFactories; | |
- } | |
- | |
- private int findFactoryByFormat(List<SVNAdminAreaFactory> factories, int workingCopyFormat) { | |
- for (int i = 0; i < factories.size(); i++) { | |
- final SVNAdminAreaFactory factory = factories.get(i); | |
- if (factory.getSupportedVersion() == workingCopyFormat) { | |
- return i; | |
- } | |
- } | |
- return -1; | |
- } | |
- }); | |
- } | |
- | |
+ protected Long run() throws SVNException { | |
SVNUpdateClient16 client = new SVNUpdateClient16(getOperation().getRepositoryPool(), getOperation().getOptions()); | |
client.setIgnoreExternals(getOperation().isIgnoreExternals()); | |
client.setUpdateLocksOnDemand(getOperation().isUpdateLocksOnDemand()); | |
client.setEventHandler(getOperation().getEventHandler()); | |
client.setExternalsHandler(SvnCodec.externalsHandler(getOperation().getExternalsHandler())); | |
- | |
+ | |
return client.doCheckout(getOperation().getSource().getURL(), | |
getFirstTarget(), | |
getOperation().getSource().getResolvedPegRevision(), | |
getOperation().getRevision(), | |
getOperation().getDepth(), | |
getOperation().isAllowUnversionedObstructions()); | |
- } finally { | |
- if (targetWorkingCopyFormat > 0) { | |
- SVNAdminAreaFactory.setSelector(oldSelector); | |
- } | |
- } | |
} | |
} | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/old/SvnOldList.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/old/SvnOldList.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/old/SvnOldList.java 2014-07-01 03:14:27.317130750 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/old/SvnOldList.java 1970-01-01 00:00:00.000000000 +0000 | |
@@ -1,26 +0,0 @@ | |
-package org.tmatesoft.svn.core.internal.wc2.old; | |
- | |
-import org.tmatesoft.svn.core.ISVNDirEntryHandler; | |
-import org.tmatesoft.svn.core.SVNDirEntry; | |
-import org.tmatesoft.svn.core.SVNException; | |
-import org.tmatesoft.svn.core.internal.wc16.SVNLogClient16; | |
-import org.tmatesoft.svn.core.internal.wc16.SVNWCClient16; | |
-import org.tmatesoft.svn.core.internal.wc2.compat.SvnCodec; | |
-import org.tmatesoft.svn.core.internal.wc2.remote.SvnRemoteList; | |
-import org.tmatesoft.svn.core.wc2.SvnList; | |
-import org.tmatesoft.svn.core.wc2.SvnTarget; | |
- | |
-public class SvnOldList extends SvnOldRunner<SVNDirEntry, SvnList> implements ISVNDirEntryHandler { | |
- | |
- @Override | |
- protected SVNDirEntry run() throws SVNException { | |
- SVNLogClient16 client = new SVNLogClient16(getOperation().getRepositoryPool(), getOperation().getOptions()); | |
- client.setEventHandler(getOperation().getEventHandler()); | |
- client.doList(getFirstTarget(), getOperation().getFirstTarget().getPegRevision(), getOperation().getRevision(), getOperation().isFetchLocks(), getOperation().getDepth(), SVNDirEntry.DIRENT_ALL, this); | |
- return getOperation().first(); | |
- } | |
- | |
- public void handleDirEntry(SVNDirEntry dirEntry) throws SVNException { | |
- getOperation().receive(SvnTarget.fromURL(dirEntry.getURL()), dirEntry); | |
- } | |
-} | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/old/SvnOldUpgrade.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/old/SvnOldUpgrade.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/old/SvnOldUpgrade.java 2014-07-01 03:14:27.323129718 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/old/SvnOldUpgrade.java 2014-07-01 03:13:45.927132671 +0000 | |
@@ -10,14 +10,15 @@ | |
import org.tmatesoft.svn.core.internal.util.SVNURLUtil; | |
import org.tmatesoft.svn.core.internal.wc.*; | |
import org.tmatesoft.svn.core.internal.wc.admin.*; | |
-import org.tmatesoft.svn.core.internal.wc16.SVNStatusClient16; | |
import org.tmatesoft.svn.core.internal.wc16.SVNUpdateClient16; | |
-import org.tmatesoft.svn.core.internal.wc16.SVNWCClient16; | |
import org.tmatesoft.svn.core.internal.wc17.SVNWCContext; | |
import org.tmatesoft.svn.core.internal.wc17.SVNWCUtils; | |
-import org.tmatesoft.svn.core.internal.wc17.db.*; | |
import org.tmatesoft.svn.core.internal.wc17.db.ISVNWCDb.SVNWCDbOpenMode; | |
import org.tmatesoft.svn.core.internal.wc17.db.ISVNWCDb.SVNWCDbUpgradeData; | |
+import org.tmatesoft.svn.core.internal.wc17.db.SVNWCDb; | |
+import org.tmatesoft.svn.core.internal.wc17.db.SVNWCDbRoot; | |
+import org.tmatesoft.svn.core.internal.wc17.db.SvnWcDbPristines; | |
+import org.tmatesoft.svn.core.internal.wc17.db.SvnWcDbProperties; | |
import org.tmatesoft.svn.core.internal.wc17.db.statement.SVNWCDbSchema; | |
import org.tmatesoft.svn.core.internal.wc17.db.statement.SVNWCDbStatements; | |
import org.tmatesoft.svn.core.internal.wc2.SvnRepositoryAccess; | |
@@ -29,7 +30,6 @@ | |
import org.tmatesoft.svn.core.wc.SVNEventAction; | |
import org.tmatesoft.svn.core.wc2.*; | |
import org.tmatesoft.svn.core.wc2.SvnChecksum.Kind; | |
-import org.tmatesoft.svn.util.SVNDebugLog; | |
import org.tmatesoft.svn.util.SVNLogType; | |
import java.io.File; | |
@@ -106,36 +106,8 @@ | |
@Override | |
protected SvnWcGeneration run() throws SVNException { | |
- final int targetWorkingCopyFormat = getOperation().getTargetWorkingCopyFormat(); | |
- final int currentWorkingCopyFormat = readWorkingCopyFormat(getFirstTarget()); | |
- if (targetWorkingCopyFormat == currentWorkingCopyFormat) { | |
- //do nothing | |
- return SvnWcGeneration.V16; | |
- } else if (targetWorkingCopyFormat < currentWorkingCopyFormat) { | |
- //1.6->1.5, 1.6.->1.4, 1.5->1.4 | |
- SVNWCClient16 client = new SVNWCClient16(getOperation().getRepositoryPool(), getOperation().getOptions()); | |
- client.setEventHandler(getOperation().getEventHandler()); | |
- client.setDebugLog(SVNDebugLog.getDefaultLog()); | |
- client.doSetWCFormat(getFirstTarget(), targetWorkingCopyFormat); | |
- return SvnWcGeneration.V16; | |
- } else if (targetWorkingCopyFormat >= SVNAdminArea16.WC_FORMAT) { | |
- //1.5->1.7, 1.4->1.8, 1.6->1.7, 1.4->1.6 and so on | |
- //then upgrade to 1.6 | |
- if (currentWorkingCopyFormat < SVNAdminArea16.WC_FORMAT) { | |
- SVNWCClient16 client = new SVNWCClient16(getOperation().getRepositoryPool(), getOperation().getOptions()); | |
- client.setEventHandler(getOperation().getEventHandler()); | |
- client.setDebugLog(SVNDebugLog.getDefaultLog()); | |
- client.doSetWCFormat(getFirstTarget(), SVNAdminArea16.WC_FORMAT); | |
- } | |
- //and continue upgrading only if targetWorkingCopyFormat > 1.6 | |
- if (targetWorkingCopyFormat == SVNAdminArea16.WC_FORMAT) { | |
- return SvnWcGeneration.V16; | |
- } | |
- } | |
- | |
- | |
- if (getOperation().getFirstTarget().isURL()) { | |
+ if (getOperation().getFirstTarget().isURL()) { | |
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.ILLEGAL_TARGET, "'{0}' is not a local path", getOperation().getFirstTarget().getURL()); | |
SVNErrorManager.error(err, SVNLogType.WC); | |
} | |
@@ -186,15 +158,7 @@ | |
return SvnWcGeneration.V17; | |
} | |
- private int readWorkingCopyFormat(File firstTarget) throws SVNException { | |
- SVNWCAccess wcAccess = getWCAccess(); | |
- SVNAdminArea adminArea = wcAccess.probeOpen(firstTarget, false, 0); | |
- final int currentWorkingCopyFormat = adminArea.getFormatVersion(); | |
- wcAccess.close(); | |
- return currentWorkingCopyFormat; | |
- } | |
- | |
- private void checkIsOldWCRoot(File localAbsPath) throws SVNException { | |
+ private void checkIsOldWCRoot(File localAbsPath) throws SVNException { | |
SVNWCAccess wcAccess = getWCAccess(); | |
try { | |
@@ -343,7 +307,7 @@ | |
/* | |
* Create an empty sqlite database for this directory and store it in DB. | |
*/ | |
- db.upgradeBegin(upgradeData.rootAbsPath, upgradeData, getEntryRepositoryRootURL(thisDir), thisDir.getUUID(), getOperation().getTargetWorkingCopyFormat()); | |
+ db.upgradeBegin(upgradeData.rootAbsPath, upgradeData, getEntryRepositoryRootURL(thisDir), thisDir.getUUID()); | |
/* | |
* Migrate the entries over to the new database. ### We need to think about atomicity here. | |
@@ -508,7 +472,7 @@ | |
/***** ENTRIES - WRITE *****/ | |
try { | |
- dirBaton = SvnOldUpgradeEntries.writeUpgradedEntries(parentDirBaton, db, data, dirAbsPath, entries, textBases, getOperation().getTargetWorkingCopyFormat()); | |
+ dirBaton = SvnOldUpgradeEntries.writeUpgradedEntries(parentDirBaton, db, data, dirAbsPath, entries, textBases); | |
} catch (SVNException ex) { | |
if (ex.getErrorMessage().getErrorCode() == SVNErrorCode.WC_CORRUPT) { | |
SVNErrorMessage err = ex.getErrorMessage().wrap("This working copy is corrupt and cannot be upgraded. Please check out a new working copy."); | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/old/SvnOldUpgradeEntries.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/old/SvnOldUpgradeEntries.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/old/SvnOldUpgradeEntries.java 2014-07-01 03:14:27.319130112 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/old/SvnOldUpgradeEntries.java 2014-07-01 03:13:45.928133102 +0000 | |
@@ -34,7 +34,7 @@ | |
public class SvnOldUpgradeEntries { | |
public static WriteBaton writeUpgradedEntries(WriteBaton parentNode, SVNWCDb db, SVNWCDbUpgradeData upgradeData, File dirAbsPath, | |
- Map<String, SVNEntry> entries, SVNHashMap textBases, int targetWorkingCopyFormat) throws SVNException { | |
+ Map<String, SVNEntry> entries, SVNHashMap textBases) throws SVNException { | |
WriteBaton dirNode = new WriteBaton(); | |
SVNEntry thisDir = entries.get(""); | |
@@ -51,7 +51,7 @@ | |
/* Write out "this dir" */ | |
dirNode = writeEntry(true, parentNode, db, upgradeData, thisDir, null, dirRelPath, | |
- SVNFileUtil.createFilePath(upgradeData.rootAbsPath, dirRelPath), oldRootAbsPath, thisDir, false, targetWorkingCopyFormat); | |
+ SVNFileUtil.createFilePath(upgradeData.rootAbsPath, dirRelPath), oldRootAbsPath, thisDir, false); | |
for (Iterator<String> names = entries.keySet().iterator(); names.hasNext();) { | |
String name = (String) names.next(); | |
@@ -65,11 +65,11 @@ | |
File childAbsPath = SVNFileUtil.createFilePath(dirAbsPath, name); | |
File childRelPath = SVNWCUtils.skipAncestor(oldRootAbsPath, childAbsPath); | |
writeEntry(false, dirNode, db, upgradeData, entry, info, childRelPath, | |
- SVNFileUtil.createFilePath(upgradeData.rootAbsPath, childRelPath), oldRootAbsPath, thisDir, true, targetWorkingCopyFormat); | |
+ SVNFileUtil.createFilePath(upgradeData.rootAbsPath, childRelPath), oldRootAbsPath, thisDir, true); | |
} | |
if (dirNode.treeConflicts != null) { | |
- writeActualOnlyEntries(dirNode.treeConflicts, upgradeData.root.getSDb(), upgradeData.root.getDb(), upgradeData.rootAbsPath, upgradeData.workingCopyId, SVNFileUtil.getFilePath(dirRelPath), targetWorkingCopyFormat); | |
+ writeActualOnlyEntries(dirNode.treeConflicts, upgradeData.root.getSDb(), upgradeData.root.getDb(), upgradeData.rootAbsPath, upgradeData.workingCopyId, SVNFileUtil.getFilePath(dirRelPath)); | |
} | |
return dirNode; | |
@@ -121,7 +121,7 @@ | |
/* Write the information for ENTRY to WC_DB. The WC_ID, REPOS_ID and REPOS_ROOT will all be used for writing ENTRY. | |
Transitioning from straight sql to using the wc_db APIs. For the time being, we'll need both parameters. */ | |
private static WriteBaton writeEntry(boolean isCalculateEntryNode, WriteBaton parentNode, SVNWCDb db, SVNWCDbUpgradeData upgradeData, SVNEntry entry, TextBaseInfo textBaseInfo, | |
- File localRelPath, File tmpEntryAbsPath, File rootAbsPath, SVNEntry thisDir, boolean isCreateLocks, int targetWorkingCopyFormat) throws SVNException { | |
+ File localRelPath, File tmpEntryAbsPath, File rootAbsPath, SVNEntry thisDir, boolean isCreateLocks) throws SVNException { | |
DbNode baseNode = null; | |
DbNode workingNode = null; | |
DbNode belowWorkingNode = null; | |
@@ -629,7 +629,7 @@ | |
actualNode.wcId = upgradeData.workingCopyId; | |
actualNode.localRelPath = SVNFileUtil.getFilePath(localRelPath); | |
actualNode.parentRelPath = parentRelPath; | |
- insertActualNode(upgradeData.root.getSDb(), upgradeData.root.getDb(), upgradeData.rootAbsPath, actualNode, targetWorkingCopyFormat); | |
+ insertActualNode(upgradeData.root.getSDb(), upgradeData.root.getDb(), upgradeData.rootAbsPath, actualNode); | |
} | |
WriteBaton entryNode = null; | |
@@ -718,8 +718,8 @@ | |
} | |
} | |
- private static void insertActualNode(SVNSqlJetDb sDb, ISVNWCDb db, File wriAbsPath, DbActualNode actualNode, int targetWorkingCopyFormat) throws SVNException { | |
- SVNSqlJetStatement stmt = sDb.getStatement(targetWorkingCopyFormat <= ISVNWCDb.WC_FORMAT_17 ? SVNWCDbStatements.INSERT_ACTUAL_NODE_17: SVNWCDbStatements.INSERT_ACTUAL_NODE); | |
+ private static void insertActualNode(SVNSqlJetDb sDb, ISVNWCDb db, File wriAbsPath, DbActualNode actualNode) throws SVNException { | |
+ SVNSqlJetStatement stmt = sDb.getStatement(SVNWCDbStatements.INSERT_ACTUAL_NODE); | |
try { | |
stmt.bindLong(1, actualNode.wcId); | |
stmt.bindString(2, actualNode.localRelPath); | |
@@ -728,48 +728,30 @@ | |
stmt.bindProperties(4, actualNode.properties); | |
} | |
if (actualNode.changelist != null) { | |
- if (targetWorkingCopyFormat <= ISVNWCDb.WC_FORMAT_17) { | |
- stmt.bindString(9, actualNode.changelist); | |
- } else { | |
- stmt.bindString(5, actualNode.changelist); | |
- } | |
+ stmt.bindString(5, actualNode.changelist); | |
} | |
- if (targetWorkingCopyFormat <= ISVNWCDb.WC_FORMAT_17) { | |
- if (actualNode.conflictOld != null) { | |
- stmt.bindString(5, actualNode.conflictOld); | |
- stmt.bindString(6, actualNode.conflictNew); | |
- stmt.bindString(7, actualNode.conflictWorking); | |
- } | |
- if (actualNode.propReject != null) { | |
- stmt.bindString(8, actualNode.propReject); | |
- } | |
- if (actualNode.treeConflictData != null) { | |
- stmt.bindString(10, actualNode.treeConflictData); | |
- } | |
- } else { | |
- byte[] treeConflictDataBytes = null; | |
- if (actualNode.treeConflictData != null) { | |
- try { | |
- treeConflictDataBytes = actualNode.treeConflictData.getBytes("UTF-8"); | |
- } catch (UnsupportedEncodingException e) { | |
- treeConflictDataBytes = actualNode.treeConflictData.getBytes(); | |
- } | |
+ byte[] treeConflictDataBytes = null; | |
+ if (actualNode.treeConflictData != null) { | |
+ try { | |
+ treeConflictDataBytes = actualNode.treeConflictData.getBytes("UTF-8"); | |
+ } catch (UnsupportedEncodingException e) { | |
+ treeConflictDataBytes = actualNode.treeConflictData.getBytes(); | |
} | |
+ } | |
- SVNSkel conflictData = SvnWcDbConflicts.upgradeConflictSkelFromRaw(db, wriAbsPath, | |
- SVNFileUtil.createFilePath(actualNode.localRelPath), | |
- actualNode.conflictOld, | |
- actualNode.conflictWorking, | |
- actualNode.conflictNew, | |
- SVNFileUtil.createFilePath(actualNode.propReject), | |
- SVNSkel.parse(treeConflictDataBytes)); | |
- | |
- if (conflictData != null) { | |
- byte[] conflictDataBytes = conflictData.unparse(); | |
- stmt.bindBlob(6, conflictDataBytes); | |
- } | |
+ SVNSkel conflictData = SvnWcDbConflicts.upgradeConflictSkelFromRaw(db, wriAbsPath, | |
+ SVNFileUtil.createFilePath(actualNode.localRelPath), | |
+ actualNode.conflictOld, | |
+ actualNode.conflictWorking, | |
+ actualNode.conflictNew, | |
+ SVNFileUtil.createFilePath(actualNode.propReject), | |
+ SVNSkel.parse(treeConflictDataBytes)); | |
+ | |
+ if (conflictData != null) { | |
+ byte[] conflictDataBytes = conflictData.unparse(); | |
+ stmt.bindBlob(6, conflictDataBytes); | |
} | |
stmt.done(); | |
} finally { | |
@@ -777,7 +759,7 @@ | |
} | |
} | |
- private static void writeActualOnlyEntries(Map<String, String> treeConflicts, SVNSqlJetDb sDb, ISVNWCDb db, File wriAbsPath, long wcId, String dirRelPath, int targetWorkingCopyFormat) throws SVNException { | |
+ private static void writeActualOnlyEntries(Map<String, String> treeConflicts, SVNSqlJetDb sDb, ISVNWCDb db, File wriAbsPath, long wcId, String dirRelPath) throws SVNException { | |
for (Iterator<String> items = treeConflicts.keySet().iterator(); items.hasNext();) { | |
String path = items.next(); | |
DbActualNode actualNode = new DbActualNode(); | |
@@ -785,7 +767,7 @@ | |
actualNode.localRelPath = path; | |
actualNode.parentRelPath = dirRelPath; | |
actualNode.treeConflictData = treeConflicts.get(path); | |
- insertActualNode(sDb, db, wriAbsPath, actualNode, targetWorkingCopyFormat); | |
+ insertActualNode(sDb, db, wriAbsPath, actualNode); | |
} | |
} | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/remote/SvnRemoteList.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/remote/SvnRemoteList.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/remote/SvnRemoteList.java 2014-07-01 03:14:26.861132147 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/internal/wc2/remote/SvnRemoteList.java 2014-07-01 03:13:45.929132273 +0000 | |
@@ -24,9 +24,6 @@ | |
public class SvnRemoteList extends SvnRemoteOperationRunner<SVNDirEntry, SvnList> implements ISVNDirEntryHandler { | |
public boolean isApplicable(SvnList operation, SvnWcGeneration wcGeneration) throws SVNException { | |
- if (wcGeneration == SvnWcGeneration.V16 && operation.getFirstTarget().isFile()) { | |
- return false; | |
- } | |
return true; | |
} | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/io/SVNRepositoryFactory.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/io/SVNRepositoryFactory.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/io/SVNRepositoryFactory.java 2014-07-01 03:14:29.387130548 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/io/SVNRepositoryFactory.java 2014-07-01 03:13:45.931133099 +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_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNBasicClient.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNBasicClient.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNBasicClient.java 2014-07-01 03:14:30.019130476 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNBasicClient.java 2014-07-01 03:12:33.599138439 +0000 | |
@@ -71,8 +71,11 @@ | |
this.operationFactory.setAuthenticationManager(authManager); | |
this.operationFactory.setRepositoryPool(new DefaultSVNRepositoryPool(authManager, options)); | |
this.operationFactory.setAutoDisposeRepositoryPool(true); | |
- | |
- initDefaults(); | |
+ | |
+ setPathListHandler(null); | |
+ setDebugLog(null); | |
+ setEventPathPrefix(null); | |
+ setEventHandler(null); | |
} | |
protected SVNBasicClient(ISVNRepositoryPool pool, ISVNOptions options) { | |
@@ -88,16 +91,7 @@ | |
setOptions(options); | |
this.operationFactory.setRepositoryPool(pool); | |
this.operationFactory.setAutoDisposeRepositoryPool(autoDisposeRepositoryPool); | |
- initDefaults(); | |
- } | |
- | |
- protected SVNBasicClient(SvnOperationFactory of) { | |
- this.operationFactory = of; | |
- setOptions(of.getOptions()); | |
- initDefaults(); | |
- } | |
- | |
- protected void initDefaults() { | |
+ | |
setPathListHandler(null); | |
setDebugLog(null); | |
setEventPathPrefix(null); | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNChangelistClient.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNChangelistClient.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNChangelistClient.java 2014-07-01 03:14:30.018130355 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNChangelistClient.java 2014-07-01 03:12:33.600138579 +0000 | |
@@ -21,7 +21,6 @@ | |
import org.tmatesoft.svn.core.internal.wc2.compat.SvnCodec; | |
import org.tmatesoft.svn.core.io.SVNRepository; | |
import org.tmatesoft.svn.core.wc2.SvnGetChangelistPaths; | |
-import org.tmatesoft.svn.core.wc2.SvnOperationFactory; | |
import org.tmatesoft.svn.core.wc2.SvnSetChangelist; | |
import org.tmatesoft.svn.core.wc2.SvnTarget; | |
@@ -106,10 +105,6 @@ | |
super(repositoryPool, options); | |
} | |
- public SVNChangelistClient(SvnOperationFactory of) { | |
- super(of); | |
- } | |
- | |
/** | |
* @param path | |
* @param changeLists | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNClientManager.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNClientManager.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNClientManager.java 2014-07-01 03:14:29.970130318 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNClientManager.java 2014-07-01 03:12:33.600138579 +0000 | |
@@ -18,10 +18,8 @@ | |
import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager; | |
import org.tmatesoft.svn.core.io.SVNRepository; | |
import org.tmatesoft.svn.core.io.SVNRepositoryFactory; | |
-import org.tmatesoft.svn.core.wc.admin.SVNAdminBasicClient; | |
import org.tmatesoft.svn.core.wc.admin.SVNAdminClient; | |
import org.tmatesoft.svn.core.wc.admin.SVNLookClient; | |
-import org.tmatesoft.svn.core.wc2.SvnOperationFactory; | |
import org.tmatesoft.svn.util.ISVNDebugLog; | |
import org.tmatesoft.svn.util.SVNDebugLog; | |
@@ -134,8 +132,6 @@ | |
private ISVNRepositoryPool myRepositoryPool; | |
private ISVNDebugLog myDebugLog; | |
- private SvnOperationFactory myOperationFactory; | |
- | |
private boolean myIsIgnoreExternals; | |
private SVNClientManager(ISVNOptions options, ISVNRepositoryPool repositoryPool) { | |
@@ -149,11 +145,7 @@ | |
private SVNClientManager(ISVNOptions options, final ISVNAuthenticationManager authManager) { | |
this(options, new DefaultSVNRepositoryPool(authManager == null ? SVNWCUtil.createDefaultAuthenticationManager() : authManager, options)); | |
} | |
- | |
- private SVNClientManager(SvnOperationFactory of) { | |
- myOperationFactory = of; | |
- } | |
- | |
+ | |
/** | |
* Creates a new instance of this class using default {@link ISVNOptions} | |
* and {@link org.tmatesoft.svn.core.auth.ISVNAuthenticationManager} drivers. | |
@@ -200,11 +192,7 @@ | |
public static SVNClientManager newInstance(ISVNOptions options, ISVNAuthenticationManager authManager) { | |
return new SVNClientManager(options, authManager); | |
} | |
- | |
- public static SVNClientManager newInstance(SvnOperationFactory operationFactory) { | |
- return new SVNClientManager(operationFactory); | |
- } | |
- | |
+ | |
/** | |
* Creates a new instance of this class using the provided | |
* config driver and creator of of <b>SVNRepository</b> objects. | |
@@ -232,7 +220,7 @@ | |
* @return a new <b>SVNClientManager</b> instance | |
*/ | |
public static SVNClientManager newInstance(DefaultSVNOptions options, String userName, String password) { | |
- boolean storeAuth = options == null || options.isAuthStorageEnabled(); | |
+ boolean storeAuth = options == null ? true : options.isAuthStorageEnabled(); | |
ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager(null, userName, password, storeAuth); | |
return new SVNClientManager(options, authManager); | |
} | |
@@ -260,8 +248,8 @@ | |
* @throws SVNException | |
*/ | |
public SVNRepository createRepository(SVNURL url, boolean mayReuse) throws SVNException { | |
- if (getRepositoryPool() != null) { | |
- return getRepositoryPool().createRepository(url, mayReuse); | |
+ if (myRepositoryPool != null) { | |
+ return myRepositoryPool.createRepository(url, mayReuse); | |
} | |
SVNRepository repository = SVNRepositoryFactory.create(url); | |
repository.setAuthenticationManager(SVNWCUtil.createDefaultAuthenticationManager()); | |
@@ -270,13 +258,12 @@ | |
} | |
/** | |
- * @param shutdownAll whether to shutdown connection | |
- * that are considered active at the moment | |
+ * @param shutdownAll | |
* @deprecated use {@link #dispose()} instead | |
*/ | |
public void shutdownConnections(boolean shutdownAll) { | |
- if (getRepositoryPool() != null) { | |
- getRepositoryPool().dispose(); | |
+ if (myRepositoryPool != null) { | |
+ myRepositoryPool.dispose(); | |
} | |
} | |
@@ -286,9 +273,7 @@ | |
* any open network sessions. | |
*/ | |
public void dispose() { | |
- if (myOperationFactory != null) { | |
- myOperationFactory.dispose(); | |
- } else if (myRepositoryPool != null) { | |
+ if (myRepositoryPool != null) { | |
myRepositoryPool.dispose(); | |
} | |
} | |
@@ -300,9 +285,6 @@ | |
* @return a run-time options driver | |
*/ | |
public ISVNOptions getOptions() { | |
- if (myOperationFactory != null) { | |
- return myOperationFactory.getOptions(); | |
- } | |
return myOptions; | |
} | |
@@ -415,40 +397,36 @@ | |
* @param options run-time configuration options | |
*/ | |
public void setOptions(ISVNOptions options) { | |
- if (myOperationFactory != null) { | |
- myOperationFactory.setOptions(options); | |
- } else { | |
- myOptions = options; | |
- if (myCommitClient != null) { | |
- myCommitClient.setOptions(options); | |
- } | |
- if (myCopyClient != null) { | |
- myCopyClient.setOptions(options); | |
- } | |
- if (myDiffClient != null) { | |
- myDiffClient.setOptions(options); | |
- } | |
- if (myLogClient != null) { | |
- myLogClient.setOptions(options); | |
- } | |
- if (myMoveClient != null) { | |
- myMoveClient.setOptions(options); | |
- } | |
- if (myStatusClient != null) { | |
- myStatusClient.setOptions(options); | |
- } | |
- if (myUpdateClient != null) { | |
- myUpdateClient.setOptions(options); | |
- } | |
- if (myWCClient != null) { | |
- myWCClient.setOptions(options); | |
- } | |
- if (myAdminClient != null) { | |
- myAdminClient.setOptions(options); | |
- } | |
- if (myLookClient != null) { | |
- myLookClient.setOptions(options); | |
- } | |
+ myOptions = options; | |
+ if (myCommitClient != null) { | |
+ myCommitClient.setOptions(options); | |
+ } | |
+ if (myCopyClient != null) { | |
+ myCopyClient.setOptions(options); | |
+ } | |
+ if (myDiffClient != null) { | |
+ myDiffClient.setOptions(options); | |
+ } | |
+ if (myLogClient != null) { | |
+ myLogClient.setOptions(options); | |
+ } | |
+ if (myMoveClient != null) { | |
+ myMoveClient.setOptions(options); | |
+ } | |
+ if (myStatusClient != null) { | |
+ myStatusClient.setOptions(options); | |
+ } | |
+ if (myUpdateClient != null) { | |
+ myUpdateClient.setOptions(options); | |
+ } | |
+ if (myWCClient != null) { | |
+ myWCClient.setOptions(options); | |
+ } | |
+ if (myAdminClient != null) { | |
+ myAdminClient.setOptions(options); | |
+ } | |
+ if (myLookClient != null) { | |
+ myLookClient.setOptions(options); | |
} | |
} | |
@@ -466,7 +444,7 @@ | |
*/ | |
public SVNCommitClient getCommitClient() { | |
if (myCommitClient == null) { | |
- myCommitClient = myOperationFactory != null ? new SVNCommitClient(myOperationFactory) : new SVNCommitClient(this, myOptions); | |
+ myCommitClient = new SVNCommitClient(this, myOptions); | |
myCommitClient.setEventHandler(myEventHandler); | |
myCommitClient.setDebugLog(getDebugLog()); | |
myCommitClient.setIgnoreExternals(myIsIgnoreExternals); | |
@@ -488,8 +466,9 @@ | |
*/ | |
public SVNAdminClient getAdminClient() { | |
if (myAdminClient == null) { | |
- myAdminClient = myOperationFactory != null ? new SVNAdminClient(myOperationFactory) : new SVNAdminClient(this, myOptions); | |
- initClientDefaults(myAdminClient); | |
+ myAdminClient = new SVNAdminClient(this, myOptions); | |
+ myAdminClient.setEventHandler(myEventHandler); | |
+ myAdminClient.setDebugLog(getDebugLog()); | |
} | |
return myAdminClient; | |
} | |
@@ -508,8 +487,9 @@ | |
*/ | |
public SVNLookClient getLookClient() { | |
if (myLookClient == null) { | |
- myLookClient = myOperationFactory != null ? new SVNLookClient(myOperationFactory) : new SVNLookClient(this, myOptions); | |
- initClientDefaults(myLookClient); | |
+ myLookClient = new SVNLookClient(this, myOptions); | |
+ myLookClient.setEventHandler(myEventHandler); | |
+ myLookClient.setDebugLog(getDebugLog()); | |
} | |
return myLookClient; | |
} | |
@@ -528,8 +508,10 @@ | |
*/ | |
public SVNCopyClient getCopyClient() { | |
if (myCopyClient == null) { | |
- myCopyClient = myOperationFactory != null ? new SVNCopyClient(myOperationFactory) : new SVNCopyClient(this, myOptions); | |
- initClientDefaults(myCopyClient); | |
+ myCopyClient = new SVNCopyClient(this, myOptions); | |
+ myCopyClient.setEventHandler(myEventHandler); | |
+ myCopyClient.setDebugLog(getDebugLog()); | |
+ myCopyClient.setIgnoreExternals(myIsIgnoreExternals); | |
} | |
return myCopyClient; | |
} | |
@@ -548,8 +530,10 @@ | |
*/ | |
public SVNDiffClient getDiffClient() { | |
if (myDiffClient == null) { | |
- myDiffClient = myOperationFactory != null ? new SVNDiffClient(myOperationFactory) : new SVNDiffClient(this, myOptions); | |
- initClientDefaults(myDiffClient); | |
+ myDiffClient = new SVNDiffClient(this, myOptions); | |
+ myDiffClient.setEventHandler(myEventHandler); | |
+ myDiffClient.setDebugLog(getDebugLog()); | |
+ myDiffClient.setIgnoreExternals(myIsIgnoreExternals); | |
} | |
return myDiffClient; | |
} | |
@@ -569,8 +553,10 @@ | |
*/ | |
public SVNLogClient getLogClient() { | |
if (myLogClient == null) { | |
- myLogClient = myOperationFactory != null ? new SVNLogClient(myOperationFactory) : new SVNLogClient(this, myOptions); | |
- initClientDefaults(myLogClient); | |
+ myLogClient = new SVNLogClient(this, myOptions); | |
+ myLogClient.setEventHandler(myEventHandler); | |
+ myLogClient.setDebugLog(getDebugLog()); | |
+ myLogClient.setIgnoreExternals(myIsIgnoreExternals); | |
} | |
return myLogClient; | |
} | |
@@ -589,8 +575,10 @@ | |
*/ | |
public SVNMoveClient getMoveClient() { | |
if (myMoveClient == null) { | |
- myMoveClient = myOperationFactory != null ? new SVNMoveClient(myOperationFactory) : new SVNMoveClient(this, myOptions); | |
- initClientDefaults(myMoveClient); | |
+ myMoveClient = new SVNMoveClient(this, myOptions); | |
+ myMoveClient.setEventHandler(myEventHandler); | |
+ myMoveClient.setDebugLog(getDebugLog()); | |
+ myMoveClient.setIgnoreExternals(myIsIgnoreExternals); | |
} | |
return myMoveClient; | |
} | |
@@ -609,8 +597,10 @@ | |
*/ | |
public SVNStatusClient getStatusClient() { | |
if (myStatusClient == null) { | |
- myStatusClient = myOperationFactory != null ? new SVNStatusClient(myOperationFactory) : new SVNStatusClient(this, myOptions); | |
- initClientDefaults(myStatusClient); | |
+ myStatusClient = new SVNStatusClient(this, myOptions); | |
+ myStatusClient.setEventHandler(myEventHandler); | |
+ myStatusClient.setDebugLog(getDebugLog()); | |
+ myStatusClient.setIgnoreExternals(myIsIgnoreExternals); | |
} | |
return myStatusClient; | |
} | |
@@ -629,8 +619,10 @@ | |
*/ | |
public SVNUpdateClient getUpdateClient() { | |
if (myUpdateClient == null) { | |
- myUpdateClient = myOperationFactory != null ? new SVNUpdateClient(myOperationFactory) : new SVNUpdateClient(this, myOptions); | |
- initClientDefaults(myUpdateClient); | |
+ myUpdateClient = new SVNUpdateClient(this, myOptions); | |
+ myUpdateClient.setEventHandler(myEventHandler); | |
+ myUpdateClient.setDebugLog(getDebugLog()); | |
+ myUpdateClient.setIgnoreExternals(myIsIgnoreExternals); | |
} | |
return myUpdateClient; | |
} | |
@@ -649,8 +641,10 @@ | |
*/ | |
public SVNWCClient getWCClient() { | |
if (myWCClient == null) { | |
- myWCClient = myOperationFactory != null ? new SVNWCClient(myOperationFactory) : new SVNWCClient(this, myOptions); | |
- initClientDefaults(myWCClient); | |
+ myWCClient = new SVNWCClient(this, myOptions); | |
+ myWCClient.setEventHandler(myEventHandler); | |
+ myWCClient.setDebugLog(getDebugLog()); | |
+ myWCClient.setIgnoreExternals(myIsIgnoreExternals); | |
} | |
return myWCClient; | |
} | |
@@ -670,23 +664,14 @@ | |
*/ | |
public SVNChangelistClient getChangelistClient() { | |
if (myChangelistClient == null) { | |
- myChangelistClient = myOperationFactory != null ? new SVNChangelistClient(myOperationFactory) : new SVNChangelistClient(this, myOptions); | |
- initClientDefaults(myChangelistClient); | |
+ myChangelistClient = new SVNChangelistClient(this, myOptions); | |
+ myChangelistClient.setEventHandler(myEventHandler); | |
+ myChangelistClient.setDebugLog(getDebugLog()); | |
+ myChangelistClient.setIgnoreExternals(myIsIgnoreExternals); | |
} | |
return myChangelistClient; | |
} | |
- | |
- protected void initClientDefaults(SVNBasicClient client) { | |
- client.setEventHandler(myEventHandler); | |
- client.setDebugLog(getDebugLog()); | |
- client.setIgnoreExternals(myIsIgnoreExternals); | |
- } | |
- | |
- protected void initClientDefaults(SVNAdminBasicClient client) { | |
- client.setEventHandler(myEventHandler); | |
- client.setDebugLog(getDebugLog()); | |
- } | |
- | |
+ | |
/** | |
* Returns the debug logger currently in use. | |
* | |
@@ -760,9 +745,7 @@ | |
* @param authManager user's implementation of the authentication manager interface | |
*/ | |
public void setAuthenticationManager(ISVNAuthenticationManager authManager) { | |
- if (myOperationFactory != null) { | |
- myOperationFactory.setAuthenticationManager(authManager); | |
- } else if (myRepositoryPool != null) { | |
+ if (myRepositoryPool != null) { | |
myRepositoryPool.setAuthenticationManager(authManager); | |
} | |
} | |
@@ -775,9 +758,7 @@ | |
* @since 1.2.0 | |
*/ | |
public void setCanceller(ISVNCanceller canceller) { | |
- if (myOperationFactory != null) { | |
- myOperationFactory.setCanceller(canceller); | |
- } else if (myRepositoryPool != null) { | |
+ if (myRepositoryPool != null) { | |
myRepositoryPool.setCanceller(canceller); | |
} | |
} | |
@@ -791,13 +772,6 @@ | |
* @since 1.2.0 | |
*/ | |
public ISVNRepositoryPool getRepositoryPool() { | |
- if (myOperationFactory != null) { | |
- return myOperationFactory.getRepositoryPool(); | |
- } | |
return myRepositoryPool; | |
} | |
- | |
- public SvnOperationFactory getOperationFactory() { | |
- return myOperationFactory; | |
- } | |
} | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNCommitClient.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNCommitClient.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNCommitClient.java 2014-07-01 03:14:30.009130640 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNCommitClient.java 2014-07-01 03:13:45.932132375 +0000 | |
@@ -29,7 +29,13 @@ | |
import org.tmatesoft.svn.core.internal.wc2.compat.SvnCodec; | |
import org.tmatesoft.svn.core.internal.wc2.compat.SvnCodec.SVNCommitPacketWrapper; | |
import org.tmatesoft.svn.core.io.SVNRepository; | |
-import org.tmatesoft.svn.core.wc2.*; | |
+import org.tmatesoft.svn.core.wc2.ISvnObjectReceiver; | |
+import org.tmatesoft.svn.core.wc2.SvnCommit; | |
+import org.tmatesoft.svn.core.wc2.SvnCommitPacket; | |
+import org.tmatesoft.svn.core.wc2.SvnImport; | |
+import org.tmatesoft.svn.core.wc2.SvnRemoteDelete; | |
+import org.tmatesoft.svn.core.wc2.SvnRemoteMkDir; | |
+import org.tmatesoft.svn.core.wc2.SvnTarget; | |
import org.tmatesoft.svn.util.SVNLogType; | |
/** | |
@@ -131,13 +137,6 @@ | |
*/ | |
public SVNCommitClient(ISVNRepositoryPool repositoryPool, ISVNOptions options) { | |
super(repositoryPool, options); | |
- } | |
- | |
- public SVNCommitClient(SvnOperationFactory of) { | |
- super(of); | |
- } | |
- | |
- protected void initDefaults() { | |
setCommitHander(null); | |
setCommitParameters(null); | |
setCommitHandler(null); | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNCopyClient.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNCopyClient.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNCopyClient.java 2014-07-01 03:14:29.998130544 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNCopyClient.java 2014-07-01 03:13:45.934132219 +0000 | |
@@ -25,7 +25,6 @@ | |
import org.tmatesoft.svn.core.internal.wc2.compat.SvnCodec; | |
import org.tmatesoft.svn.core.io.SVNRepository; | |
import org.tmatesoft.svn.core.wc2.SvnCopy; | |
-import org.tmatesoft.svn.core.wc2.SvnOperationFactory; | |
import org.tmatesoft.svn.core.wc2.SvnRemoteCopy; | |
import org.tmatesoft.svn.core.wc2.SvnTarget; | |
@@ -114,6 +113,9 @@ | |
*/ | |
public SVNCopyClient(ISVNAuthenticationManager authManager, ISVNOptions options) { | |
super(authManager, options); | |
+ setCommitParameters(null); | |
+ setCommitHandler(null); | |
+ setExternalsHandler(null); | |
} | |
/** | |
@@ -139,13 +141,6 @@ | |
*/ | |
public SVNCopyClient(ISVNRepositoryPool repositoryPool, ISVNOptions options) { | |
super(repositoryPool, options); | |
- } | |
- | |
- public SVNCopyClient(SvnOperationFactory of) { | |
- super(of); | |
- } | |
- | |
- protected void initDefaults() { | |
setCommitParameters(null); | |
setCommitHandler(null); | |
setExternalsHandler(null); | |
@@ -352,21 +347,21 @@ | |
/** | |
* Copies each source in <code>sources</code> to <code>dst</code>. | |
- * | |
+ * | |
* <p/> | |
* If multiple <code>sources</code> are given, <code>dst</code> must be a | |
* directory, and <code>sources</code> will be copied as children of | |
* <code>dst</code>. | |
- * | |
+ * | |
* <p/> | |
* Each <code>src</code> in <code>sources</code> must be files or | |
* directories under version control, or URLs of a versioned item in the | |
* repository. If <code>sources</code> has multiple items, they must be all | |
* repository URLs or all working copy paths. | |
- * | |
+ * | |
* <p/> | |
* The parent of <code>dst</code> must already exist. | |
- * | |
+ * | |
* <p/> | |
* If <code>sources</code> has only one item, attempts to copy it to | |
* <code>dst</code>. If <code>failWhenDstExists</code> is <span | |
@@ -620,4 +615,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_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNDiffClient.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNDiffClient.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNDiffClient.java 2014-07-01 03:14:30.356130472 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNDiffClient.java 2014-07-01 03:12:33.604138591 +0000 | |
@@ -30,7 +30,14 @@ | |
import org.tmatesoft.svn.core.internal.wc.SVNErrorManager; | |
import org.tmatesoft.svn.core.internal.wc2.compat.SvnCodec; | |
import org.tmatesoft.svn.core.io.SVNRepository; | |
-import org.tmatesoft.svn.core.wc2.*; | |
+import org.tmatesoft.svn.core.wc2.ISvnObjectReceiver; | |
+import org.tmatesoft.svn.core.wc2.SvnDiff; | |
+import org.tmatesoft.svn.core.wc2.SvnDiffSummarize; | |
+import org.tmatesoft.svn.core.wc2.SvnGetMergeInfo; | |
+import org.tmatesoft.svn.core.wc2.SvnLogMergeInfo; | |
+import org.tmatesoft.svn.core.wc2.SvnMerge; | |
+import org.tmatesoft.svn.core.wc2.SvnSuggestMergeSources; | |
+import org.tmatesoft.svn.core.wc2.SvnTarget; | |
import org.tmatesoft.svn.util.SVNLogType; | |
/** | |
@@ -103,6 +110,8 @@ | |
*/ | |
public SVNDiffClient(ISVNAuthenticationManager authManager, ISVNOptions options) { | |
super(authManager, options); | |
+ setDiffGenerator(null); | |
+ setMergeOptions(null); | |
} | |
/** | |
@@ -128,13 +137,6 @@ | |
*/ | |
public SVNDiffClient(ISVNRepositoryPool repositoryPool, ISVNOptions options) { | |
super(repositoryPool, options); | |
- } | |
- | |
- public SVNDiffClient(SvnOperationFactory of) { | |
- super(of); | |
- } | |
- | |
- protected void initDefaults() { | |
setDiffGenerator(null); | |
setMergeOptions(null); | |
} | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNEvent.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNEvent.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNEvent.java 2014-07-01 03:14:30.001130228 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNEvent.java 2014-07-01 03:12:33.605138921 +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_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNLogClient.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNLogClient.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNLogClient.java 2014-07-01 03:14:29.948129777 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNLogClient.java 2014-07-01 03:13:45.936133488 +0000 | |
@@ -26,7 +26,12 @@ | |
import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager; | |
import org.tmatesoft.svn.core.internal.wc2.compat.SvnCodec; | |
import org.tmatesoft.svn.core.io.SVNRepository; | |
-import org.tmatesoft.svn.core.wc2.*; | |
+import org.tmatesoft.svn.core.wc2.ISvnObjectReceiver; | |
+import org.tmatesoft.svn.core.wc2.SvnAnnotate; | |
+import org.tmatesoft.svn.core.wc2.SvnList; | |
+import org.tmatesoft.svn.core.wc2.SvnLog; | |
+import org.tmatesoft.svn.core.wc2.SvnRevisionRange; | |
+import org.tmatesoft.svn.core.wc2.SvnTarget; | |
/** | |
* The <b>SVNLogClient</b> class is intended for such purposes as getting | |
@@ -89,6 +94,7 @@ | |
*/ | |
public SVNLogClient(ISVNAuthenticationManager authManager, ISVNOptions options) { | |
super(authManager, options); | |
+ setDiffOptions(null); | |
} | |
/** | |
@@ -114,13 +120,6 @@ | |
*/ | |
public SVNLogClient(ISVNRepositoryPool repositoryPool, ISVNOptions options) { | |
super(repositoryPool, options); | |
- } | |
- | |
- public SVNLogClient(SvnOperationFactory of) { | |
- super(of); | |
- } | |
- | |
- protected void initDefaults() { | |
setDiffOptions(null); | |
} | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNMoveClient.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNMoveClient.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNMoveClient.java 2014-07-01 03:14:29.995130589 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNMoveClient.java 2014-07-01 03:12:33.607138264 +0000 | |
@@ -103,10 +103,11 @@ | |
*/ | |
public SVNMoveClient(ISVNRepositoryPool repositoryPool, ISVNOptions options) { | |
super(repositoryPool, options); | |
- } | |
+ setDebugLog(null); | |
+ setOptions(null); | |
+ setEventHandler(null); | |
- public SVNMoveClient(SvnOperationFactory of) { | |
- super(of); | |
+ setOptions(options); | |
} | |
/** | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNStatusClient.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNStatusClient.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNStatusClient.java 2014-07-01 03:14:30.006129867 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNStatusClient.java 2014-07-01 03:12:33.609138262 +0000 | |
@@ -20,7 +20,10 @@ | |
import org.tmatesoft.svn.core.internal.wc17.SVNWCContext; | |
import org.tmatesoft.svn.core.internal.wc2.compat.SvnCodec; | |
import org.tmatesoft.svn.core.io.SVNRepository; | |
-import org.tmatesoft.svn.core.wc2.*; | |
+import org.tmatesoft.svn.core.wc2.ISvnObjectReceiver; | |
+import org.tmatesoft.svn.core.wc2.SvnGetStatus; | |
+import org.tmatesoft.svn.core.wc2.SvnStatus; | |
+import org.tmatesoft.svn.core.wc2.SvnTarget; | |
/** | |
* The <b>SVNStatusClient</b> class provides methods for obtaining information | |
@@ -83,6 +86,7 @@ | |
*/ | |
public SVNStatusClient(ISVNAuthenticationManager authManager, ISVNOptions options) { | |
super(authManager, options); | |
+ setFilesProvider(null); | |
} | |
/** | |
@@ -109,13 +113,6 @@ | |
public SVNStatusClient(ISVNRepositoryPool repositoryPool, ISVNOptions options) { | |
super(repositoryPool, options); | |
- } | |
- | |
- public SVNStatusClient(SvnOperationFactory of) { | |
- super(of); | |
- } | |
- | |
- protected void initDefaults() { | |
setFilesProvider(null); | |
} | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNUpdateClient.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNUpdateClient.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNUpdateClient.java 2014-07-01 03:14:30.003130161 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNUpdateClient.java 2014-07-01 03:12:33.610138227 +0000 | |
@@ -20,7 +20,13 @@ | |
import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager; | |
import org.tmatesoft.svn.core.internal.wc2.compat.SvnCodec; | |
import org.tmatesoft.svn.core.io.SVNRepository; | |
-import org.tmatesoft.svn.core.wc2.*; | |
+import org.tmatesoft.svn.core.wc2.SvnCanonicalizeUrls; | |
+import org.tmatesoft.svn.core.wc2.SvnCheckout; | |
+import org.tmatesoft.svn.core.wc2.SvnExport; | |
+import org.tmatesoft.svn.core.wc2.SvnRelocate; | |
+import org.tmatesoft.svn.core.wc2.SvnSwitch; | |
+import org.tmatesoft.svn.core.wc2.SvnTarget; | |
+import org.tmatesoft.svn.core.wc2.SvnUpdate; | |
/** | |
* This class provides methods which allow to check out, update, switch and | |
@@ -95,6 +101,7 @@ | |
*/ | |
public SVNUpdateClient(ISVNAuthenticationManager authManager, ISVNOptions options) { | |
super(authManager, options); | |
+ setExternalsHandler(null); | |
} | |
/** | |
@@ -120,13 +127,6 @@ | |
*/ | |
public SVNUpdateClient(ISVNRepositoryPool repositoryPool, ISVNOptions options) { | |
super(repositoryPool, options); | |
- } | |
- | |
- public SVNUpdateClient(SvnOperationFactory of) { | |
- super(of); | |
- } | |
- | |
- protected void initDefaults() { | |
setExternalsHandler(null); | |
} | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNWCClient.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNWCClient.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNWCClient.java 2014-07-01 03:14:29.965130338 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/wc/SVNWCClient.java 2014-07-01 03:13:45.938133436 +0000 | |
@@ -29,7 +29,25 @@ | |
import org.tmatesoft.svn.core.internal.wc16.SVNWCClient16; | |
import org.tmatesoft.svn.core.internal.wc2.compat.SvnCodec; | |
import org.tmatesoft.svn.core.io.SVNRepository; | |
-import org.tmatesoft.svn.core.wc2.*; | |
+import org.tmatesoft.svn.core.wc2.ISvnObjectReceiver; | |
+import org.tmatesoft.svn.core.wc2.SvnCat; | |
+import org.tmatesoft.svn.core.wc2.SvnCleanup; | |
+import org.tmatesoft.svn.core.wc2.SvnGetInfo; | |
+import org.tmatesoft.svn.core.wc2.SvnGetProperties; | |
+import org.tmatesoft.svn.core.wc2.SvnGetStatusSummary; | |
+import org.tmatesoft.svn.core.wc2.SvnInfo; | |
+import org.tmatesoft.svn.core.wc2.SvnMarkReplaced; | |
+import org.tmatesoft.svn.core.wc2.SvnRemoteSetProperty; | |
+import org.tmatesoft.svn.core.wc2.SvnResolve; | |
+import org.tmatesoft.svn.core.wc2.SvnRevert; | |
+import org.tmatesoft.svn.core.wc2.SvnScheduleForAddition; | |
+import org.tmatesoft.svn.core.wc2.SvnScheduleForRemoval; | |
+import org.tmatesoft.svn.core.wc2.SvnSetLock; | |
+import org.tmatesoft.svn.core.wc2.SvnSetProperty; | |
+import org.tmatesoft.svn.core.wc2.SvnStatusSummary; | |
+import org.tmatesoft.svn.core.wc2.SvnTarget; | |
+import org.tmatesoft.svn.core.wc2.SvnUnlock; | |
+import org.tmatesoft.svn.core.wc2.SvnUpgrade; | |
/** | |
* The <b>SVNWCClient</b> class combines a number of version control operations | |
@@ -165,6 +183,8 @@ | |
*/ | |
public SVNWCClient(ISVNAuthenticationManager authManager, ISVNOptions options) { | |
super(authManager, options); | |
+ setCommitHandler(null); | |
+ setAddParameters(null); | |
} | |
/** | |
@@ -190,13 +210,6 @@ | |
*/ | |
public SVNWCClient(ISVNRepositoryPool repositoryPool, ISVNOptions options) { | |
super(repositoryPool, options); | |
- } | |
- | |
- public SVNWCClient(SvnOperationFactory of) { | |
- super(of); | |
- } | |
- | |
- protected void initDefaults() { | |
setCommitHandler(null); | |
setAddParameters(null); | |
} | |
@@ -2570,7 +2583,7 @@ | |
* @since 1.2 | |
*/ | |
public void doSetWCFormat(File directory, int format) throws SVNException { | |
- if (format >= 12) { | |
+ if (format == 12) { | |
SvnUpgrade upgrade = getOperationsFactory().createUpgrade(); | |
upgrade.setSingleTarget(SvnTarget.fromFile(directory)); | |
upgrade.setDepth(SVNDepth.INFINITY); | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/wc/admin/SVNAdminBasicClient.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/wc/admin/SVNAdminBasicClient.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/wc/admin/SVNAdminBasicClient.java 2014-07-01 03:14:30.029129356 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/wc/admin/SVNAdminBasicClient.java 2014-07-01 03:12:33.613138152 +0000 | |
@@ -15,7 +15,6 @@ | |
import org.tmatesoft.svn.core.wc.ISVNRepositoryPool; | |
import org.tmatesoft.svn.core.wc.SVNEvent; | |
import org.tmatesoft.svn.core.wc.SVNWCUtil; | |
-import org.tmatesoft.svn.core.wc2.SvnOperationFactory; | |
import org.tmatesoft.svn.util.ISVNDebugLog; | |
import org.tmatesoft.svn.util.SVNDebugLog; | |
import org.tmatesoft.svn.util.SVNLogType; | |
@@ -127,7 +126,8 @@ | |
return myEventDispatcher; | |
} | |
- protected SVNAdminBasicClient(final ISVNAuthenticationManager authManager, ISVNOptions options) { | |
+ protected SVNAdminBasicClient(final ISVNAuthenticationManager authManager, | |
+ ISVNOptions options) { | |
this(new DefaultSVNRepositoryPool(authManager == null ? SVNWCUtil | |
.createDefaultAuthenticationManager() : authManager, options, | |
0, false), options); | |
@@ -139,11 +139,6 @@ | |
setOptions(options); | |
} | |
- protected SVNAdminBasicClient(SvnOperationFactory of) { | |
- myRepositoryPool = of.getRepositoryPool(); | |
- setOptions(of.getOptions()); | |
- } | |
- | |
/** | |
* Sets run-time global configuration options to this object. | |
* @param options the run-time configuration options | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/wc/admin/SVNAdminClient.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/wc/admin/SVNAdminClient.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/wc/admin/SVNAdminClient.java 2014-07-01 03:14:30.026130155 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/wc/admin/SVNAdminClient.java 2014-07-01 03:12:33.614138274 +0000 | |
@@ -71,7 +71,6 @@ | |
import org.tmatesoft.svn.core.wc.ISVNOptions; | |
import org.tmatesoft.svn.core.wc.ISVNRepositoryPool; | |
import org.tmatesoft.svn.core.wc.SVNRevision; | |
-import org.tmatesoft.svn.core.wc2.SvnOperationFactory; | |
import org.tmatesoft.svn.util.SVNDebugLog; | |
import org.tmatesoft.svn.util.SVNLogType; | |
@@ -160,10 +159,6 @@ | |
super(repositoryPool, options); | |
} | |
- public SVNAdminClient(SvnOperationFactory of) { | |
- super(of); | |
- } | |
- | |
/** | |
* Sets a replication handler that will receive a log entry object | |
* per each replayed revision. | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/wc/admin/SVNLookClient.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/wc/admin/SVNLookClient.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/wc/admin/SVNLookClient.java 2014-07-01 03:14:30.039130646 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/wc/admin/SVNLookClient.java 2014-07-01 03:13:45.938133436 +0000 | |
@@ -49,7 +49,6 @@ | |
import org.tmatesoft.svn.core.wc.ISVNOptions; | |
import org.tmatesoft.svn.core.wc.ISVNRepositoryPool; | |
import org.tmatesoft.svn.core.wc.SVNRevision; | |
-import org.tmatesoft.svn.core.wc2.SvnOperationFactory; | |
import org.tmatesoft.svn.util.SVNLogType; | |
/** | |
@@ -151,10 +150,6 @@ | |
super(repositoryPool, options); | |
} | |
- public SVNLookClient(SvnOperationFactory of) { | |
- super(of); | |
- } | |
- | |
/** | |
* Retrieves author, timestamp and log message information from | |
* the repository for the given revision. This information is | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/wc2/SvnOperationFactory.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/wc2/SvnOperationFactory.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/wc2/SvnOperationFactory.java 2014-07-01 03:14:28.880131460 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/wc2/SvnOperationFactory.java 2014-07-01 03:13:45.942133431 +0000 | |
@@ -43,79 +43,9 @@ | |
import org.tmatesoft.svn.core.internal.wc17.db.SVNWCDbRoot; | |
import org.tmatesoft.svn.core.internal.wc17.db.SvnWcDbPristines; | |
import org.tmatesoft.svn.core.internal.wc2.ISvnCommitRunner; | |
-import org.tmatesoft.svn.core.internal.wc2.SvnOperationRunner; | |
import org.tmatesoft.svn.core.internal.wc2.SvnWcGeneration; | |
-import org.tmatesoft.svn.core.internal.wc2.admin.SvnRepositoryCatImpl; | |
-import org.tmatesoft.svn.core.internal.wc2.admin.SvnRepositoryCopyRevisionPropertiesImpl; | |
-import org.tmatesoft.svn.core.internal.wc2.admin.SvnRepositoryCreateImpl; | |
-import org.tmatesoft.svn.core.internal.wc2.admin.SvnRepositoryDumpImpl; | |
-import org.tmatesoft.svn.core.internal.wc2.admin.SvnRepositoryFilterImpl; | |
-import org.tmatesoft.svn.core.internal.wc2.admin.SvnRepositoryGetAuthorImpl; | |
-import org.tmatesoft.svn.core.internal.wc2.admin.SvnRepositoryGetChangedDirectoriesImpl; | |
-import org.tmatesoft.svn.core.internal.wc2.admin.SvnRepositoryGetChangedImpl; | |
-import org.tmatesoft.svn.core.internal.wc2.admin.SvnRepositoryGetDateImpl; | |
-import org.tmatesoft.svn.core.internal.wc2.admin.SvnRepositoryGetDiffImpl; | |
-import org.tmatesoft.svn.core.internal.wc2.admin.SvnRepositoryGetFileSizeImpl; | |
-import org.tmatesoft.svn.core.internal.wc2.admin.SvnRepositoryGetHistoryImpl; | |
-import org.tmatesoft.svn.core.internal.wc2.admin.SvnRepositoryGetInfoImpl; | |
-import org.tmatesoft.svn.core.internal.wc2.admin.SvnRepositoryGetLockImpl; | |
-import org.tmatesoft.svn.core.internal.wc2.admin.SvnRepositoryGetLogImpl; | |
-import org.tmatesoft.svn.core.internal.wc2.admin.SvnRepositoryGetPropertiesImpl; | |
-import org.tmatesoft.svn.core.internal.wc2.admin.SvnRepositoryGetPropertyImpl; | |
-import org.tmatesoft.svn.core.internal.wc2.admin.SvnRepositoryGetRevisionPropertiesImpl; | |
-import org.tmatesoft.svn.core.internal.wc2.admin.SvnRepositoryGetRevisionPropertyImpl; | |
-import org.tmatesoft.svn.core.internal.wc2.admin.SvnRepositoryGetTreeImpl; | |
-import org.tmatesoft.svn.core.internal.wc2.admin.SvnRepositoryGetUUIDImpl; | |
-import org.tmatesoft.svn.core.internal.wc2.admin.SvnRepositoryGetYoungestImpl; | |
-import org.tmatesoft.svn.core.internal.wc2.admin.SvnRepositoryHotCopyImpl; | |
-import org.tmatesoft.svn.core.internal.wc2.admin.SvnRepositoryInitializeImpl; | |
-import org.tmatesoft.svn.core.internal.wc2.admin.SvnRepositoryListLocksImpl; | |
-import org.tmatesoft.svn.core.internal.wc2.admin.SvnRepositoryListTransactionsImpl; | |
-import org.tmatesoft.svn.core.internal.wc2.admin.SvnRepositoryLoadImpl; | |
-import org.tmatesoft.svn.core.internal.wc2.admin.SvnRepositoryPackImpl; | |
-import org.tmatesoft.svn.core.internal.wc2.admin.SvnRepositoryRecoverImpl; | |
-import org.tmatesoft.svn.core.internal.wc2.admin.SvnRepositoryRemoveLocksImpl; | |
-import org.tmatesoft.svn.core.internal.wc2.admin.SvnRepositoryRemoveTransactionsImpl; | |
-import org.tmatesoft.svn.core.internal.wc2.admin.SvnRepositorySetUUIDImpl; | |
-import org.tmatesoft.svn.core.internal.wc2.admin.SvnRepositorySyncInfoImpl; | |
-import org.tmatesoft.svn.core.internal.wc2.admin.SvnRepositorySynchronizeImpl; | |
-import org.tmatesoft.svn.core.internal.wc2.admin.SvnRepositoryUpgradeImpl; | |
-import org.tmatesoft.svn.core.internal.wc2.admin.SvnRepositoryVerifyImpl; | |
-import org.tmatesoft.svn.core.internal.wc2.ng.SvnNgAdd; | |
-import org.tmatesoft.svn.core.internal.wc2.ng.SvnNgCanonicalizeUrls; | |
-import org.tmatesoft.svn.core.internal.wc2.ng.SvnNgCat; | |
-import org.tmatesoft.svn.core.internal.wc2.ng.SvnNgCheckout; | |
-import org.tmatesoft.svn.core.internal.wc2.ng.SvnNgCleanup; | |
-import org.tmatesoft.svn.core.internal.wc2.ng.SvnNgCommit; | |
-import org.tmatesoft.svn.core.internal.wc2.ng.SvnNgDiff; | |
-import org.tmatesoft.svn.core.internal.wc2.ng.SvnNgDiffSummarize; | |
-import org.tmatesoft.svn.core.internal.wc2.ng.SvnNgExport; | |
-import org.tmatesoft.svn.core.internal.wc2.ng.SvnNgGetChangelistPaths; | |
-import org.tmatesoft.svn.core.internal.wc2.ng.SvnNgGetInfo; | |
-import org.tmatesoft.svn.core.internal.wc2.ng.SvnNgGetMergeInfo; | |
-import org.tmatesoft.svn.core.internal.wc2.ng.SvnNgGetProperties; | |
-import org.tmatesoft.svn.core.internal.wc2.ng.SvnNgGetStatus; | |
-import org.tmatesoft.svn.core.internal.wc2.ng.SvnNgGetStatusSummary; | |
-import org.tmatesoft.svn.core.internal.wc2.ng.SvnNgLogMergeInfo; | |
-import org.tmatesoft.svn.core.internal.wc2.ng.SvnNgMarkReplaced; | |
-import org.tmatesoft.svn.core.internal.wc2.ng.SvnNgMerge; | |
-import org.tmatesoft.svn.core.internal.wc2.ng.SvnNgMergePegged; | |
-import org.tmatesoft.svn.core.internal.wc2.ng.SvnNgMergeReintegrate; | |
-import org.tmatesoft.svn.core.internal.wc2.ng.SvnNgRelocate; | |
-import org.tmatesoft.svn.core.internal.wc2.ng.SvnNgRemove; | |
-import org.tmatesoft.svn.core.internal.wc2.ng.SvnNgReposToWcCopy; | |
-import org.tmatesoft.svn.core.internal.wc2.ng.SvnNgResolve; | |
-import org.tmatesoft.svn.core.internal.wc2.ng.SvnNgRevert; | |
-import org.tmatesoft.svn.core.internal.wc2.ng.SvnNgSetChangelist; | |
-import org.tmatesoft.svn.core.internal.wc2.ng.SvnNgSetLock; | |
-import org.tmatesoft.svn.core.internal.wc2.ng.SvnNgSetProperty; | |
-import org.tmatesoft.svn.core.internal.wc2.ng.SvnNgSuggestMergeSources; | |
-import org.tmatesoft.svn.core.internal.wc2.ng.SvnNgSwitch; | |
-import org.tmatesoft.svn.core.internal.wc2.ng.SvnNgUnlock; | |
-import org.tmatesoft.svn.core.internal.wc2.ng.SvnNgUpdate; | |
-import org.tmatesoft.svn.core.internal.wc2.ng.SvnNgUpgrade; | |
-import org.tmatesoft.svn.core.internal.wc2.ng.SvnNgWcToReposCopy; | |
-import org.tmatesoft.svn.core.internal.wc2.ng.SvnNgWcToWcCopy; | |
+import org.tmatesoft.svn.core.internal.wc2.admin.*; | |
+import org.tmatesoft.svn.core.internal.wc2.ng.*; | |
import org.tmatesoft.svn.core.internal.wc2.old.SvnOldAdd; | |
import org.tmatesoft.svn.core.internal.wc2.old.SvnOldAnnotate; | |
import org.tmatesoft.svn.core.internal.wc2.old.SvnOldCanonicalizeUrls; | |
@@ -133,7 +63,6 @@ | |
import org.tmatesoft.svn.core.internal.wc2.old.SvnOldGetStatus; | |
import org.tmatesoft.svn.core.internal.wc2.old.SvnOldGetStatusSummary; | |
import org.tmatesoft.svn.core.internal.wc2.old.SvnOldImport; | |
-import org.tmatesoft.svn.core.internal.wc2.old.SvnOldList; | |
import org.tmatesoft.svn.core.internal.wc2.old.SvnOldLogMergeInfo; | |
import org.tmatesoft.svn.core.internal.wc2.old.SvnOldMarkReplaced; | |
import org.tmatesoft.svn.core.internal.wc2.old.SvnOldMerge; | |
@@ -172,42 +101,7 @@ | |
import org.tmatesoft.svn.core.wc.ISVNRepositoryPool; | |
import org.tmatesoft.svn.core.wc.SVNEvent; | |
import org.tmatesoft.svn.core.wc.SVNWCUtil; | |
-import org.tmatesoft.svn.core.wc2.admin.SvnRepositoryCat; | |
-import org.tmatesoft.svn.core.wc2.admin.SvnRepositoryCopyRevisionProperties; | |
-import org.tmatesoft.svn.core.wc2.admin.SvnRepositoryCreate; | |
-import org.tmatesoft.svn.core.wc2.admin.SvnRepositoryDump; | |
-import org.tmatesoft.svn.core.wc2.admin.SvnRepositoryFilter; | |
-import org.tmatesoft.svn.core.wc2.admin.SvnRepositoryGetAuthor; | |
-import org.tmatesoft.svn.core.wc2.admin.SvnRepositoryGetChanged; | |
-import org.tmatesoft.svn.core.wc2.admin.SvnRepositoryGetChangedDirectories; | |
-import org.tmatesoft.svn.core.wc2.admin.SvnRepositoryGetDate; | |
-import org.tmatesoft.svn.core.wc2.admin.SvnRepositoryGetDiff; | |
-import org.tmatesoft.svn.core.wc2.admin.SvnRepositoryGetFileSize; | |
-import org.tmatesoft.svn.core.wc2.admin.SvnRepositoryGetHistory; | |
-import org.tmatesoft.svn.core.wc2.admin.SvnRepositoryGetInfo; | |
-import org.tmatesoft.svn.core.wc2.admin.SvnRepositoryGetLock; | |
-import org.tmatesoft.svn.core.wc2.admin.SvnRepositoryGetLog; | |
-import org.tmatesoft.svn.core.wc2.admin.SvnRepositoryGetProperties; | |
-import org.tmatesoft.svn.core.wc2.admin.SvnRepositoryGetProperty; | |
-import org.tmatesoft.svn.core.wc2.admin.SvnRepositoryGetRevisionProperties; | |
-import org.tmatesoft.svn.core.wc2.admin.SvnRepositoryGetRevisionProperty; | |
-import org.tmatesoft.svn.core.wc2.admin.SvnRepositoryGetTree; | |
-import org.tmatesoft.svn.core.wc2.admin.SvnRepositoryGetUUID; | |
-import org.tmatesoft.svn.core.wc2.admin.SvnRepositoryGetYoungest; | |
-import org.tmatesoft.svn.core.wc2.admin.SvnRepositoryHotCopy; | |
-import org.tmatesoft.svn.core.wc2.admin.SvnRepositoryInitialize; | |
-import org.tmatesoft.svn.core.wc2.admin.SvnRepositoryListLocks; | |
-import org.tmatesoft.svn.core.wc2.admin.SvnRepositoryListTransactions; | |
-import org.tmatesoft.svn.core.wc2.admin.SvnRepositoryLoad; | |
-import org.tmatesoft.svn.core.wc2.admin.SvnRepositoryPack; | |
-import org.tmatesoft.svn.core.wc2.admin.SvnRepositoryRecover; | |
-import org.tmatesoft.svn.core.wc2.admin.SvnRepositoryRemoveLocks; | |
-import org.tmatesoft.svn.core.wc2.admin.SvnRepositoryRemoveTransactions; | |
-import org.tmatesoft.svn.core.wc2.admin.SvnRepositorySetUUID; | |
-import org.tmatesoft.svn.core.wc2.admin.SvnRepositorySyncInfo; | |
-import org.tmatesoft.svn.core.wc2.admin.SvnRepositorySynchronize; | |
-import org.tmatesoft.svn.core.wc2.admin.SvnRepositoryUpgrade; | |
-import org.tmatesoft.svn.core.wc2.admin.SvnRepositoryVerify; | |
+import org.tmatesoft.svn.core.wc2.admin.*; | |
import org.tmatesoft.svn.util.SVNLogType; | |
/** | |
@@ -242,9 +136,6 @@ | |
private SvnWcGeneration primaryWcGeneration; | |
private int runLevel; | |
- | |
- private SvnWcGeneration detectedWcGeneration = SvnWcGeneration.NOT_DETECTED; | |
- private boolean isWcGenerationSticky; | |
/** | |
* Creates operation factory and initializes it with empty <code>context</code>. | |
@@ -382,9 +273,8 @@ | |
registerOperationRunner(SvnResolve.class, new SvnOldResolve()); | |
registerOperationRunner(SvnResolve.class, new SvnNgResolve()); | |
- registerOperationRunner(SvnList.class, new SvnOldList()); | |
registerOperationRunner(SvnList.class, new SvnRemoteList()); | |
- | |
+ | |
registerOperationRunner(SvnLogMergeInfo.class, new SvnOldLogMergeInfo()); | |
registerOperationRunner(SvnLogMergeInfo.class, new SvnNgLogMergeInfo()); | |
registerOperationRunner(SvnGetMergeInfo.class, new SvnOldGetMergeInfo()); | |
@@ -1319,31 +1209,14 @@ | |
SvnWcGeneration wcGeneration = SvnWcGeneration.NOT_DETECTED; | |
if (operation.getOperationalWorkingCopy() != null) { | |
- if (isWcGenerationSticky && detectedWcGeneration != SvnWcGeneration.NOT_DETECTED) { | |
- wcGeneration = detectedWcGeneration; | |
- } else { | |
- if (operation.getClass() == SvnCheckout.class) { | |
- if (SVNWCUtil.isVersionedDirectory(operation.getOperationalWorkingCopy())) { | |
- wcGeneration = detectWcGeneration(operation.getOperationalWorkingCopy(), false, isAdditionMode); | |
- } else { | |
- SvnCheckout checkout = (SvnCheckout) operation; | |
- final int targetWorkingCopyFormat = checkout.getTargetWorkingCopyFormat(); | |
- if (targetWorkingCopyFormat > 0) { | |
- if (targetWorkingCopyFormat >= SVNWCContext.WC_NG_VERSION) { | |
- wcGeneration = SvnWcGeneration.V17; | |
- } else { | |
- wcGeneration = SvnWcGeneration.V16; | |
- } | |
- } else { | |
- wcGeneration = getPrimaryWcGeneration(); | |
- } | |
- } | |
- } else { | |
- wcGeneration = detectWcGeneration(operation.getOperationalWorkingCopy(), false, isAdditionMode); | |
- } | |
- } | |
- if (isWcGenerationSticky && wcGeneration != SvnWcGeneration.NOT_DETECTED) { | |
- detectedWcGeneration = wcGeneration; | |
+ if (operation.getClass() == SvnCheckout.class) { | |
+ if (SVNWCUtil.isVersionedDirectory(operation.getOperationalWorkingCopy())) { | |
+ wcGeneration = detectWcGeneration(operation.getOperationalWorkingCopy(), false, isAdditionMode); | |
+ } else { | |
+ wcGeneration = getPrimaryWcGeneration(); | |
+ } | |
+ } else { | |
+ wcGeneration = detectWcGeneration(operation.getOperationalWorkingCopy(), false, isAdditionMode); | |
} | |
} | |
@@ -1378,20 +1251,6 @@ | |
break; | |
} | |
if (runner != null) { | |
- //we should NOT reuse already running runners (i.e. runners with operation != null) | |
- //instead we should create new runner of the same class | |
- if ((runner instanceof SvnOperationRunner) && (((SvnOperationRunner) runner).getOperation() != null)) { | |
- final Class<? extends ISvnOperationRunner> runnerClass = runner.getClass(); | |
- try { | |
- runner = (ISvnOperationRunner<?, SvnOperation<?>>)runnerClass.newInstance(); | |
- } catch (InstantiationException e) { | |
- SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.ASSERTION_FAIL, e); | |
- SVNErrorManager.error(errorMessage, SVNLogType.WC); | |
- } catch (IllegalAccessException e) { | |
- SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.ASSERTION_FAIL, e); | |
- SVNErrorManager.error(errorMessage, SVNLogType.WC); | |
- } | |
- } | |
runner.reset(wcGeneration); | |
} else { | |
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNSUPPORTED_FEATURE, "Runner for ''{0}'' command have not been found; probably not yet implement in this API.", | |
@@ -1692,7 +1551,7 @@ | |
} | |
SVNWCDb db = new SVNWCDb(); | |
try { | |
- db.open(SVNWCDbOpenMode.ReadOnly, (ISVNOptions) null, false, false); | |
+ db.open(SVNWCDbOpenMode.ReadOnly, (ISVNOptions) null, false, false); | |
DirParsedInfo info = db.parseDir(path, Mode.ReadOnly, true, isAdditionMode); | |
if (info != null && SVNWCDbDir.isUsable(info.wcDbDir)) { | |
return SvnWcGeneration.V17; | |
@@ -1815,26 +1674,6 @@ | |
registerRunners(); | |
} | |
- /** | |
- * When set to true, first encountered working copy generation becomes 'sticky' | |
- * for this instance of {@link SvnOperationFactory} and no working copy format detection | |
- * will be performed for subsequent operation. | |
- * | |
- * @param isWcGenerationSticky | |
- */ | |
- public void setWcGenerationSticky(boolean isWcGenerationSticky) { | |
- detectedWcGeneration = SvnWcGeneration.NOT_DETECTED; | |
- this.isWcGenerationSticky = isWcGenerationSticky; | |
- } | |
- | |
- /** | |
- * @see #setWcGenerationSticky(boolean) | |
- * @return true when this instance of {@link SvnOperationFactory} | |
- */ | |
- public boolean isWcGenerationSticky() { | |
- return this.isWcGenerationSticky; | |
- } | |
- | |
private SvnWcGeneration[] getRunnerScope(ISvnOperationRunner<?, ? extends SvnOperation<?>> runner) { | |
if (runner.getWcGeneration() == getPrimaryWcGeneration()) { | |
return new SvnWcGeneration[] { getPrimaryWcGeneration(), SvnWcGeneration.NOT_DETECTED}; | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/wc2/SvnUpgrade.java modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/wc2/SvnUpgrade.java | |
--- upstream_trunk/svnkit/src/main/java/org/tmatesoft/svn/core/wc2/SvnUpgrade.java 2014-07-01 03:14:28.449130519 +0000 | |
+++ modified-1.8/svnkit/src/main/java/org/tmatesoft/svn/core/wc2/SvnUpgrade.java 2014-07-01 03:12:33.632138581 +0000 | |
@@ -1,7 +1,6 @@ | |
package org.tmatesoft.svn.core.wc2; | |
import org.tmatesoft.svn.core.SVNErrorCode; | |
-import org.tmatesoft.svn.core.internal.wc17.db.ISVNWCDb; | |
import org.tmatesoft.svn.core.internal.wc2.SvnWcGeneration; | |
/** | |
@@ -31,12 +30,9 @@ | |
* @since 1.7 (SVN 1.7) | |
*/ | |
public class SvnUpgrade extends SvnOperation<SvnWcGeneration> { | |
- | |
- private int targetWorkingCopyFormat; | |
protected SvnUpgrade(SvnOperationFactory factory) { | |
super(factory); | |
- targetWorkingCopyFormat = ISVNWCDb.WC_FORMAT_18; | |
} | |
/** | |
@@ -47,12 +43,4 @@ | |
public boolean isChangesWorkingCopy() { | |
return true; | |
} | |
- | |
- public void setTargetWorkingCopyFormat(int targetWorkingCopyFormat) { | |
- this.targetWorkingCopyFormat = targetWorkingCopyFormat; | |
- } | |
- | |
- public int getTargetWorkingCopyFormat() { | |
- return targetWorkingCopyFormat; | |
- } | |
} | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/test/java/org/tmatesoft/svn/test/CheckoutTest.java modified-1.8/svnkit/src/test/java/org/tmatesoft/svn/test/CheckoutTest.java | |
--- upstream_trunk/svnkit/src/test/java/org/tmatesoft/svn/test/CheckoutTest.java 2014-07-01 03:14:18.739130961 +0000 | |
+++ modified-1.8/svnkit/src/test/java/org/tmatesoft/svn/test/CheckoutTest.java 2014-07-01 03:13:45.945133049 +0000 | |
@@ -4,7 +4,6 @@ | |
import org.junit.Test; | |
import org.tmatesoft.svn.core.SVNDepth; | |
import org.tmatesoft.svn.core.SVNURL; | |
-import org.tmatesoft.svn.core.internal.wc.admin.SVNAdminArea16Factory; | |
import org.tmatesoft.svn.core.internal.wc17.db.ISVNWCDb; | |
import org.tmatesoft.svn.core.wc.SVNEvent; | |
import org.tmatesoft.svn.core.wc.SVNEventAction; | |
@@ -52,44 +51,6 @@ | |
} | |
} | |
- @Test | |
- public void testCheckoutWC16() throws Exception { | |
- final TestOptions options = TestOptions.getInstance(); | |
- | |
- final SvnOperationFactory svnOperationFactory = new SvnOperationFactory(); | |
- final Sandbox sandbox = Sandbox.createWithCleanup(getTestName() + ".testCheckoutWC16", options); | |
- try { | |
- final SVNURL url = sandbox.createSvnRepository(); | |
- | |
- final CommitBuilder commitBuilder = new CommitBuilder(url); | |
- commitBuilder.addFile("file"); | |
- commitBuilder.commit(); | |
- | |
- final File workingCopyDirectory = sandbox.createDirectory("wc"); | |
- | |
- final int expectedWorkingCopyFormat = SVNAdminArea16Factory.WC_FORMAT; | |
- | |
- final SvnCheckout checkout = svnOperationFactory.createCheckout(); | |
- checkout.setSource(SvnTarget.fromURL(url)); | |
- checkout.setSingleTarget(SvnTarget.fromFile(workingCopyDirectory)); | |
- checkout.setTargetWorkingCopyFormat(expectedWorkingCopyFormat); | |
- checkout.run(); | |
- | |
- final SvnGetStatus getStatus = svnOperationFactory.createGetStatus(); | |
- getStatus.setDepth(SVNDepth.EMPTY); | |
- getStatus.setReportAll(true); | |
- getStatus.setSingleTarget(SvnTarget.fromFile(workingCopyDirectory)); | |
- final SvnStatus status = getStatus.run(); | |
- | |
- final int actualWorkingCopyFormat = status.getWorkingCopyFormat(); | |
- Assert.assertEquals(expectedWorkingCopyFormat, actualWorkingCopyFormat); | |
- | |
- } finally { | |
- svnOperationFactory.dispose(); | |
- sandbox.dispose(); | |
- } | |
- } | |
- | |
private String getTestName() { | |
return getClass().getSimpleName(); | |
} | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/test/java/org/tmatesoft/svn/test/CopyTest.java modified-1.8/svnkit/src/test/java/org/tmatesoft/svn/test/CopyTest.java | |
--- upstream_trunk/svnkit/src/test/java/org/tmatesoft/svn/test/CopyTest.java 2014-07-01 03:14:18.763131787 +0000 | |
+++ modified-1.8/svnkit/src/test/java/org/tmatesoft/svn/test/CopyTest.java 2014-07-01 03:13:45.946133150 +0000 | |
@@ -9,7 +9,6 @@ | |
import org.tmatesoft.svn.core.internal.db.SVNSqlJetSelectFieldsStatement; | |
import org.tmatesoft.svn.core.internal.db.SVNSqlJetStatement; | |
import org.tmatesoft.svn.core.internal.wc.SVNExternal; | |
-import org.tmatesoft.svn.core.internal.wc.SVNFileListUtil; | |
import org.tmatesoft.svn.core.internal.wc.SVNFileType; | |
import org.tmatesoft.svn.core.internal.wc.SVNFileUtil; | |
import org.tmatesoft.svn.core.internal.wc17.SVNWCContext; | |
@@ -649,135 +648,6 @@ | |
} | |
} | |
- @Test | |
- public void testMetadataOnlyCopyNormalFileToUnversioned() throws Exception { | |
- //SVNKIT-479 | |
- final TestOptions options = TestOptions.getInstance(); | |
- final Sandbox sandbox = Sandbox.createWithCleanup(getTestName() + ".testMetadataOnlyCopyNormalFileToUnversioned", options); | |
- | |
- final SvnOperationFactory svnOperationFactory = new SvnOperationFactory(); | |
- try { | |
- SVNURL url = sandbox.createSvnRepository(); | |
- | |
- final CommitBuilder commitBuilder = new CommitBuilder(url); | |
- commitBuilder.addFile("sourceFile"); | |
- commitBuilder.commit(); | |
- | |
- final WorkingCopy workingCopy = sandbox.checkoutNewWorkingCopy(url); | |
- final File sourceFile = workingCopy.getFile("sourceFile"); | |
- final File targetFile = workingCopy.getFile("targetFile"); | |
- | |
- TestUtil.writeFileContentsString(targetFile, ""); | |
- | |
- final SvnCopy copy = svnOperationFactory.createCopy(); | |
- copy.addCopySource(SvnCopySource.create(SvnTarget.fromFile(sourceFile), SVNRevision.WORKING)); | |
- copy.setSingleTarget(SvnTarget.fromFile(targetFile)); | |
- copy.setFailWhenDstExists(true); | |
- copy.setMetadataOnly(true); | |
- copy.run(); | |
- | |
- final Map<File, SvnStatus> statuses = TestUtil.getStatuses(svnOperationFactory, workingCopy.getWorkingCopyDirectory()); | |
- final SvnStatus status = statuses.get(targetFile); | |
- Assert.assertTrue(status.isCopied()); | |
- Assert.assertEquals(SVNStatusType.STATUS_ADDED, status.getNodeStatus()); | |
- | |
- } finally { | |
- svnOperationFactory.dispose(); | |
- sandbox.dispose(); | |
- } | |
- } | |
- | |
- | |
- @Test | |
- public void testMetadataOnlyCopyNormalDirectoryToUnversioned() throws Exception { | |
- //SVNKIT-479 | |
- final TestOptions options = TestOptions.getInstance(); | |
- final Sandbox sandbox = Sandbox.createWithCleanup(getTestName() + ".testMetadataOnlyCopyNormalDirectoryToUnversioned", options); | |
- | |
- final SvnOperationFactory svnOperationFactory = new SvnOperationFactory(); | |
- try { | |
- SVNURL url = sandbox.createSvnRepository(); | |
- | |
- final CommitBuilder commitBuilder = new CommitBuilder(url); | |
- commitBuilder.addDirectory("sourceFile"); | |
- commitBuilder.commit(); | |
- | |
- final WorkingCopy workingCopy = sandbox.checkoutNewWorkingCopy(url); | |
- final File sourceFile = workingCopy.getFile("sourceFile"); | |
- final File targetFile = workingCopy.getFile("targetFile"); | |
- | |
- SVNFileUtil.ensureDirectoryExists(targetFile); | |
- | |
- final SvnCopy copy = svnOperationFactory.createCopy(); | |
- copy.addCopySource(SvnCopySource.create(SvnTarget.fromFile(sourceFile), SVNRevision.WORKING)); | |
- copy.setSingleTarget(SvnTarget.fromFile(targetFile)); | |
- copy.setFailWhenDstExists(true); | |
- copy.setMetadataOnly(true); | |
- copy.run(); | |
- | |
- final Map<File, SvnStatus> statuses = TestUtil.getStatuses(svnOperationFactory, workingCopy.getWorkingCopyDirectory()); | |
- final SvnStatus status = statuses.get(targetFile); | |
- Assert.assertTrue(status.isCopied()); | |
- Assert.assertEquals(SVNStatusType.STATUS_ADDED, status.getNodeStatus()); | |
- | |
- } finally { | |
- svnOperationFactory.dispose(); | |
- sandbox.dispose(); | |
- } | |
- } | |
- | |
- @Test | |
- public void testPrejFileNotCopiedWC17() throws Exception { | |
- //SVNKIT-488 | |
- final TestOptions options = TestOptions.getInstance(); | |
- final Sandbox sandbox = Sandbox.createWithCleanup(getTestName() + ".testPrejFileNotCopiedWC17", options); | |
- | |
- final SvnOperationFactory svnOperationFactory = new SvnOperationFactory(); | |
- try { | |
- SVNURL url = sandbox.createSvnRepository(); | |
- | |
- final CommitBuilder commitBuilder1 = new CommitBuilder(url); | |
- commitBuilder1.addDirectory("directory/subdirectory"); | |
- commitBuilder1.setDirectoryProperty("sourceDirectory/subdirectory", "propertyName", SVNPropertyValue.create("base")); | |
- commitBuilder1.commit(); | |
- | |
- final CommitBuilder commitBuilder2 = new CommitBuilder(url); | |
- commitBuilder2.setDirectoryProperty("sourceDirectory/subdirectory", "propertyName", SVNPropertyValue.create("theirs")); | |
- commitBuilder2.commit(); | |
- | |
- final File workingCopyDirectory = sandbox.createDirectory("wc"); | |
- | |
- final SvnCheckout checkout = svnOperationFactory.createCheckout(); | |
- checkout.setSource(SvnTarget.fromURL(url)); | |
- checkout.setSingleTarget(SvnTarget.fromFile(workingCopyDirectory)); | |
- checkout.run(); | |
- | |
- final File sourceDirectory = new File(workingCopyDirectory, "sourceDirectory"); | |
- final File targetDirectory = new File(workingCopyDirectory, "targetDirectory"); | |
- final File subdirectory = new File(sourceDirectory, "subdirectory"); | |
- | |
- final SvnSetProperty setProperty = svnOperationFactory.createSetProperty(); | |
- setProperty.setPropertyName("propertyName"); | |
- setProperty.setPropertyValue(SVNPropertyValue.create("ours")); | |
- setProperty.setSingleTarget(SvnTarget.fromFile(subdirectory)); | |
- setProperty.run(); | |
- | |
- final SvnUpdate update = svnOperationFactory.createUpdate(); | |
- update.setSingleTarget(SvnTarget.fromFile(workingCopyDirectory)); | |
- update.run(); | |
- | |
- final SvnCopy copy = svnOperationFactory.createCopy(); | |
- copy.addCopySource(SvnCopySource.create(SvnTarget.fromFile(sourceDirectory), SVNRevision.WORKING)); | |
- copy.setSingleTarget(SvnTarget.fromFile(targetDirectory)); | |
- copy.run(); | |
- | |
- Assert.assertEquals(0, SVNFileListUtil.listFiles(new File(targetDirectory, "subdirectory")).length); | |
- } finally { | |
- svnOperationFactory.dispose(); | |
- sandbox.dispose(); | |
- } | |
- } | |
- | |
private void assertNoRepositoryPathStartsWithSlash(SvnOperationFactory svnOperationFactory, File workingCopyDirectory) throws SVNException { | |
final SVNWCContext context = new SVNWCContext(ISVNWCDb.SVNWCDbOpenMode.ReadOnly, svnOperationFactory.getOptions(), false, false, svnOperationFactory.getEventHandler()); | |
try { | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/test/java/org/tmatesoft/svn/test/ListTest.java modified-1.8/svnkit/src/test/java/org/tmatesoft/svn/test/ListTest.java | |
--- upstream_trunk/svnkit/src/test/java/org/tmatesoft/svn/test/ListTest.java 2014-07-01 03:14:18.741131241 +0000 | |
+++ modified-1.8/svnkit/src/test/java/org/tmatesoft/svn/test/ListTest.java 2014-07-01 03:12:33.647138054 +0000 | |
@@ -6,14 +6,12 @@ | |
import org.tmatesoft.svn.core.SVNDirEntry; | |
import org.tmatesoft.svn.core.SVNException; | |
import org.tmatesoft.svn.core.SVNURL; | |
-import org.tmatesoft.svn.core.internal.wc2.SvnWcGeneration; | |
import org.tmatesoft.svn.core.wc.SVNRevision; | |
import org.tmatesoft.svn.core.wc2.ISvnObjectReceiver; | |
import org.tmatesoft.svn.core.wc2.SvnList; | |
import org.tmatesoft.svn.core.wc2.SvnOperationFactory; | |
import org.tmatesoft.svn.core.wc2.SvnTarget; | |
-import java.io.File; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.List; | |
@@ -184,34 +182,6 @@ | |
} | |
} | |
- @Test | |
- public void testListWC16() throws Exception { | |
- final TestOptions options = TestOptions.getInstance(); | |
- Assume.assumeTrue(TestUtil.areAllApacheOptionsSpecified(options)); | |
- | |
- final SvnOperationFactory svnOperationFactory = new SvnOperationFactory(); | |
- final Sandbox sandbox = Sandbox.createWithCleanup(getTestName() + ".testListWC16", options); | |
- try { | |
- final SVNURL url = sandbox.createSvnRepositoryWithDavAccess(); | |
- | |
- final CommitBuilder commitBuilder = new CommitBuilder(url); | |
- commitBuilder.commit(); | |
- | |
- final WorkingCopy workingCopy = sandbox.checkoutNewWorkingCopy(url, -1, true, SvnWcGeneration.V16); | |
- final File workingCopyDirectory = workingCopy.getWorkingCopyDirectory(); | |
- | |
- final SvnList list = svnOperationFactory.createList(); | |
- list.setSingleTarget(SvnTarget.fromFile(workingCopyDirectory)); | |
- final SVNDirEntry dirEntry = list.run(); | |
- | |
- Assert.assertEquals(url, dirEntry.getURL()); | |
- | |
- } finally { | |
- svnOperationFactory.dispose(); | |
- sandbox.dispose(); | |
- } | |
- } | |
- | |
private String getTestName() { | |
return "ListTest"; | |
} | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/test/java/org/tmatesoft/svn/test/LogTest.java modified-1.8/svnkit/src/test/java/org/tmatesoft/svn/test/LogTest.java | |
--- upstream_trunk/svnkit/src/test/java/org/tmatesoft/svn/test/LogTest.java 2014-07-01 03:14:18.743131441 +0000 | |
+++ modified-1.8/svnkit/src/test/java/org/tmatesoft/svn/test/LogTest.java 2014-07-01 03:13:45.948133292 +0000 | |
@@ -3,21 +3,14 @@ | |
import org.junit.Assert; | |
import org.junit.Test; | |
import org.tmatesoft.svn.core.*; | |
-import org.tmatesoft.svn.core.internal.wc2.SvnWcGeneration; | |
import org.tmatesoft.svn.core.io.SVNRepository; | |
import org.tmatesoft.svn.core.io.SVNRepositoryFactory; | |
-import org.tmatesoft.svn.core.wc.SVNClientManager; | |
-import org.tmatesoft.svn.core.wc.SVNLogClient; | |
-import org.tmatesoft.svn.core.wc.SVNRevision; | |
import org.tmatesoft.svn.core.wc2.SvnOperationFactory; | |
import org.tmatesoft.svn.core.wc2.SvnRemoteSetProperty; | |
import org.tmatesoft.svn.core.wc2.SvnSetProperty; | |
import org.tmatesoft.svn.core.wc2.SvnTarget; | |
-import java.io.File; | |
-import java.util.ArrayList; | |
import java.util.Collection; | |
-import java.util.List; | |
public class LogTest { | |
@@ -63,49 +56,6 @@ | |
} | |
} | |
- @Test | |
- public void testLogPegWorkingWC16() throws Exception { | |
- //SVNKIT-507 | |
- final TestOptions options = TestOptions.getInstance(); | |
- | |
- final SvnOperationFactory svnOperationFactory = new SvnOperationFactory(); | |
- final Sandbox sandbox = Sandbox.createWithCleanup(getTestName() + ".testLogPegWorkingWC16", options); | |
- try { | |
- final SVNURL url = sandbox.createSvnRepository(); | |
- | |
- final CommitBuilder commitBuilder = new CommitBuilder(url); | |
- commitBuilder.addFile("file"); | |
- commitBuilder.commit(); | |
- | |
- final WorkingCopy workingCopy = sandbox.checkoutNewWorkingCopy(url, -1, true, SvnWcGeneration.V16); | |
- final File workingCopyDirectory = workingCopy.getWorkingCopyDirectory(); | |
- | |
- final List<SVNLogEntry> logEntries = new ArrayList<SVNLogEntry>(1); | |
- | |
- final SVNClientManager clientManager = SVNClientManager.newInstance(); | |
- try { | |
- SVNLogClient logClient = clientManager.getLogClient(); | |
- logClient.doLog(new File[]{workingCopyDirectory}, SVNRevision.WORKING, | |
- SVNRevision.create(0), SVNRevision.create(1), true, true, 10, new ISVNLogEntryHandler() { | |
- public void handleLogEntry(SVNLogEntry logEntry) throws SVNException { | |
- logEntries.add(logEntry); | |
- } | |
- }); | |
- } finally { | |
- clientManager.dispose(); | |
- } | |
- Assert.assertEquals(2, logEntries.size()); | |
- final SVNLogEntry logEntry0 = logEntries.get(0); | |
- final SVNLogEntry logEntry1 = logEntries.get(1); | |
- Assert.assertEquals(0, logEntry0.getChangedPaths().size()); | |
- Assert.assertEquals(1, logEntry1.getChangedPaths().size()); | |
- | |
- } finally { | |
- svnOperationFactory.dispose(); | |
- sandbox.dispose(); | |
- } | |
- } | |
- | |
private String getTestName() { | |
return getClass().getSimpleName(); | |
} | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/test/java/org/tmatesoft/svn/test/MoveTest.java modified-1.8/svnkit/src/test/java/org/tmatesoft/svn/test/MoveTest.java | |
--- upstream_trunk/svnkit/src/test/java/org/tmatesoft/svn/test/MoveTest.java 2014-07-01 03:14:18.759131589 +0000 | |
+++ modified-1.8/svnkit/src/test/java/org/tmatesoft/svn/test/MoveTest.java 2014-07-01 03:13:45.948133292 +0000 | |
@@ -4,19 +4,13 @@ | |
import org.junit.Assume; | |
import org.junit.Ignore; | |
import org.junit.Test; | |
-import org.tmatesoft.sqljet.core.SqlJetTransactionMode; | |
-import org.tmatesoft.sqljet.core.table.ISqlJetCursor; | |
-import org.tmatesoft.sqljet.core.table.ISqlJetTable; | |
-import org.tmatesoft.sqljet.core.table.SqlJetDb; | |
import org.tmatesoft.svn.core.*; | |
import org.tmatesoft.svn.core.auth.BasicAuthenticationManager; | |
-import org.tmatesoft.svn.core.internal.db.SVNSqlJetDb; | |
-import org.tmatesoft.svn.core.internal.db.SVNSqlJetStatement; | |
import org.tmatesoft.svn.core.internal.wc.SVNFileUtil; | |
-import org.tmatesoft.svn.core.internal.wc17.db.ISVNWCDb; | |
-import org.tmatesoft.svn.core.internal.wc17.db.SVNWCDb; | |
-import org.tmatesoft.svn.core.internal.wc17.db.statement.SVNWCDbStatements; | |
-import org.tmatesoft.svn.core.wc.*; | |
+import org.tmatesoft.svn.core.wc.SVNClientManager; | |
+import org.tmatesoft.svn.core.wc.SVNMoveClient; | |
+import org.tmatesoft.svn.core.wc.SVNRevision; | |
+import org.tmatesoft.svn.core.wc.SVNStatusType; | |
import org.tmatesoft.svn.core.wc2.*; | |
import java.io.File; | |
@@ -404,169 +398,6 @@ | |
} | |
} | |
- @Test | |
- public void testMoveReplaced() throws Exception { | |
- final TestOptions options = TestOptions.getInstance(); | |
- final Sandbox sandbox = Sandbox.createWithCleanup(getTestName() + ".testMoveReplaced", options); | |
- | |
- try { | |
- final SVNURL url = sandbox.createSvnRepository(); | |
- CommitBuilder commitBuilder = new CommitBuilder(url); | |
- commitBuilder.addFile("normal.txt"); | |
- commitBuilder.addFile("replaced.txt"); | |
- commitBuilder.commit(); | |
- | |
- WorkingCopy wc1 = sandbox.checkoutNewWorkingCopy(url); | |
- File normalFile = wc1.getFile("normal.txt"); | |
- File replacedFile = wc1.getFile("replaced.txt"); | |
- File moveToFile = wc1.getFile("moveTo.txt"); | |
- | |
- SVNClientManager scm = SVNClientManager.newInstance(); | |
- | |
- // Remove from version control... | |
- scm.getWCClient().doDelete(replacedFile, true, true, false); | |
- // ... copy another one instead | |
- scm.getCopyClient().doCopy( | |
- new SVNCopySource[] { new SVNCopySource(SVNRevision.WORKING, SVNRevision.WORKING, normalFile) }, | |
- replacedFile, | |
- false, | |
- false, | |
- true); | |
- SVNURL originalURL = scm.getStatusClient().doStatus(normalFile, false).getURL(); | |
- | |
- SVNStatus status = scm.getStatusClient().doStatus(replacedFile, false); | |
- Assert.assertEquals(SVNStatusType.STATUS_REPLACED, status.getCombinedNodeAndContentsStatus()); | |
- Assert.assertTrue(status.isCopied()); | |
- Assert.assertEquals(originalURL.toString(), status.getCopyFromURL().toString()); | |
- | |
- // Move the replacing item to a different location | |
- scm.getCopyClient().doCopy( | |
- new SVNCopySource[] { new SVNCopySource(SVNRevision.WORKING, SVNRevision.WORKING, replacedFile) }, | |
- moveToFile, | |
- true, | |
- false, | |
- true); | |
- | |
- status = scm.getStatusClient().doStatus(moveToFile, false); | |
- Assert.assertEquals(originalURL.toString(), status.getCopyFromURL().toString()); | |
- } finally { | |
- sandbox.dispose(); | |
- } | |
- } | |
- | |
- @Test | |
- public void testMovingOfAddedDirectories() throws Exception { | |
- //SVNKIT-478 | |
- final TestOptions options = TestOptions.getInstance(); | |
- | |
- final SvnOperationFactory svnOperationFactory = new SvnOperationFactory(); | |
- final Sandbox sandbox = Sandbox.createWithCleanup(getTestName() + ".testMovingOfAddedDirectories", options); | |
- try { | |
- final SVNURL url = sandbox.createSvnRepository(); | |
- | |
- final CommitBuilder commitBuilder = new CommitBuilder(url); | |
- commitBuilder.addDirectory("directory/anotherDirectory"); | |
- commitBuilder.commit(); | |
- | |
- final WorkingCopy workingCopy = sandbox.checkoutNewWorkingCopy(url); | |
- final File directory = workingCopy.getFile("directory"); | |
- final File movedDirectory = workingCopy.getFile("movedDirectory"); | |
- final File subdirectory = new File(directory, "subdirectory"); | |
- final File subsubdirectory = new File(subdirectory, "subsubdirectory"); | |
- final File anotherDirectory = workingCopy.getFile("anotherDirectory"); | |
- final File movedSubdirectory = new File(movedDirectory, "subdirectory"); | |
- final File file = new File(subdirectory, "file"); | |
- | |
- SVNFileUtil.ensureDirectoryExists(subsubdirectory); | |
- SVNFileUtil.ensureDirectoryExists(file.getParentFile()); | |
- TestUtil.writeFileContentsString(file, ""); | |
- | |
- final SvnScheduleForAddition scheduleForAddition = svnOperationFactory.createScheduleForAddition(); | |
- scheduleForAddition.setSingleTarget(SvnTarget.fromFile(subdirectory)); | |
- scheduleForAddition.run(); | |
- | |
- final SvnCopy copy1 = svnOperationFactory.createCopy(); | |
- copy1.addCopySource(SvnCopySource.create(SvnTarget.fromFile(directory), SVNRevision.WORKING)); | |
- copy1.setSingleTarget(SvnTarget.fromFile(movedDirectory)); | |
- copy1.setMove(true); | |
- copy1.run(); | |
- | |
- final SvnCopy copy2 = svnOperationFactory.createCopy(); | |
- copy2.addCopySource(SvnCopySource.create(SvnTarget.fromFile(movedSubdirectory), SVNRevision.WORKING)); | |
- copy2.setSingleTarget(SvnTarget.fromFile(anotherDirectory)); | |
- copy2.setFailWhenDstExists(false); | |
- copy2.setMove(true); | |
- copy2.run(); | |
- | |
- final Map<File, SvnStatus> statuses = TestUtil.getStatuses(svnOperationFactory, workingCopy.getWorkingCopyDirectory()); | |
- Assert.assertFalse(statuses.get(anotherDirectory).isCopied()); | |
- Assert.assertEquals(SVNStatusType.STATUS_ADDED, statuses.get(anotherDirectory).getNodeStatus()); | |
- | |
- } finally { | |
- sandbox.dispose(); | |
- svnOperationFactory.dispose(); | |
- } | |
- } | |
- | |
- @Test | |
- public void testMoveError() throws Exception { | |
- final TestOptions options = TestOptions.getInstance(); | |
- final Sandbox sandbox = Sandbox.createWithCleanup(getTestName() + ".test", options); | |
- | |
- try { | |
- final SVNURL url = sandbox.createSvnRepository(); | |
- CommitBuilder commitBuilder = new CommitBuilder(url); | |
- // A file that will be conflicted | |
- commitBuilder.addFile("conflict.txt"); | |
- // Another file | |
- commitBuilder.addFile("file.txt"); | |
- commitBuilder.commit(); | |
- | |
- WorkingCopy wc1 = sandbox.checkoutNewWorkingCopy(url); | |
- File file = wc1.getFile("file.txt"); | |
- File conflictFile = wc1.getFile("conflict.txt"); | |
- TestUtil.writeFileContentsString(conflictFile, "wc1"); | |
- File moveToFile = wc1.getFile("moveTo.txt"); | |
- | |
- WorkingCopy wc2 = sandbox.checkoutNewWorkingCopy(url); | |
- File conflictFile2 = wc2.getFile("conflict.txt"); | |
- TestUtil.writeFileContentsString(conflictFile2, "wc2"); | |
- wc2.commit("test"); | |
- | |
- try { | |
- wc1.updateToRevision(-1); | |
- } catch (Throwable t) { | |
- // Throws a runtime exception, didn't study it, but the conflict is generated | |
- } | |
- | |
- SVNClientManager scm = SVNClientManager.newInstance(); | |
- // Move conflict | |
- scm.getCopyClient().doCopy( | |
- new SVNCopySource[] { new SVNCopySource(SVNRevision.WORKING, SVNRevision.WORKING, conflictFile) }, | |
- moveToFile, | |
- true, | |
- false, | |
- true); | |
- | |
- scm.getWCClient().doDelete(moveToFile, true, true, false); | |
- Assert.assertFalse(moveToFile.exists()); | |
- | |
- // Move the other file | |
- try { | |
- scm.getCopyClient().doCopy( | |
- new SVNCopySource[] { new SVNCopySource(SVNRevision.WORKING, SVNRevision.WORKING, file) }, | |
- moveToFile, | |
- true, | |
- false, | |
- true); | |
- } catch (SVNException e) { | |
- Assert.fail(e.getMessage()); | |
- } | |
- } finally { | |
- sandbox.dispose(); | |
- } | |
- } | |
- | |
private String getTestName() { | |
return "MoveTest"; | |
} | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/test/java/org/tmatesoft/svn/test/RevertTest.java modified-1.8/svnkit/src/test/java/org/tmatesoft/svn/test/RevertTest.java | |
--- upstream_trunk/svnkit/src/test/java/org/tmatesoft/svn/test/RevertTest.java 2014-07-01 03:14:18.784131267 +0000 | |
+++ modified-1.8/svnkit/src/test/java/org/tmatesoft/svn/test/RevertTest.java 2014-07-01 03:13:45.950133412 +0000 | |
@@ -4,7 +4,6 @@ | |
import org.junit.Test; | |
import org.tmatesoft.svn.core.*; | |
import org.tmatesoft.svn.core.internal.wc.SVNFileUtil; | |
-import org.tmatesoft.svn.core.internal.wc17.db.ISVNWCDb; | |
import org.tmatesoft.svn.core.wc.*; | |
import org.tmatesoft.svn.core.wc2.*; | |
@@ -419,120 +418,6 @@ | |
} | |
} | |
- @Test | |
- public void testRevertRemovesMarkedFilesWC17() throws Exception { | |
- final TestOptions options = TestOptions.getInstance(); | |
- | |
- final SvnOperationFactory svnOperationFactory = new SvnOperationFactory(); | |
- final Sandbox sandbox = Sandbox.createWithCleanup(getTestName() + ".testRevertRemovesMarkedFilesWC17", options); | |
- try { | |
- final SVNURL url = sandbox.createSvnRepository(); | |
- | |
- final CommitBuilder commitBuilder1 = new CommitBuilder(url); | |
- commitBuilder1.addFile("file", "base".getBytes()); | |
- commitBuilder1.setFileProperty("file", "propertyName", SVNPropertyValue.create("base")); | |
- commitBuilder1.commit(); | |
- | |
- final CommitBuilder commitBuilder2 = new CommitBuilder(url); | |
- commitBuilder2.changeFile("file", "theirs".getBytes()); | |
- commitBuilder2.setFileProperty("file", "propertyName", SVNPropertyValue.create("theirs")); | |
- commitBuilder2.commit(); | |
- | |
- final File workingCopyDirectory = sandbox.createDirectory("wc"); | |
- final File file = new File(workingCopyDirectory, "file"); | |
- | |
- final SvnCheckout checkout = svnOperationFactory.createCheckout(); | |
- checkout.setTargetWorkingCopyFormat(ISVNWCDb.WC_FORMAT_17); | |
- checkout.setSource(SvnTarget.fromURL(url)); | |
- checkout.setSingleTarget(SvnTarget.fromFile(workingCopyDirectory)); | |
- checkout.setRevision(SVNRevision.create(1)); | |
- checkout.run(); | |
- | |
- final SvnSetProperty setProperty = svnOperationFactory.createSetProperty(); | |
- setProperty.setSingleTarget(SvnTarget.fromFile(file)); | |
- setProperty.setPropertyName("propertyName"); | |
- setProperty.setPropertyValue(SVNPropertyValue.create("ours")); | |
- setProperty.run(); | |
- | |
- TestUtil.writeFileContentsString(file, "ours"); | |
- | |
- final SvnUpdate update = svnOperationFactory.createUpdate(); | |
- update.setSingleTarget(SvnTarget.fromFile(file)); | |
- update.run(); | |
- | |
- final SvnRevert revert = svnOperationFactory.createRevert(); | |
- revert.setSingleTarget(SvnTarget.fromFile(file)); | |
- revert.run(); | |
- | |
- Assert.assertFalse(new File(file.getPath() + ".mine").exists()); | |
- Assert.assertFalse(new File(file.getPath() + ".r1").exists()); | |
- Assert.assertFalse(new File(file.getPath() + ".r2").exists()); | |
- Assert.assertFalse(new File(file.getPath() + ".prej").exists()); | |
- | |
- } finally { | |
- svnOperationFactory.dispose(); | |
- sandbox.dispose(); | |
- } | |
- } | |
- | |
- @Test | |
- public void testRevertInfinityDepthRemovesMarkedFilesWC17() throws Exception { | |
- //SVNKIT-483 | |
- final TestOptions options = TestOptions.getInstance(); | |
- | |
- final SvnOperationFactory svnOperationFactory = new SvnOperationFactory(); | |
- final Sandbox sandbox = Sandbox.createWithCleanup(getTestName() + ".testRevertInfinityDepthRemovesMarkedFilesWC17", options); | |
- try { | |
- final SVNURL url = sandbox.createSvnRepository(); | |
- | |
- final CommitBuilder commitBuilder1 = new CommitBuilder(url); | |
- commitBuilder1.addFile("file", "base".getBytes()); | |
- commitBuilder1.setFileProperty("file", "propertyName", SVNPropertyValue.create("base")); | |
- commitBuilder1.commit(); | |
- | |
- final CommitBuilder commitBuilder2 = new CommitBuilder(url); | |
- commitBuilder2.changeFile("file", "theirs".getBytes()); | |
- commitBuilder2.setFileProperty("file", "propertyName", SVNPropertyValue.create("theirs")); | |
- commitBuilder2.commit(); | |
- | |
- final File workingCopyDirectory = sandbox.createDirectory("wc"); | |
- final File file = new File(workingCopyDirectory, "file"); | |
- | |
- final SvnCheckout checkout = svnOperationFactory.createCheckout(); | |
- checkout.setTargetWorkingCopyFormat(ISVNWCDb.WC_FORMAT_17); | |
- checkout.setSource(SvnTarget.fromURL(url)); | |
- checkout.setSingleTarget(SvnTarget.fromFile(workingCopyDirectory)); | |
- checkout.setRevision(SVNRevision.create(1)); | |
- checkout.run(); | |
- | |
- final SvnSetProperty setProperty = svnOperationFactory.createSetProperty(); | |
- setProperty.setSingleTarget(SvnTarget.fromFile(file)); | |
- setProperty.setPropertyName("propertyName"); | |
- setProperty.setPropertyValue(SVNPropertyValue.create("ours")); | |
- setProperty.run(); | |
- | |
- TestUtil.writeFileContentsString(file, "ours"); | |
- | |
- final SvnUpdate update = svnOperationFactory.createUpdate(); | |
- update.setSingleTarget(SvnTarget.fromFile(file)); | |
- update.run(); | |
- | |
- final SvnRevert revert = svnOperationFactory.createRevert(); | |
- revert.setDepth(SVNDepth.INFINITY); | |
- revert.setSingleTarget(SvnTarget.fromFile(file)); | |
- revert.run(); | |
- | |
- Assert.assertFalse(new File(file.getPath() + ".mine").exists()); | |
- Assert.assertFalse(new File(file.getPath() + ".r1").exists()); | |
- Assert.assertFalse(new File(file.getPath() + ".r2").exists()); | |
- Assert.assertFalse(new File(file.getPath() + ".prej").exists()); | |
- | |
- } finally { | |
- svnOperationFactory.dispose(); | |
- sandbox.dispose(); | |
- } | |
- } | |
- | |
private void testRevertCopy(String testName, boolean recursiveRevert, boolean preserveModifiedCopies, boolean modifyFileContents, boolean modifyProperties, boolean expectedFileExistence16, SVNStatusType expectedNodeStatus16, boolean expectedFileExistence17, SVNStatusType expectedNodeStatus17) throws SVNException { | |
final TestOptions options = TestOptions.getInstance(); | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/test/java/org/tmatesoft/svn/test/StatusTest.java modified-1.8/svnkit/src/test/java/org/tmatesoft/svn/test/StatusTest.java | |
--- upstream_trunk/svnkit/src/test/java/org/tmatesoft/svn/test/StatusTest.java 2014-07-01 03:14:18.774130905 +0000 | |
+++ modified-1.8/svnkit/src/test/java/org/tmatesoft/svn/test/StatusTest.java 2014-07-01 03:13:45.950133412 +0000 | |
@@ -3,10 +3,12 @@ | |
import org.junit.Assert; | |
import org.junit.Assume; | |
import org.junit.Test; | |
-import org.tmatesoft.svn.core.*; | |
+import org.tmatesoft.svn.core.SVNDepth; | |
+import org.tmatesoft.svn.core.SVNException; | |
+import org.tmatesoft.svn.core.SVNPropertyValue; | |
+import org.tmatesoft.svn.core.SVNURL; | |
import org.tmatesoft.svn.core.auth.BasicAuthenticationManager; | |
import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager; | |
-import org.tmatesoft.svn.core.internal.wc.SVNExternal; | |
import org.tmatesoft.svn.core.internal.wc.admin.SVNAdminAreaFactory; | |
import org.tmatesoft.svn.core.internal.wc17.SVNWCContext; | |
import org.tmatesoft.svn.core.internal.wc17.db.ISVNWCDb; | |
@@ -389,122 +391,6 @@ | |
} | |
} | |
- @Test | |
- public void testUnversionedFileFormatWC17() throws Exception { | |
- //SVNKIT-480 | |
- final TestOptions options = TestOptions.getInstance(); | |
- final Sandbox sandbox = Sandbox.createWithCleanup(getTestName() + ".testUnversionedFileFormatWC17", options); | |
- | |
- final SvnOperationFactory svnOperationFactory = new SvnOperationFactory(); | |
- try { | |
- final SVNURL url = sandbox.createSvnRepository(); | |
- | |
- final File workingCopyDirectory = sandbox.createDirectory("wc"); | |
- | |
- final SvnCheckout checkout = svnOperationFactory.createCheckout(); | |
- checkout.setSource(SvnTarget.fromURL(url)); | |
- checkout.setSingleTarget(SvnTarget.fromFile(workingCopyDirectory)); | |
- checkout.setTargetWorkingCopyFormat(ISVNWCDb.WC_FORMAT_17); | |
- checkout.run(); | |
- | |
- final File unversionedFile = new File(workingCopyDirectory, "unversionedFile"); | |
- TestUtil.writeFileContentsString(unversionedFile, ""); | |
- | |
- final SvnGetStatus getStatus = svnOperationFactory.createGetStatus(); | |
- getStatus.setSingleTarget(SvnTarget.fromFile(unversionedFile)); | |
- final SvnStatus status = getStatus.run(); | |
- | |
- Assert.assertEquals(ISVNWCDb.WC_FORMAT_17, status.getWorkingCopyFormat()); | |
- } finally { | |
- sandbox.dispose(); | |
- svnOperationFactory.dispose(); | |
- } | |
- } | |
- | |
- @Test | |
- public void testExternalFormatWC17() throws Exception { | |
- //SVNKIT-480 | |
- final TestOptions options = TestOptions.getInstance(); | |
- final Sandbox sandbox = Sandbox.createWithCleanup(getTestName() + ".testExternalFormatWC17", options); | |
- | |
- final SvnOperationFactory svnOperationFactory = new SvnOperationFactory(); | |
- try { | |
- final SVNURL url = sandbox.createSvnRepository(); | |
- | |
- final SVNExternal externalDirectory = new SVNExternal("externalDirectory", url.appendPath("directory", false).toString(), SVNRevision.HEAD, SVNRevision.HEAD, false, false, true); | |
- final SVNExternal externalFile = new SVNExternal("externalFile", url.appendPath("directory", false).toString(), SVNRevision.HEAD, SVNRevision.HEAD, false, false, true); | |
- | |
- final CommitBuilder commitBuilder = new CommitBuilder(url); | |
- commitBuilder.addFile("file"); | |
- commitBuilder.addDirectory("directory"); | |
- commitBuilder.setDirectoryProperty("", SVNProperty.EXTERNALS, SVNPropertyValue.create(externalDirectory.toString() + "\n" + externalFile.toString())); | |
- commitBuilder.commit(); | |
- | |
- final File workingCopyDirectory = sandbox.createDirectory("wc"); | |
- | |
- final SvnCheckout checkout = svnOperationFactory.createCheckout(); | |
- checkout.setIgnoreExternals(false); | |
- checkout.setSource(SvnTarget.fromURL(url)); | |
- checkout.setSingleTarget(SvnTarget.fromFile(workingCopyDirectory)); | |
- checkout.setTargetWorkingCopyFormat(ISVNWCDb.WC_FORMAT_17); | |
- checkout.run(); | |
- | |
- final SvnGetStatus getStatus = svnOperationFactory.createGetStatus(); | |
- getStatus.setSingleTarget(SvnTarget.fromFile(workingCopyDirectory)); | |
- getStatus.setDepth(SVNDepth.IMMEDIATES); | |
- getStatus.setReceiver(new ISvnObjectReceiver<SvnStatus>() { | |
- public void receive(SvnTarget target, SvnStatus status) throws SVNException { | |
- Assert.assertEquals(ISVNWCDb.WC_FORMAT_17, status.getWorkingCopyFormat()); } | |
- }); | |
- getStatus.run(); | |
- | |
- } finally { | |
- sandbox.dispose(); | |
- svnOperationFactory.dispose(); | |
- } | |
- } | |
- | |
- @Test | |
- public void testRemotelyAddedNodesFormat() throws Exception { | |
- //SVNKIT-480 | |
- final TestOptions options = TestOptions.getInstance(); | |
- final Sandbox sandbox = Sandbox.createWithCleanup(getTestName() + ".testRemotelyAddedNodesFormat", options); | |
- | |
- final SvnOperationFactory svnOperationFactory = new SvnOperationFactory(); | |
- try { | |
- final SVNURL url = sandbox.createSvnRepository(); | |
- | |
- final CommitBuilder commitBuilder = new CommitBuilder(url); | |
- commitBuilder.addFile("file"); | |
- commitBuilder.commit(); | |
- | |
- final File workingCopyDirectory = sandbox.createDirectory("wc"); | |
- | |
- final SvnCheckout checkout = svnOperationFactory.createCheckout(); | |
- checkout.setIgnoreExternals(false); | |
- checkout.setSource(SvnTarget.fromURL(url)); | |
- checkout.setSingleTarget(SvnTarget.fromFile(workingCopyDirectory)); | |
- checkout.setTargetWorkingCopyFormat(ISVNWCDb.WC_FORMAT_17); | |
- checkout.setRevision(SVNRevision.create(0)); | |
- checkout.run(); | |
- | |
- final SvnGetStatus getStatus = svnOperationFactory.createGetStatus(); | |
- getStatus.setSingleTarget(SvnTarget.fromFile(workingCopyDirectory)); | |
- getStatus.setDepth(SVNDepth.IMMEDIATES); | |
- getStatus.setReportAll(true); | |
- getStatus.setRemote(true); | |
- getStatus.setReceiver(new ISvnObjectReceiver<SvnStatus>() { | |
- public void receive(SvnTarget target, SvnStatus status) throws SVNException { | |
- Assert.assertEquals(ISVNWCDb.WC_FORMAT_17, status.getWorkingCopyFormat()); } | |
- }); | |
- getStatus.run(); | |
- | |
- } finally { | |
- sandbox.dispose(); | |
- svnOperationFactory.dispose(); | |
- } | |
- } | |
- | |
private String getTestName() { | |
return "StatusTest"; | |
} | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/test/java/org/tmatesoft/svn/test/SvnKeywordsTest.java modified-1.8/svnkit/src/test/java/org/tmatesoft/svn/test/SvnKeywordsTest.java | |
--- upstream_trunk/svnkit/src/test/java/org/tmatesoft/svn/test/SvnKeywordsTest.java 2014-07-01 03:14:18.801131073 +0000 | |
+++ modified-1.8/svnkit/src/test/java/org/tmatesoft/svn/test/SvnKeywordsTest.java 2014-07-01 03:12:33.651138143 +0000 | |
@@ -6,7 +6,6 @@ | |
import org.tmatesoft.svn.core.SVNProperty; | |
import org.tmatesoft.svn.core.SVNPropertyValue; | |
import org.tmatesoft.svn.core.SVNURL; | |
-import org.tmatesoft.svn.core.auth.BasicAuthenticationManager; | |
import org.tmatesoft.svn.core.wc.SVNRevision; | |
import org.tmatesoft.svn.core.wc2.SvnCat; | |
import org.tmatesoft.svn.core.wc2.SvnCheckout; | |
@@ -99,39 +98,6 @@ | |
} | |
- @Test | |
- public void testCustomKeywords() throws Exception { | |
- //SVNKIT-514 | |
- final TestOptions options = TestOptions.getInstance(); | |
- | |
- final SvnOperationFactory svnOperationFactory = new SvnOperationFactory(); | |
- final Sandbox sandbox = Sandbox.createWithCleanup(getTestName() + ".testCustomKeywords", options); | |
- try { | |
- final SVNURL url = sandbox.createSvnRepository(); | |
- | |
- final CommitBuilder commitBuilder = new CommitBuilder(url); | |
- commitBuilder.setAuthenticationManager(new BasicAuthenticationManager("username", null)); | |
- commitBuilder.addFile("file", ("$Author$\n" + "$Revision$\n" + "$Custom$\n").getBytes()); | |
- commitBuilder.setFileProperty("file", SVNProperty.KEYWORDS, SVNPropertyValue.create("Author Revision Custom=%a-%r")); | |
- commitBuilder.commit(); | |
- | |
- final File workingCopyDirectory = sandbox.createDirectory("wc"); | |
- | |
- final SvnCheckout checkout = svnOperationFactory.createCheckout(); | |
- checkout.setSource(SvnTarget.fromURL(url)); | |
- checkout.setSingleTarget(SvnTarget.fromFile(workingCopyDirectory)); | |
- checkout.run(); | |
- | |
- final File file = new File(workingCopyDirectory, "file"); | |
- final String fileContent = TestUtil.readFileContentsString(file); | |
- | |
- Assert.assertEquals("$Author: username $\n" + "$Revision: 1 $\n" + "$Custom: username-1 $\n", fileContent); | |
- } finally { | |
- svnOperationFactory.dispose(); | |
- sandbox.dispose(); | |
- } | |
- } | |
- | |
private String getTestName() { | |
return "SvnKeywordsTest"; | |
} | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/test/java/org/tmatesoft/svn/test/SvnLookTest.java modified-1.8/svnkit/src/test/java/org/tmatesoft/svn/test/SvnLookTest.java | |
--- upstream_trunk/svnkit/src/test/java/org/tmatesoft/svn/test/SvnLookTest.java 2014-07-01 03:14:18.779131365 +0000 | |
+++ modified-1.8/svnkit/src/test/java/org/tmatesoft/svn/test/SvnLookTest.java 2014-07-01 03:13:45.951133450 +0000 | |
@@ -5,19 +5,12 @@ | |
import org.junit.Test; | |
import org.tmatesoft.svn.core.SVNException; | |
import org.tmatesoft.svn.core.SVNURL; | |
-import org.tmatesoft.svn.core.internal.io.fs.FSFS; | |
-import org.tmatesoft.svn.core.internal.wc.SVNConfigFile; | |
import org.tmatesoft.svn.core.internal.wc.SVNFileUtil; | |
import org.tmatesoft.svn.core.wc.SVNClientManager; | |
import org.tmatesoft.svn.core.wc.SVNRevision; | |
-import org.tmatesoft.svn.core.wc.admin.ISVNChangeEntryHandler; | |
import org.tmatesoft.svn.core.wc.admin.ISVNChangedDirectoriesHandler; | |
-import org.tmatesoft.svn.core.wc.admin.SVNChangeEntry; | |
import org.tmatesoft.svn.core.wc.admin.SVNLookClient; | |
-import org.tmatesoft.svn.core.wc2.SvnGetInfo; | |
-import org.tmatesoft.svn.core.wc2.SvnInfo; | |
import org.tmatesoft.svn.core.wc2.SvnOperationFactory; | |
-import org.tmatesoft.svn.core.wc2.SvnTarget; | |
import org.tmatesoft.svn.core.wc2.admin.SvnRepositoryGetFileSize; | |
import java.io.File; | |
@@ -96,51 +89,6 @@ | |
} | |
} | |
- @Test | |
- public void testDeltaRepresentationHeader() throws Exception { | |
- //SVNKIT-504 | |
- final TestOptions options = TestOptions.getInstance(); | |
- Assume.assumeNotNull(options.getSvnCommand()); | |
- | |
- final SvnOperationFactory svnOperationFactory = new SvnOperationFactory(); | |
- final Sandbox sandbox = Sandbox.createWithCleanup(getTestName() + ".testDeltaRepresentationHeader", options); | |
- try { | |
- final SVNURL url = sandbox.createSvnRepository(); | |
- | |
- final String enableDirDeltification = "enable-dir-deltification"; | |
- final String enablePropsDeltification = "enable-props-deltification"; | |
- | |
- final File repositoryRoot = new File(url.getPath()); | |
- final File dbDirectory = new File(repositoryRoot, FSFS.DB_DIR); | |
- final File fsfsConfigFile = new File(dbDirectory, FSFS.PATH_CONFIG); | |
- | |
- final SVNConfigFile fsfsConfig = new SVNConfigFile(fsfsConfigFile); | |
- fsfsConfig.setPropertyValue("deltification", enableDirDeltification, "true", false); | |
- fsfsConfig.setPropertyValue("deltification", enablePropsDeltification, "true", false); | |
- fsfsConfig.save(); | |
- | |
- final String svnCommand = options.getSvnCommand(); | |
- SVNFileUtil.execCommand(new String[] {svnCommand, "mkdir", url.appendPath("trunk", false).toString(), "-m", "m"}); | |
- | |
- SVNClientManager clientManager = SVNClientManager.newInstance(); | |
- try { | |
- final SVNLookClient lookClient = clientManager.getLookClient(); | |
- | |
- lookClient.doGetChanged(repositoryRoot, SVNRevision.create(1), new ISVNChangeEntryHandler() { | |
- public void handleEntry(SVNChangeEntry entry) throws SVNException { | |
- Assert.assertEquals("/trunk", entry.getPath()); | |
- } | |
- }, true); | |
- } finally { | |
- clientManager.dispose(); | |
- } | |
- | |
- } finally { | |
- svnOperationFactory.dispose(); | |
- sandbox.dispose(); | |
- } | |
- } | |
- | |
private String getTestName() { | |
return "SvnLookTest"; | |
} | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit/src/test/java/org/tmatesoft/svn/test/UpgradeTest.java modified-1.8/svnkit/src/test/java/org/tmatesoft/svn/test/UpgradeTest.java | |
--- upstream_trunk/svnkit/src/test/java/org/tmatesoft/svn/test/UpgradeTest.java 2014-07-01 03:14:18.795131046 +0000 | |
+++ modified-1.8/svnkit/src/test/java/org/tmatesoft/svn/test/UpgradeTest.java 2014-07-01 03:13:45.951133450 +0000 | |
@@ -11,8 +11,6 @@ | |
import org.tmatesoft.sqljet.core.table.SqlJetDb; | |
import org.tmatesoft.svn.core.*; | |
import org.tmatesoft.svn.core.internal.wc.SVNFileUtil; | |
-import org.tmatesoft.svn.core.internal.wc.admin.SVNAdminArea15; | |
-import org.tmatesoft.svn.core.internal.wc.admin.SVNAdminArea16; | |
import org.tmatesoft.svn.core.internal.wc17.SVNWCContext; | |
import org.tmatesoft.svn.core.internal.wc17.SVNWCUtils; | |
import org.tmatesoft.svn.core.internal.wc17.db.ISVNWCDb; | |
@@ -273,7 +271,6 @@ | |
public void handleEvent(SVNEvent event, double progress) throws SVNException { | |
events.add(event); | |
} | |
- | |
public void checkCancelled() throws SVNCancelException { | |
} | |
}); | |
@@ -292,165 +289,6 @@ | |
} | |
} | |
- @Test | |
- public void testUpgradeWC16toWC17() throws Exception { | |
- final TestOptions options = TestOptions.getInstance(); | |
- | |
- final SvnOperationFactory svnOperationFactory = new SvnOperationFactory(); | |
- final Sandbox sandbox = Sandbox.createWithCleanup(getTestName() + ".testUpgradeWC16toWC17", options); | |
- try { | |
- final SVNURL url = sandbox.createSvnRepository(); | |
- | |
- final CommitBuilder commitBuilder1 = new CommitBuilder(url); | |
- commitBuilder1.addFile("file", "base".getBytes()); | |
- commitBuilder1.commit(); | |
- | |
- final CommitBuilder commitBuilder2 = new CommitBuilder(url); | |
- commitBuilder2.changeFile("file", "theirs".getBytes()); | |
- commitBuilder2.commit(); | |
- | |
- final WorkingCopy workingCopy = sandbox.checkoutNewWorkingCopy(url, 1, false, SvnWcGeneration.V16); | |
- final File workingCopyDirectory = workingCopy.getWorkingCopyDirectory(); | |
- final File file = workingCopy.getFile("file"); | |
- TestUtil.writeFileContentsString(file, "ours"); | |
- | |
- final SvnUpdate update = svnOperationFactory.createUpdate(); | |
- update.setSingleTarget(SvnTarget.fromFile(workingCopyDirectory)); | |
- update.run(); | |
- | |
- final SvnUpgrade upgrade = svnOperationFactory.createUpgrade(); | |
- upgrade.setTargetWorkingCopyFormat(ISVNWCDb.WC_FORMAT_17); | |
- upgrade.setSingleTarget(SvnTarget.fromFile(workingCopyDirectory)); | |
- upgrade.run(); | |
- | |
- final SvnGetStatus getStatus = svnOperationFactory.createGetStatus(); | |
- getStatus.setSingleTarget(SvnTarget.fromFile(workingCopyDirectory)); | |
- final SvnStatus status = getStatus.run(); | |
- | |
- Map<File, SvnStatus> statuses = TestUtil.getStatuses(svnOperationFactory, workingCopyDirectory); | |
- Assert.assertEquals(ISVNWCDb.WC_FORMAT_17, status.getWorkingCopyFormat()); | |
- Assert.assertTrue(statuses.get(file).isConflicted()); | |
- | |
- } finally { | |
- svnOperationFactory.dispose(); | |
- sandbox.dispose(); | |
- } | |
- } | |
- | |
- @Test | |
- public void testUpgradeWC15toWC17() throws Exception { | |
- final TestOptions options = TestOptions.getInstance(); | |
- | |
- final SvnOperationFactory svnOperationFactory = new SvnOperationFactory(); | |
- final Sandbox sandbox = Sandbox.createWithCleanup(getTestName() + ".testUpgradeWC15toWC17", options); | |
- try { | |
- final SVNURL url = sandbox.createSvnRepository(); | |
- | |
- final CommitBuilder commitBuilder1 = new CommitBuilder(url); | |
- commitBuilder1.addFile("file", "base".getBytes()); | |
- commitBuilder1.commit(); | |
- | |
- final CommitBuilder commitBuilder2 = new CommitBuilder(url); | |
- commitBuilder2.changeFile("file", "theirs".getBytes()); | |
- commitBuilder2.commit(); | |
- | |
- final File workingCopyDirectory = sandbox.createDirectory("wc"); | |
- final File file = new File(workingCopyDirectory, "file"); | |
- | |
- final SvnCheckout checkout = svnOperationFactory.createCheckout(); | |
- checkout.setSource(SvnTarget.fromURL(url)); | |
- checkout.setSingleTarget(SvnTarget.fromFile(workingCopyDirectory)); | |
- checkout.setRevision(SVNRevision.create(1)); | |
- checkout.setTargetWorkingCopyFormat(SVNAdminArea15.WC_FORMAT); | |
- checkout.run(); | |
- | |
- TestUtil.writeFileContentsString(file, "ours"); | |
- | |
- final SvnGetStatus getStatus15 = svnOperationFactory.createGetStatus(); | |
- getStatus15.setSingleTarget(SvnTarget.fromFile(workingCopyDirectory)); | |
- final SvnStatus status15 = getStatus15.run(); | |
- Assert.assertEquals(SVNAdminArea15.WC_FORMAT, status15.getWorkingCopyFormat()); | |
- | |
- final SvnUpdate update = svnOperationFactory.createUpdate(); | |
- update.setSingleTarget(SvnTarget.fromFile(workingCopyDirectory)); | |
- update.run(); | |
- | |
- final SvnUpgrade upgrade = svnOperationFactory.createUpgrade(); | |
- upgrade.setTargetWorkingCopyFormat(ISVNWCDb.WC_FORMAT_17); | |
- upgrade.setSingleTarget(SvnTarget.fromFile(workingCopyDirectory)); | |
- upgrade.run(); | |
- | |
- final SvnGetStatus getStatus = svnOperationFactory.createGetStatus(); | |
- getStatus.setSingleTarget(SvnTarget.fromFile(workingCopyDirectory)); | |
- final SvnStatus status = getStatus.run(); | |
- | |
- Map<File, SvnStatus> statuses = TestUtil.getStatuses(svnOperationFactory, workingCopyDirectory); | |
- Assert.assertEquals(ISVNWCDb.WC_FORMAT_17, status.getWorkingCopyFormat()); | |
- Assert.assertTrue(statuses.get(file).isConflicted()); | |
- | |
- } finally { | |
- svnOperationFactory.dispose(); | |
- sandbox.dispose(); | |
- } | |
- } | |
- | |
- @Test | |
- public void testUpgradeWC15toWC16() throws Exception { | |
- final TestOptions options = TestOptions.getInstance(); | |
- | |
- final SvnOperationFactory svnOperationFactory = new SvnOperationFactory(); | |
- final Sandbox sandbox = Sandbox.createWithCleanup(getTestName() + ".testUpgradeWC15toWC16", options); | |
- try { | |
- final SVNURL url = sandbox.createSvnRepository(); | |
- | |
- final CommitBuilder commitBuilder1 = new CommitBuilder(url); | |
- commitBuilder1.addFile("file", "base".getBytes()); | |
- commitBuilder1.commit(); | |
- | |
- final CommitBuilder commitBuilder2 = new CommitBuilder(url); | |
- commitBuilder2.changeFile("file", "theirs".getBytes()); | |
- commitBuilder2.commit(); | |
- | |
- final File workingCopyDirectory = sandbox.createDirectory("wc"); | |
- final File file = new File(workingCopyDirectory, "file"); | |
- | |
- final SvnCheckout checkout = svnOperationFactory.createCheckout(); | |
- checkout.setSource(SvnTarget.fromURL(url)); | |
- checkout.setSingleTarget(SvnTarget.fromFile(workingCopyDirectory)); | |
- checkout.setRevision(SVNRevision.create(1)); | |
- checkout.setTargetWorkingCopyFormat(SVNAdminArea15.WC_FORMAT); | |
- checkout.run(); | |
- | |
- TestUtil.writeFileContentsString(file, "ours"); | |
- | |
- final SvnGetStatus getStatus15 = svnOperationFactory.createGetStatus(); | |
- getStatus15.setSingleTarget(SvnTarget.fromFile(workingCopyDirectory)); | |
- final SvnStatus status15 = getStatus15.run(); | |
- Assert.assertEquals(SVNAdminArea15.WC_FORMAT, status15.getWorkingCopyFormat()); | |
- | |
- final SvnUpdate update = svnOperationFactory.createUpdate(); | |
- update.setSingleTarget(SvnTarget.fromFile(workingCopyDirectory)); | |
- update.run(); | |
- | |
- final SvnUpgrade upgrade = svnOperationFactory.createUpgrade(); | |
- upgrade.setTargetWorkingCopyFormat(SVNAdminArea16.WC_FORMAT); | |
- upgrade.setSingleTarget(SvnTarget.fromFile(workingCopyDirectory)); | |
- upgrade.run(); | |
- | |
- final SvnGetStatus getStatus = svnOperationFactory.createGetStatus(); | |
- getStatus.setSingleTarget(SvnTarget.fromFile(workingCopyDirectory)); | |
- final SvnStatus status = getStatus.run(); | |
- | |
- Map<File, SvnStatus> statuses = TestUtil.getStatuses(svnOperationFactory, workingCopyDirectory); | |
- Assert.assertEquals(SVNAdminArea16.WC_FORMAT, status.getWorkingCopyFormat()); | |
- Assert.assertTrue(statuses.get(file).isConflicted()); | |
- | |
- } finally { | |
- svnOperationFactory.dispose(); | |
- sandbox.dispose(); | |
- } | |
- } | |
- | |
private void checkout(SvnOperationFactory svnOperationFactory, SVNURL url, File wcngDirectory, SvnWcGeneration primaryWcGeneration) throws SVNException { | |
svnOperationFactory.setPrimaryWcGeneration(primaryWcGeneration); | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit-dav/src/main/java/org/tmatesoft/svn/core/internal/server/dav/DAVRepositoryManager.java modified-1.8/svnkit-dav/src/main/java/org/tmatesoft/svn/core/internal/server/dav/DAVRepositoryManager.java | |
--- upstream_trunk/svnkit-dav/src/main/java/org/tmatesoft/svn/core/internal/server/dav/DAVRepositoryManager.java 2014-07-01 03:14:16.786131332 +0000 | |
+++ modified-1.8/svnkit-dav/src/main/java/org/tmatesoft/svn/core/internal/server/dav/DAVRepositoryManager.java 2014-07-01 03:12:33.308137891 +0000 | |
@@ -172,14 +172,6 @@ | |
return SVNURL.parseURIEncoded(getResourceRepositoryRoot() + getRepositoryRelativePath(url)); | |
} | |
- public SVNURL convertHttpToFile(String path) throws SVNException { | |
- String uri = DAVPathUtil.addLeadingSlash(path); | |
- if (!uri.startsWith(getResourceContext())) { | |
- SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, "Invalid path ''{0}'' requested", path), SVNLogType.NETWORK); | |
- } | |
- return SVNURL.parseURIEncoded(getResourceRepositoryRoot() + uri.substring(getResourceContext().length())); | |
- } | |
- | |
public String getRepositoryRelativePath(SVNURL url) throws SVNException { | |
String uri = getURI(url); | |
DAVResourceURI resourceURI = new DAVResourceURI(null, uri, null, false); | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit-dav/src/main/java/org/tmatesoft/svn/core/internal/server/dav/handlers/DAVUpdateHandler.java modified-1.8/svnkit-dav/src/main/java/org/tmatesoft/svn/core/internal/server/dav/handlers/DAVUpdateHandler.java | |
--- upstream_trunk/svnkit-dav/src/main/java/org/tmatesoft/svn/core/internal/server/dav/handlers/DAVUpdateHandler.java 2014-07-01 03:14:16.532131557 +0000 | |
+++ modified-1.8/svnkit-dav/src/main/java/org/tmatesoft/svn/core/internal/server/dav/handlers/DAVUpdateHandler.java 2014-07-01 03:12:33.321137733 +0000 | |
@@ -292,8 +292,7 @@ | |
myRequestedDepth = SVNDepth.INFINITY; | |
} | |
- SVNURL srcURL = getUpdateRequest().getSrcURL(); | |
- String srcPath = (srcURL != null) ? getRepositoryManager().getRepositoryRelativePath(srcURL) : getUpdateRequest().getSrcPath(); | |
+ String srcPath = getRepositoryManager().getRepositoryRelativePath(getUpdateRequest().getSrcURL()); | |
setAnchor(srcPath); | |
SVNURL dstURL = getUpdateRequest().getDstURL(); | |
@@ -307,8 +306,8 @@ | |
FSFS fsfs = getDAVResource().getFSFS(); | |
myRevisionRoot = fsfs.createRevisionRoot(targetRevision); | |
- | |
- SVNURL repositoryURL = (srcURL != null) ? getRepositoryManager().convertHttpToFile(srcURL) : getRepositoryManager().convertHttpToFile(getUpdateRequest().getSrcPath()); | |
+ | |
+ SVNURL repositoryURL = getRepositoryManager().convertHttpToFile(getUpdateRequest().getSrcURL()); | |
FSRepository repository = (FSRepository) SVNRepositoryFactory.create(repositoryURL); | |
FSTranslateReporter reporter = repository.beginReport(getRevision(), | |
@@ -660,9 +659,7 @@ | |
} else if (SVNProperty.COMMITTED_DATE.equals(name)) { | |
entry.setCommitedDate(value.getString()); | |
} else if (SVNProperty.LAST_AUTHOR.equals(name)) { | |
- if (value != null) { | |
- entry.setLastAuthor(value.getString()); | |
- } | |
+ entry.setLastAuthor(value.getString()); | |
} else if (SVNProperty.LOCK_TOKEN.equals(name) && value == null) { | |
entry.addRemovedProperty(name); | |
} | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit-dav/src/main/java/org/tmatesoft/svn/core/internal/server/dav/handlers/DAVUpdateRequest.java modified-1.8/svnkit-dav/src/main/java/org/tmatesoft/svn/core/internal/server/dav/handlers/DAVUpdateRequest.java | |
--- upstream_trunk/svnkit-dav/src/main/java/org/tmatesoft/svn/core/internal/server/dav/handlers/DAVUpdateRequest.java 2014-07-01 03:14:16.576130667 +0000 | |
+++ modified-1.8/svnkit-dav/src/main/java/org/tmatesoft/svn/core/internal/server/dav/handlers/DAVUpdateRequest.java 2014-07-01 03:12:33.322137598 +0000 | |
@@ -21,10 +21,7 @@ | |
import org.tmatesoft.svn.core.internal.io.dav.DAVElement; | |
import org.tmatesoft.svn.core.internal.server.dav.DAVPathUtil; | |
import org.tmatesoft.svn.core.internal.server.dav.DAVResource; | |
-import org.tmatesoft.svn.core.internal.util.SVNPathUtil; | |
-import org.tmatesoft.svn.core.internal.util.SVNURLUtil; | |
import org.tmatesoft.svn.core.internal.wc.SVNErrorManager; | |
-import org.tmatesoft.svn.core.wc2.SvnTarget; | |
import org.tmatesoft.svn.util.SVNLogType; | |
/** | |
@@ -46,7 +43,6 @@ | |
private boolean mySendAll = false; | |
private long myRevision = DAVResource.INVALID_REVISION; | |
- private String mySrcPath = null; | |
private SVNURL mySrcURL = null; | |
private SVNURL myDstURL = null; | |
private String myTarget = ""; | |
@@ -77,14 +73,6 @@ | |
myRevision = revision; | |
} | |
- public String getSrcPath() { | |
- return mySrcPath; | |
- } | |
- | |
- public void setSrcPath(String srcPath) { | |
- this.mySrcPath = srcPath; | |
- } | |
- | |
public SVNURL getSrcURL() { | |
return mySrcURL; | |
} | |
@@ -193,11 +181,7 @@ | |
assertNullCData(element, property); | |
String value = property.getFirstValue(false); | |
DAVPathUtil.testCanonical(value); | |
- if (SVNPathUtil.isURL(value)) { | |
- setSrcURL(SVNURL.parseURIEncoded(value)); | |
- } else { | |
- setSrcPath(value); | |
- } | |
+ setSrcURL(SVNURL.parseURIEncoded(value)); | |
} else if (element == DST_PATH) { | |
assertNullCData(element, property); | |
String value = property.getFirstValue(false); | |
@@ -237,7 +221,7 @@ | |
if (!isDepthRequested() && !isRecursiveRequested() && (getDepth() == SVNDepth.UNKNOWN)) { | |
setDepth(SVNDepth.INFINITY); | |
} | |
- if (getSrcURL() == null && getSrcPath() == null) { | |
+ if (getSrcURL() == null) { | |
SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, | |
"The request did not contain the '<src-path>' element.\nThis may indicate that your client is too old."), SVNLogType.NETWORK); | |
} | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit-dav/src/main/java/org/tmatesoft/svn/core/internal/server/dav/handlers/ServletDAVHandler.java modified-1.8/svnkit-dav/src/main/java/org/tmatesoft/svn/core/internal/server/dav/handlers/ServletDAVHandler.java | |
--- upstream_trunk/svnkit-dav/src/main/java/org/tmatesoft/svn/core/internal/server/dav/handlers/ServletDAVHandler.java 2014-07-01 03:14:16.534131461 +0000 | |
+++ modified-1.8/svnkit-dav/src/main/java/org/tmatesoft/svn/core/internal/server/dav/handlers/ServletDAVHandler.java 2014-07-01 03:12:33.323137650 +0000 | |
@@ -1770,7 +1770,7 @@ | |
CountingInputStream stream = null; | |
try { | |
mySAXParser = getSAXParserFactory().newSAXParser(); | |
- if (myRequest.getContentLength() > 0 || (myRequest.getContentLength() < 0 && "chunked".equalsIgnoreCase(myRequest.getHeader("Transfer-Encoding")))) { | |
+ if (myRequest.getContentLength() > 0) { | |
org.xml.sax.XMLReader reader = mySAXParser.getXMLReader(); | |
reader.setContentHandler(this); | |
reader.setDTDHandler(this); | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit-distribution/src/main/licenses/LICENSE-JNA.txt modified-1.8/svnkit-distribution/src/main/licenses/LICENSE-JNA.txt | |
--- upstream_trunk/svnkit-distribution/src/main/licenses/LICENSE-JNA.txt 2014-07-01 03:14:17.698131037 +0000 | |
+++ modified-1.8/svnkit-distribution/src/main/licenses/LICENSE-JNA.txt 2014-07-01 03:12:33.324137674 +0000 | |
@@ -1,12 +1,11 @@ | |
-This copy of JNA is licensed under the | |
-Apache (Software) License, version 2.0 ("the License"). | |
-See the License for details about distribution rights, and the | |
-specific rights regarding derivate works. | |
+Copyright (c) 2008 Timothy Wall, All Rights Reserved | |
-You may obtain a copy of the License at: | |
+This library is free software; you can redistribute it and/or | |
+modify it under the terms of the GNU Lesser General Public | |
+License as published by the Free Software Foundation; either | |
+version 2.1 of the License, or (at your option) any later version. | |
-http://www.apache.org/licenses/ | |
- | |
-A copy is also included in the downloadable source code package | |
-containing JNA, in file "ASL2.0", under the same directory | |
-as this file. | |
+This library is distributed in the hope that it will be useful, | |
+but WITHOUT ANY WARRANTY; without even the implied warranty of | |
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
+Lesser General Public License for more details. | |
\ No newline at end of file | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit-javahl-pom.xml modified-1.8/svnkit-javahl-pom.xml | |
--- upstream_trunk/svnkit-javahl-pom.xml 1970-01-01 00:00:00.000000000 +0000 | |
+++ modified-1.8/svnkit-javahl-pom.xml 2014-07-01 03:12:33.326137919 +0000 | |
@@ -0,0 +1,26 @@ | |
+<?xml version="1.0" encoding="UTF-8"?><project> | |
+ <modelVersion>4.0.0</modelVersion> | |
+ <groupId>org.tmatesoft.svnkit</groupId> | |
+ <artifactId>svnkit-javahl</artifactId> | |
+ <packaging>jar</packaging> | |
+ <version>%svnkit.version%</version> | |
+ <name>SVNKit JavaHL Implementation</name> | |
+ <description>JavaHL interface implemetation using SVNKit library</description> | |
+ <url>http://svnkit.com/</url> | |
+ <licenses> | |
+ <license> | |
+ <url>http://svnkit.com/license.html</url> | |
+ </license> | |
+ </licenses> | |
+ <distributionManagement> | |
+ <downloadUrl>http://svnkit.com/download/index.php</downloadUrl> | |
+ </distributionManagement> | |
+ <dependencies> | |
+ <dependency> | |
+ <groupId>org.tmatesoft.svnkit</groupId> | |
+ <artifactId>svnkit</artifactId> | |
+ <version>%svnkit.version%</version> | |
+ </dependency> | |
+ | |
+ </dependencies> | |
+</project> | |
\ No newline at end of file | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit-osgi/build.gradle modified-1.8/svnkit-osgi/build.gradle | |
--- upstream_trunk/svnkit-osgi/build.gradle 2014-07-01 03:14:17.882130477 +0000 | |
+++ modified-1.8/svnkit-osgi/build.gradle 2014-07-01 03:13:45.836133876 +0000 | |
@@ -48,7 +48,7 @@ | |
'Bundle-Activator' : 'org.tmatesoft.svn.core.SVNKitActivator', | |
'Bundle-ActivationPolicy' : 'lazy', | |
'Eclipse-BundleShape' : 'jar', | |
- 'Require-Bundle': 'net.java.dev.jna;bundle-version="[3.2.7,4.1.0]";resolution:=optional,' + | |
+ '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)"' | |
@@ -66,4 +66,4 @@ | |
p.dependencies.clear() | |
} | |
} | |
-} | |
+} | |
\ No newline at end of file | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit-test/configurations/svn17/default.properties modified-1.8/svnkit-test/configurations/svn17/default.properties | |
--- upstream_trunk/svnkit-test/configurations/svn17/default.properties 1970-01-01 00:00:00.000000000 +0000 | |
+++ modified-1.8/svnkit-test/configurations/svn17/default.properties 2014-07-01 03:13:45.837133864 +0000 | |
@@ -0,0 +1,11 @@ | |
+python.tests.suite=merge 81 | |
+ | |
+snapshot=true | |
+logAll=true | |
+ | |
+python.http=false | |
+python.svn=false | |
+python.file=true | |
+ | |
+python.tests.listOption=--list | |
+python.tests.pattern=^(merge|upgrade|mergeinfo|list|ls|mkdir|resolve|resolved|cleanup|import|changelist|cl|blame|praise|annotate|ann|copy|cp|move|mv|rename|ren|lock|unlock|log|cat|ps|pset|propset|pd|pdel|propdel|revert|rm|del|remove|delete|add|export|st|stat|status|co|checkout|up|update|ci|commit|info|pg|pget|propget|pl|plist|proplist|relocate|sw|switch)\\s.*$ | |
diff -ruN --exclude .git --exclude .svn upstream_trunk/svnkit.iml modified-1.8/svnkit.iml | |
--- upstream_trunk/svnkit.iml 1970-01-01 00:00:00.000000000 +0000 | |
+++ modified-1.8/svnkit.iml 2014-07-01 03:13:45.839133514 +0000 | |
@@ -0,0 +1,24 @@ | |
+<?xml version="1.0" encoding="UTF-8"?> | |
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> | |
+ <component name="NewModuleRootManager" inherit-compiler-output="false"> | |
+ <output url="file://$MODULE_DIR$/target/classes" /> | |
+ <output-test url="file://$MODULE_DIR$/target/test-classes" /> | |
+ <content url="file://$MODULE_DIR$"> | |
+ <sourceFolder url="file://$MODULE_DIR$/svnkit/src/main/java" isTestSource="false" /> | |
+ <sourceFolder url="file://$MODULE_DIR$/svnkit/src/main/resources" isTestSource="false" /> | |
+ <sourceFolder url="file://$MODULE_DIR$/svnkit/src/test/java" isTestSource="true" /> | |
+ <sourceFolder url="file://$MODULE_DIR$/svnkit/src/test/resources" isTestSource="true" /> | |
+ <excludeFolder url="file://$MODULE_DIR$/target" /> | |
+ </content> | |
+ <orderEntry type="inheritedJdk" /> | |
+ <orderEntry type="sourceFolder" forTests="false" /> | |
+ <orderEntry type="library" name="Maven: net.java.dev.jna:jna:3.4.0" level="project" /> | |
+ <orderEntry type="library" name="Maven: org.jenkins-ci:trilead-ssh2:build217-jenkins-3" level="project" /> | |
+ <orderEntry type="library" name="Maven: org.tmatesoft.sqljet:sqljet:1.1.0" level="project" /> | |
+ <orderEntry type="library" name="Maven: org.antlr:antlr-runtime:3.4" level="project" /> | |
+ <orderEntry type="library" name="Maven: de.regnis.q.sequence:sequence-library:1.0.1" level="project" /> | |
+ <orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.9" level="project" /> | |
+ <orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.1" level="project" /> | |
+ </component> | |
+</module> | |
+ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment