[SCM] svnclientadapter packaging branch, master, updated. debian/0.9.100-2-20-g1fe9041
Jakub Adam
jakub.adam at ktknet.cz
Fri Oct 12 21:22:01 UTC 2012
The following commit has been merged in the master branch:
commit 8a8d4a46410bd0f17cf99f736692457433e0a8ef
Author: Jakub Adam <jakub.adam at ktknet.cz>
Date: Sun Jun 17 22:59:39 2012 +0200
Imported Upstream version 1.8.11
diff --git a/.classpath b/.classpath
index d6de287..bafd39a 100644
--- a/.classpath
+++ b/.classpath
@@ -8,8 +8,8 @@
<classpathentry kind="src" output="classes/testcases" path="src/testcases"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="var" path="JUNIT_HOME/junit.jar"/>
- <classpathentry kind="lib" path="lib/svnjavahl.jar"/>
<classpathentry kind="lib" path="lib/ganymed.jar"/>
<classpathentry kind="lib" path="lib/svnkit.jar"/>
+ <classpathentry kind="lib" path="lib/svn-javahl.jar"/>
<classpathentry kind="output" path="classes/main"/>
</classpath>
diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs
index 52f3372..4641e96 100644
--- a/.settings/org.eclipse.jdt.core.prefs
+++ b/.settings/org.eclipse.jdt.core.prefs
@@ -1,12 +1,12 @@
-#Mon Aug 27 10:19:17 EDT 2007
+#Tue Apr 19 14:27:05 EDT 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.3
+org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=ignore
-org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/changelog.txt b/changelog.txt
index 630b702..7aac784 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -1,4 +1,4 @@
-
+- #1231: implemented the method 'CmdLineClientAdapter#copy(SVNUrl,SVNUrl,String,SVNRevision,boolean)'
- added ISVNStatus#isWcLocked() and ISVNStatus#isSwitched()
- removed the getRepositoryRoot() method from adapter interface
- added logMessage(url, paths[], ...)
diff --git a/src/commandline/org/tigris/subversion/svnclientadapter/commandline/CmdLineClientAdapter.java b/src/commandline/org/tigris/subversion/svnclientadapter/commandline/CmdLineClientAdapter.java
index 2fa956d..38c7b00 100644
--- a/src/commandline/org/tigris/subversion/svnclientadapter/commandline/CmdLineClientAdapter.java
+++ b/src/commandline/org/tigris/subversion/svnclientadapter/commandline/CmdLineClientAdapter.java
@@ -428,7 +428,7 @@ public class CmdLineClientAdapter extends AbstractClientAdapter {
try {
if (message == null)
message = "";
- _cmd.copy(toString(src), toString(dest), message, toString(rev));
+ _cmd.copy(toString(src), toString(dest), message, toString(rev), false);
} catch (CmdLineException e) {
throw SVNClientException.wrapException(e);
}
@@ -967,7 +967,7 @@ public class CmdLineClientAdapter extends AbstractClientAdapter {
try {
if (message == null)
message = "";
- _cmd.copy(toString(srcPath), toString(destUrl), message, null);
+ _cmd.copy(toString(srcPath), toString(destUrl), message, null, false);
} catch (CmdLineException e) {
throw SVNClientException.wrapException(e);
}
@@ -979,7 +979,7 @@ public class CmdLineClientAdapter extends AbstractClientAdapter {
public void copy(SVNUrl srcUrl, File destPath, SVNRevision revision)
throws SVNClientException {
try {
- _cmd.copy(toString(srcUrl), toString(destPath), null, toString(revision));
+ _cmd.copy(toString(srcUrl), toString(destPath), null, toString(revision), false);
} catch (CmdLineException e) {
throw SVNClientException.wrapException(e);
}
@@ -1695,9 +1695,13 @@ public class CmdLineClientAdapter extends AbstractClientAdapter {
public void copy(SVNUrl srcUrl, SVNUrl destUrl, String message,
SVNRevision revision, boolean makeParents)
throws SVNClientException {
- // TODO Auto-generated method stub
- notImplementedYet();
-
+ try {
+ if (message == null)
+ message = "";
+ _cmd.copy(toString(srcUrl), toString(destUrl), message, toString(revision), makeParents);
+ } catch (CmdLineException e) {
+ throw SVNClientException.wrapException(e);
+ }
}
public void diff(SVNUrl target, SVNRevision pegRevision,
diff --git a/src/commandline/org/tigris/subversion/svnclientadapter/commandline/SvnCommandLine.java b/src/commandline/org/tigris/subversion/svnclientadapter/commandline/SvnCommandLine.java
index 759beb7..dc33dee 100644
--- a/src/commandline/org/tigris/subversion/svnclientadapter/commandline/SvnCommandLine.java
+++ b/src/commandline/org/tigris/subversion/svnclientadapter/commandline/SvnCommandLine.java
@@ -234,8 +234,9 @@ public class SvnCommandLine extends CommandLine {
* @param dest Local path or URL to copy to.
* @param message Commit message.
* @param revision Optional revision to copy from.
+ * @param makeparents <code>true</code> <=> Create parents first when copying from source url to dest url.
*/
- void copy(String src, String dest, String message, String revision) throws CmdLineException {
+ void copy(String src, String dest, String message, String revision, boolean makeparents) throws CmdLineException {
setCommand(ISVNNotifyListener.Command.COPY, true);
CmdArguments args = new CmdArguments();
args.add("cp");
@@ -243,6 +244,9 @@ public class SvnCommandLine extends CommandLine {
args.add("-r");
args.add(validRev(revision));
}
+ if (makeparents) {
+ args.add("--parents");
+ }
if (message != null)
args.addLogMessage(message);
args.add(src);
diff --git a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/AbstractJhlClientAdapter.java b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/AbstractJhlClientAdapter.java
index 24e339a..b1d79c5 100644
--- a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/AbstractJhlClientAdapter.java
+++ b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/AbstractJhlClientAdapter.java
@@ -26,36 +26,31 @@ import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import java.util.StringTokenizer;
-import org.tigris.subversion.javahl.ClientException;
-import org.tigris.subversion.javahl.CopySource;
-import org.tigris.subversion.javahl.Depth;
-import org.tigris.subversion.javahl.DirEntry;
-import org.tigris.subversion.javahl.ErrorCodes;
-import org.tigris.subversion.javahl.Info;
-import org.tigris.subversion.javahl.Info2;
-import org.tigris.subversion.javahl.ListCallback;
-import org.tigris.subversion.javahl.Lock;
-import org.tigris.subversion.javahl.Mergeinfo;
-import org.tigris.subversion.javahl.NodeKind;
-import org.tigris.subversion.javahl.PromptUserPassword;
-import org.tigris.subversion.javahl.PropertyData;
-import org.tigris.subversion.javahl.Revision;
-import org.tigris.subversion.javahl.RevisionKind;
-import org.tigris.subversion.javahl.RevisionRange;
-import org.tigris.subversion.javahl.SVNClientInterface;
-import org.tigris.subversion.javahl.Status;
-import org.tigris.subversion.javahl.StatusCallback;
-import org.tigris.subversion.javahl.SubversionException;
+import org.apache.subversion.javahl.ClientException;
+import org.apache.subversion.javahl.ConflictResult;
+import org.apache.subversion.javahl.ISVNClient;
+import org.apache.subversion.javahl.SubversionException;
+import org.apache.subversion.javahl.callback.ListCallback;
+import org.apache.subversion.javahl.callback.StatusCallback;
+import org.apache.subversion.javahl.callback.UserPasswordCallback;
+import org.apache.subversion.javahl.types.CopySource;
+import org.apache.subversion.javahl.types.Depth;
+import org.apache.subversion.javahl.types.DirEntry;
+import org.apache.subversion.javahl.types.Lock;
+import org.apache.subversion.javahl.types.Mergeinfo;
+import org.apache.subversion.javahl.types.Revision;
+import org.apache.subversion.javahl.types.RevisionRange;
+import org.apache.subversion.javahl.types.Status;
import org.tigris.subversion.svnclientadapter.AbstractClientAdapter;
import org.tigris.subversion.svnclientadapter.ISVNAnnotations;
-import org.tigris.subversion.svnclientadapter.ISVNClientAdapter;
import org.tigris.subversion.svnclientadapter.ISVNConflictResolver;
import org.tigris.subversion.svnclientadapter.ISVNDirEntry;
import org.tigris.subversion.svnclientadapter.ISVNDirEntryWithLock;
@@ -69,9 +64,11 @@ import org.tigris.subversion.svnclientadapter.ISVNProgressListener;
import org.tigris.subversion.svnclientadapter.ISVNPromptUserPassword;
import org.tigris.subversion.svnclientadapter.ISVNProperty;
import org.tigris.subversion.svnclientadapter.ISVNStatus;
+import org.tigris.subversion.svnclientadapter.ISVNStatusCallback;
import org.tigris.subversion.svnclientadapter.SVNBaseDir;
import org.tigris.subversion.svnclientadapter.SVNClientException;
import org.tigris.subversion.svnclientadapter.SVNDiffSummary;
+import org.tigris.subversion.svnclientadapter.SVNDiffSummary.SVNDiffKind;
import org.tigris.subversion.svnclientadapter.SVNInfoUnversioned;
import org.tigris.subversion.svnclientadapter.SVNLogMessageCallback;
import org.tigris.subversion.svnclientadapter.SVNNodeKind;
@@ -82,7 +79,6 @@ import org.tigris.subversion.svnclientadapter.SVNScheduleKind;
import org.tigris.subversion.svnclientadapter.SVNStatusKind;
import org.tigris.subversion.svnclientadapter.SVNStatusUnversioned;
import org.tigris.subversion.svnclientadapter.SVNUrl;
-import org.tigris.subversion.svnclientadapter.SVNDiffSummary.SVNDiffKind;
import org.tigris.subversion.svnclientadapter.utils.Messages;
/**
@@ -95,10 +91,12 @@ import org.tigris.subversion.svnclientadapter.utils.Messages;
*/
public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
- protected SVNClientInterface svnClient;
+ protected ISVNClient svnClient;
protected JhlNotificationHandler notificationHandler;
protected JhlConflictResolver conflictResolver;
protected JhlProgressListener progressListener;
+
+ private String postCommitError;
public AbstractJhlClientAdapter() {
@@ -108,16 +106,20 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
* for users who want to directly use underlying javahl SVNClientInterface
* @return the SVNClientInterface instance
*/
- public SVNClientInterface getSVNClient() {
+ public ISVNClient getSVNClient() {
return svnClient;
}
/**
* the default prompter : never prompts the user
*/
- public static class DefaultPromptUserPassword implements PromptUserPassword {
+ public static class DefaultPromptUserPassword implements UserPasswordCallback {
- public String askQuestion(String realm, String question, boolean showAnswer) {
+ public int askTrustSSLServer(String info, boolean allowPermanently) {
+ return UserPasswordCallback.AcceptTemporary;
+ }
+
+ public String askQuestion(String realm, String question, boolean showAnswer) {
return "";
}
@@ -136,6 +138,19 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
public boolean prompt(String realm, String username) {
return false;
}
+
+ public boolean prompt(String realm, String username, boolean maySave) {
+ return false;
+ }
+
+ public String askQuestion(String realm, String question,
+ boolean showAnswer, boolean maySave) {
+ return null;
+ }
+
+ public boolean userAllowedSave() {
+ return false;
+ }
}
/* (non-Javadoc)
@@ -178,7 +193,7 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
* Register callback interface to supply username and password on demand
* @param prompt
*/
- public void setPromptUserPassword(PromptUserPassword prompt) {
+ public void setPromptUserPassword(UserPasswordCallback prompt) {
svnClient.setPrompt(prompt);
}
@@ -204,7 +219,7 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
notificationHandler.setCommand(ISVNNotifyListener.Command.ADD);
notificationHandler.logCommandLine("add -N "+file.toString());
notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(file));
- svnClient.add(fileToSVNPath(file, false), false);
+ svnClient.add(fileToSVNPath(file, false), Depth.infinity, false, true, true);
} catch (ClientException e) {
notificationHandler.logException(e);
throw new SVNClientException(e);
@@ -231,7 +246,9 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
(force?" --force":"")+
" "+dir.toString());
notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(dir));
- svnClient.add(fileToSVNPath(dir, false), recurse, force);
+ boolean noIgnores = false;
+ boolean addParents = true;
+ svnClient.add(fileToSVNPath(dir, false), Depth.infinityOrEmpty(recurse), force, noIgnores, addParents);
} catch (ClientException e) {
notificationHandler.logException(e);
throw new SVNClientException(e);
@@ -247,7 +264,7 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
SVNRevision revision,
boolean recurse)
throws SVNClientException {
- checkout(moduleName, destPath, revision, Depth.infinityOrImmediates(recurse), false, true);
+ checkout(moduleName, destPath, revision, Depth.infinityOrImmediates(recurse).ordinal(), false, true);
}
/* (non-Javadoc)
@@ -263,9 +280,10 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
throws SVNClientException {
try {
String url = moduleName.toString();
+ Depth d = JhlConverter.depth(depth);
notificationHandler.setCommand(ISVNNotifyListener.Command.CHECKOUT);
StringBuffer commandLine = new StringBuffer("checkout " + url +
- " -r " + revision.toString() + depthCommandLine(depth));
+ " -r " + revision.toString() + depthCommandLine(d));
if (ignoreExternals) commandLine.append(" --ignore-externals");
if (force) commandLine.append(" --force");
notificationHandler.logCommandLine(commandLine.toString());
@@ -275,7 +293,7 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
fileToSVNPath(destPath, false),
JhlConverter.convert(revision),
JhlConverter.convert(revision),
- depth,
+ d,
ignoreExternals,
force);
} catch (ClientException e) {
@@ -298,11 +316,12 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
public long commit(File[] paths, String message, boolean recurse, boolean keepLocks)
throws SVNClientException {
try {
+ postCommitError = null;
String fixedMessage = fixSVNString(message);
if (fixedMessage == null)
fixedMessage = "";
notificationHandler.setCommand(ISVNNotifyListener.Command.COMMIT);
- String[] files = new String[paths.length];
+ Set<String> files = new HashSet<String>(paths.length);
String commandLine = "commit -m \""+getFirstMessageLine(fixedMessage)+"\"";
if (!recurse)
commandLine+=" -N";
@@ -310,13 +329,17 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
commandLine+=" --no-unlock";
for (int i = 0; i < paths.length; i++) {
- files[i] = fileToSVNPath(paths[i], false);
+ files.add(fileToSVNPath(paths[i], false));
}
commandLine = appendPaths(commandLine, files);
notificationHandler.logCommandLine(commandLine);
notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(paths));
- long newRev = svnClient.commit(files, fixedMessage, recurse, keepLocks);
+ boolean keepChangeLists = false;
+ JhlCommitCallback callback = new JhlCommitCallback();
+ svnClient.commit(files, Depth.infinityOrEmpty(recurse), keepLocks, keepChangeLists, null, null, new JhlCommitMessage(fixedMessage), callback);
+ postCommitError = callback.getPostCommitError();
+ long newRev = callback.getRevision();
if (newRev > 0)
notificationHandler.logCompleted("Committed revision " + newRev + ".");
return newRev;
@@ -327,21 +350,17 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
}
+ public String getPostCommitError() {
+ return postCommitError;
+ }
+
/* (non-Javadoc)
* @see org.tigris.subversion.svnclientadapter.ISVNClientAdapter#getList(org.tigris.subversion.svnclientadapter.SVNUrl, org.tigris.subversion.svnclientadapter.SVNRevision, boolean)
*/
public ISVNDirEntry[] getList(SVNUrl url, SVNRevision revision, boolean recurse)
throws SVNClientException {
- try {
- notificationHandler.setCommand(ISVNNotifyListener.Command.LS);
- String commandLine = "list -r "+revision.toString()+(recurse?"-R":"")+" "+url.toString();
- notificationHandler.logCommandLine(commandLine);
- notificationHandler.setBaseDir(new File("."));
- return JhlConverter.convert(svnClient.list(url.toString(), JhlConverter.convert(revision), recurse));
- } catch (ClientException e) {
- notificationHandler.logException(e);
- throw new SVNClientException(e);
- }
+ String target = url.toString();
+ return list(target, revision, SVNRevision.HEAD, recurse);
}
/* (non-Javadoc)
@@ -349,16 +368,8 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
*/
public ISVNDirEntry[] getList(SVNUrl url, SVNRevision revision, SVNRevision pegRevision, boolean recurse)
throws SVNClientException {
- try {
- notificationHandler.setCommand(ISVNNotifyListener.Command.LS);
- String commandLine = "list -r "+revision.toString()+(recurse?"-R":"")+" "+url.toString();
- notificationHandler.logCommandLine(commandLine);
- notificationHandler.setBaseDir(new File("."));
- return JhlConverter.convert(svnClient.list(url.toString(), JhlConverter.convert(revision), JhlConverter.convert(pegRevision), recurse));
- } catch (ClientException e) {
- notificationHandler.logException(e);
- throw new SVNClientException(e);
- }
+ String target = url.toString();
+ return list(target, revision, pegRevision, recurse);
}
/* (non-Javadoc)
@@ -366,17 +377,8 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
*/
public ISVNDirEntry[] getList(File path, SVNRevision revision, boolean recurse)
throws SVNClientException {
- try {
- notificationHandler.setCommand(ISVNNotifyListener.Command.LS);
- String target = fileToSVNPath(path, false);
- String commandLine = "list -r "+revision.toString()+(recurse?"-R":"")+" "+path;
- notificationHandler.logCommandLine(commandLine);
- notificationHandler.setBaseDir(new File("."));
- return JhlConverter.convert(svnClient.list(target, JhlConverter.convert(revision), recurse));
- } catch (ClientException e) {
- notificationHandler.logException(e);
- throw new SVNClientException(e);
- }
+ String target = fileToSVNPath(path, false);
+ return list(target, revision, SVNRevision.HEAD, recurse);
}
/* (non-Javadoc)
@@ -384,27 +386,60 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
*/
public ISVNDirEntry[] getList(File path, SVNRevision revision, SVNRevision pegRevision, boolean recurse)
throws SVNClientException {
- try {
+ String target = fileToSVNPath(path, false);
+ return list(target, revision, pegRevision, recurse);
+ }
+
+ private ISVNDirEntry[] list(String path, SVNRevision revision, SVNRevision pegRevision, boolean recurse)
+ throws SVNClientException {
+ final List<JhlDirEntry> dirEntryList = new ArrayList<JhlDirEntry>();
+ ListCallback callback = new ListCallback() {
+ public void doEntry(DirEntry dirent, Lock lock) {
+ if (dirent.getPath().length() == 0)
+ {
+ if (dirent.getNodeKind() == org.apache.subversion.javahl.types.NodeKind.file)
+ {
+ String absPath = dirent.getAbsPath();
+ int lastSeparator = absPath.lastIndexOf('/');
+ String path = absPath.substring(lastSeparator,
+ absPath.length());
+ dirent.setPath(path);
+ }
+ else
+ {
+ // Don't add requested directory.
+ return;
+ }
+ }
+
+ dirEntryList.add(new JhlDirEntry(dirent));
+
+ }
+
+ };
+ try {
notificationHandler.setCommand(ISVNNotifyListener.Command.LS);
- String target = fileToSVNPath(path, false);
String commandLine = "list -r "+revision.toString()+(recurse?"-R":"")+" "+path;
notificationHandler.logCommandLine(commandLine);
- notificationHandler.setBaseDir(new File("."));
- return JhlConverter.convert(svnClient.list(target, JhlConverter.convert(revision), JhlConverter.convert(pegRevision), recurse));
- } catch (ClientException e) {
- notificationHandler.logException(e);
- throw new SVNClientException(e);
- }
+ notificationHandler.setBaseDir(new File("."));
+ svnClient.list(path, JhlConverter.convert(revision), JhlConverter.convert(pegRevision), Depth.infinityOrImmediates(recurse), DirEntry.Fields.all, false, callback);
+ } catch (ClientException e) {
+ notificationHandler.logException(e);
+ throw new SVNClientException(e);
+ }
+ ISVNDirEntry[] dirEntries = new ISVNDirEntry[dirEntryList.size()];
+ dirEntryList.toArray(dirEntries);
+ return dirEntries;
}
public ISVNDirEntryWithLock[] getListWithLocks(SVNUrl url, SVNRevision revision, SVNRevision pegRevision, boolean recurse)
throws SVNClientException {
- final List dirEntryList = new ArrayList();
+ final List<JhlDirEntryWithLock> dirEntryList = new ArrayList<JhlDirEntryWithLock>();
ListCallback callback = new ListCallback() {
public void doEntry(DirEntry dirent, Lock lock) {
if (dirent.getPath().length() == 0)
{
- if (dirent.getNodeKind() == NodeKind.file)
+ if (dirent.getNodeKind() == org.apache.subversion.javahl.types.NodeKind.file)
{
String absPath = dirent.getAbsPath();
int lastSeparator = absPath.lastIndexOf('/');
@@ -420,7 +455,9 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
}
dirEntryList.add(new JhlDirEntryWithLock(dirent, lock));
- }
+
+ }
+
};
try {
notificationHandler.setCommand(ISVNNotifyListener.Command.LS);
@@ -513,26 +550,47 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
public ISVNStatus[] getStatus(File path, boolean descend, boolean getAll, boolean contactServer) throws SVNClientException {
return getStatus(path, descend, getAll, contactServer, false);
}
-
+
/* (non-Javadoc)
* @see org.tigris.subversion.svnclientadapter.ISVNClientAdapter#getStatus(java.io.File, boolean, boolean, boolean, boolean)
*/
public ISVNStatus[] getStatus(File path, boolean descend, boolean getAll, boolean contactServer, boolean ignoreExternals) throws SVNClientException {
+ return getStatus(path, descend, getAll, contactServer, ignoreExternals, null);
+ }
+
+ /* (non-Javadoc)
+ * @see org.tigris.subversion.svnclientadapter.ISVNClientAdapter#getStatus(java.io.File, boolean, boolean, boolean, boolean, ISVNStatusCallback)
+ */
+ public ISVNStatus[] getStatus(File path, boolean descend, boolean getAll, boolean contactServer, boolean ignoreExternals, ISVNStatusCallback callback) throws SVNClientException {
notificationHandler.setCommand(ISVNNotifyListener.Command.STATUS);
String filePathSVN = fileToSVNPath(path, false);
- int depth = Depth.unknownOrImmediates(descend); // If descend is true, recurse fully, else do only immediate children.
- notificationHandler.logCommandLine("status " + (contactServer?"-u ":"")+ depthCommandLine(depth) + filePathSVN);
+ Depth depth = Depth.unknownOrImmediates(descend); // If descend is true, recurse fully, else do only immediate children.
+ notificationHandler.logCommandLine("status" + (contactServer?" -u":"")+ depthCommandLine(depth) + " " + filePathSVN);
notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(path));
try {
- MyStatusCallback callback = new MyStatusCallback();
+ StatusCallback statusCallback;
+ if (callback == null) {
+ statusCallback = new MyStatusCallback();
+ }
+ else {
+ statusCallback = new JhlStatusCallback(callback);
+ }
svnClient.status(
filePathSVN,
depth,
contactServer, // If update is set, contact the repository and augment the status structures with information about out-of-dateness
getAll,getAll, // retrieve all entries; otherwise, retrieve only "interesting" entries (local mods and/or out-of-date).
- ignoreExternals, null, callback);
- return processFolderStatuses(processExternalStatuses(JhlConverter.convert(
- callback.getStatusArray())), getAll, contactServer); // if yes the svn:externals will be ignored
+ ignoreExternals, null, statusCallback);
+
+ List<Status> statusList = null;
+ if (statusCallback instanceof MyStatusCallback) {
+ statusList = ((MyStatusCallback)statusCallback).getStatusList();
+ }
+ else {
+ statusList = ((JhlStatusCallback)statusCallback).getStatusList();
+ }
+ return processFolderStatuses(processExternalStatuses(JhlConverter.convertStatus(
+ statusList, svnClient)), getAll, contactServer); // if yes the svn:externals will be ignored
} catch (ClientException e) {
if (e.getAprError() == ErrorCodes.wcNotDirectory) {
// when there is no .svn dir, an exception is thrown ...
@@ -549,16 +607,19 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
*/
private class MyStatusCallback implements StatusCallback
{
- private List statuses = new ArrayList();
+ public void doStatus(String path, Status status) {
+ // Status can be null, in which case you are supposed to use the
+ // String to construct an otherwise null status object. I am not sure
+ // of the use-case for this right now, so I am just going to discard them
+ if (status != null)
+ statuses.add(status);
+ }
- public void doStatus(Status status)
- {
- statuses.add(status);
- }
+ private List<Status> statuses = new ArrayList<Status>();
- public Status[] getStatusArray()
+ public List<Status> getStatusList()
{
- return (Status[]) statuses.toArray(new Status[statuses.size()]);
+ return statuses;
}
}
@@ -577,7 +638,7 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
protected JhlStatus[] processExternalStatuses(JhlStatus[] statuses) throws SVNClientException
{
//Collect indexes of external statuses
- List externalStatusesIndexes = new ArrayList();
+ List<Integer> externalStatusesIndexes = new ArrayList<Integer>();
for (int i = 0; i < statuses.length; i++) {
if (SVNStatusKind.EXTERNAL.equals(statuses[i].getTextStatus())) {
externalStatusesIndexes.add(new Integer(i));
@@ -589,28 +650,17 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
}
//Wrap the "second" externals so their textStatus is actually external
- for (Iterator iter = externalStatusesIndexes.iterator(); iter.hasNext();) {
- int index = ((Integer) iter.next()).intValue();
+ for (Integer integer : externalStatusesIndexes) {
+ int index = integer.intValue();
JhlStatus jhlStatus = statuses[index];
for (int i = 0; i < statuses.length; i++) {
if ((statuses[i].getPath() != null) && (statuses[i].getPath().equals(jhlStatus.getPath()))) {
- statuses[i] = new JhlStatus.JhlStatusExternal(statuses[i]);
+ statuses[i] = new JhlStatus.JhlStatusExternal(statuses[i], svnClient);
statuses[index] = statuses[i];
}
}
}
- //Fill the missing urls
- for (Iterator iter = externalStatusesIndexes.iterator(); iter.hasNext();) {
- int index = ((Integer) iter.next()).intValue();
- JhlStatus jhlStatus = statuses[index];
- if ((jhlStatus.getUrlString() == null) || (jhlStatus.getUrlString().length() == 0)) {
- ISVNInfo info = getInfoFromWorkingCopy(jhlStatus.getFile());
- if (info != null) {
- statuses[index] = new JhlStatus.JhlStatusExternal(jhlStatus, info.getUrlString());
- }
- }
- }
return statuses;
}
/**
@@ -623,7 +673,7 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
if (!getAll || !contactServer)
return statuses;
//Fill the missing last changed info on folders from the file info in the array
- List folders = new ArrayList();
+ List<JhlStatus> folders = new ArrayList<JhlStatus>();
for (int i = 0; i < statuses.length; i++) {
JhlStatus jhlStatus = statuses[i];
if (SVNNodeKind.DIR == jhlStatus.getNodeKind() && jhlStatus.getReposLastChangedRevision() == null) {
@@ -633,9 +683,8 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
for (int i = 0; i < statuses.length; i++) {
JhlStatus jhlStatus = statuses[i];
if (jhlStatus.getLastChangedRevision() != null) {
- for (Iterator iter = folders.iterator(); iter.hasNext();) {
- JhlStatus folder = (JhlStatus) iter.next();
- if (jhlStatus.getUrlString().startsWith(folder.getUrlString() + "/")) {
+ for (JhlStatus folder : folders) {
+ if (jhlStatus.getUrlString() != null && jhlStatus.getUrlString().startsWith(folder.getUrlString() + "/")) {
if (folder.getLastChangedRevision() == null ||
folder.getLastChangedRevision().getNumber() < jhlStatus.getLastChangedRevision().getNumber()) {
folder.updateFromStatus(jhlStatus);
@@ -659,8 +708,9 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
notificationHandler.logCommandLine("copy " + src + " " + dest);
notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(new File[] {srcPath,destPath }));
- CopySource[] copySources = { new CopySource(src, Revision.WORKING, Revision.WORKING) };
- svnClient.copy(copySources, dest, null, true, true, null);
+ List<CopySource> copySources = new ArrayList<CopySource>();
+ copySources.add(new CopySource(src, Revision.WORKING, Revision.WORKING));
+ svnClient.copy(copySources, dest, true, true, false, null, null, null);
} catch (ClientException e) {
notificationHandler.logException(e);
@@ -682,7 +732,9 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
String dest = destUrl.toString();
notificationHandler.logCommandLine("copy " + src + " " + dest);
notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(srcPath));
- svnClient.copy(src, dest, fixedMessage, Revision.WORKING);
+ List<CopySource> copySources = new ArrayList<CopySource>();
+ copySources.add(new CopySource(src, Revision.WORKING, Revision.WORKING));
+ svnClient.copy(copySources, dest, true, true, true, null, new JhlCommitMessage(fixedMessage), null);
// last parameter is not used
} catch (ClientException e) {
notificationHandler.logException(e);
@@ -712,19 +764,19 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
if (fixedMessage == null)
fixedMessage = "";
notificationHandler.setCommand(ISVNNotifyListener.Command.COPY);
- CopySource[] copySources = new CopySource[srcPaths.length];
+ List<CopySource> copySources = new ArrayList<CopySource>(srcPaths.length);
for (int i = 0; i < srcPaths.length; i++)
- copySources[i] = new CopySource(fileToSVNPath(srcPaths[i], false), Revision.WORKING, Revision.WORKING);
+ copySources.add(new CopySource(fileToSVNPath(srcPaths[i], false), Revision.WORKING, Revision.WORKING));
String dest = destUrl.toString();
String commandLine = "copy";
- String[] paths = new String[srcPaths.length];
+ Set<String> paths = new HashSet<String>(srcPaths.length);
for (int i = 0; i < srcPaths.length; i++) {
- paths[i] = fileToSVNPath(srcPaths[i], false);
+ paths.add(fileToSVNPath(srcPaths[i], false));
}
commandLine = appendPaths(commandLine, paths) + " " + dest;
notificationHandler.logCommandLine(commandLine.toString());
notificationHandler.setBaseDir();
- svnClient.copy(copySources, dest, fixedMessage, copyAsChild, makeParents, null);
+ svnClient.copy(copySources, dest, copyAsChild, makeParents, true, null, new JhlCommitMessage(fixedMessage), null);
} catch (ClientException e) {
notificationHandler.logException(e);
throw new SVNClientException(e);
@@ -755,10 +807,11 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
try {
notificationHandler.setCommand(ISVNNotifyListener.Command.COPY);
String dest = fileToSVNPath(destPath, false);
- CopySource[] sources = { new CopySource(srcUrl.toString(), JhlConverter.convert(revision), JhlConverter.convert(pegRevision)) };
+ List<CopySource> copySources = new ArrayList<CopySource>();
+ copySources.add(new CopySource(srcUrl.toString(), JhlConverter.convert(revision), JhlConverter.convert(pegRevision)));
notificationHandler.logCommandLine("copy " + srcUrl + " " + dest);
notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(destPath));
- svnClient.copy(sources, dest, null, copyAsChild, makeParents, null);
+ svnClient.copy(copySources, dest, copyAsChild, makeParents, true, null, null, null);
} catch (ClientException e) {
notificationHandler.logException(e);
throw new SVNClientException(e);
@@ -807,18 +860,18 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
if (fixedMessage == null)
fixedMessage = "";
notificationHandler.setCommand(ISVNNotifyListener.Command.COPY);
- CopySource[] copySources = new CopySource[srcUrls.length];
- for (int i = 0; i < srcUrls.length; i++) copySources[i] = new CopySource(srcUrls[i].toString(), JhlConverter.convert(revision), JhlConverter.convert(SVNRevision.HEAD));
+ List<CopySource> copySources = new ArrayList<CopySource>(srcUrls.length);
+ for (int i = 0; i < srcUrls.length; i++) copySources.add(new CopySource(srcUrls[i].toString(), JhlConverter.convert(revision), JhlConverter.convert(SVNRevision.HEAD)));
String dest = destUrl.toString();
String commandLine = "copy -r" + revision.toString();
- String[] paths = new String[srcUrls.length];
+ Set<String> paths = new HashSet<String>(srcUrls.length);
for (int i = 0; i < srcUrls.length; i++) {
- paths[i] = srcUrls[i].toString();
+ paths.add(srcUrls[i].toString());
}
commandLine = appendPaths(commandLine, paths) + " " + dest;
notificationHandler.logCommandLine(commandLine);
notificationHandler.setBaseDir();
- svnClient.copy(copySources, dest, fixedMessage, copyAsChild, makeParents, null);
+ svnClient.copy(copySources, dest, copyAsChild, makeParents, true, null, new JhlCommitMessage(fixedMessage), null);
} catch (ClientException e) {
notificationHandler.logException(e);
throw new SVNClientException(e);
@@ -838,14 +891,14 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
String commandLine = "delete -m \""+getFirstMessageLine(fixedMessage)+"\"";
- String targets[] = new String[url.length];
+ Set<String> targets = new HashSet<String>(url.length);
for (int i = 0; i < url.length;i++) {
- targets[i] = url[i].toString();
+ targets.add(url[i].toString());
}
commandLine = appendPaths(commandLine, targets);
notificationHandler.logCommandLine(commandLine);
notificationHandler.setBaseDir();
- svnClient.remove(targets,fixedMessage,false);
+ svnClient.remove(targets,false, false, null, new JhlCommitMessage(fixedMessage), null);
} catch (ClientException e) {
notificationHandler.logException(e);
@@ -861,17 +914,17 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
notificationHandler.setCommand(ISVNNotifyListener.Command.REMOVE);
String commandLine = "delete"+(force?" --force":"");
- String targets[] = new String[file.length];
+ Set<String> targets = new HashSet<String>(file.length);
for (int i = 0; i < file.length;i++) {
- targets[i] = fileToSVNPath(file[i], false);
+ targets.add(fileToSVNPath(file[i], false));
}
commandLine = appendPaths(commandLine, targets);
notificationHandler.logCommandLine(commandLine);
notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(file));
- svnClient.remove(targets,"",force);
+ svnClient.remove(targets, force, false, null, null, null);
} catch (ClientException e) {
notificationHandler.logException(e);
throw new SVNClientException(e);
@@ -894,7 +947,7 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
notificationHandler.logCommandLine(
"export -r " + revision.toString() + ' ' + src + ' ' + dest);
notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(destPath));
- svnClient.doExport(src, dest, JhlConverter.convert(revision), force);
+ svnClient.doExport(src, dest, JhlConverter.convert(revision), Revision.HEAD, force, false, Depth.infinity, null);
} catch (ClientException e) {
notificationHandler.logException(e);
throw new SVNClientException(e);
@@ -913,7 +966,7 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
notificationHandler.logCommandLine("export " + src + ' ' + dest);
notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(new File[]{srcPath,destPath }));
// in this case, revision is not used but must be valid
- svnClient.doExport(src, dest, Revision.WORKING, force);
+ svnClient.doExport(src, dest, Revision.WORKING, Revision.BASE, force, false, Depth.infinity, null);
} catch (ClientException e) {
notificationHandler.logException(e);
throw new SVNClientException(e);
@@ -946,7 +999,7 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
+ ' '
+ dest);
notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(path));
- svnClient.doImport(src, dest, fixedMessage, recurse);
+ svnClient.doImport(src, dest, Depth.infinityOrEmpty(recurse), false, true, null, new JhlCommitMessage(fixedMessage), null);
notificationHandler.logCompleted(Messages.bind("notify.import.complete"));
} catch (ClientException e) {
notificationHandler.logException(e);
@@ -967,11 +1020,12 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
public void mkdir(File file) throws SVNClientException {
try {
notificationHandler.setCommand(ISVNNotifyListener.Command.MKDIR);
- String target = fileToSVNPath(file, false);
+ Set<String> target = new HashSet<String>();
+ target.add(fileToSVNPath(file, false));
notificationHandler.logCommandLine(
"mkdir "+target);
notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(file));
- svnClient.mkdir(new String[] { target },"");
+ svnClient.mkdir(target, false, null, null, null);
} catch (ClientException e) {
notificationHandler.logException(e);
throw new SVNClientException(e);
@@ -985,12 +1039,13 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
// use force when you want to move file even if there are local modifications
try {
notificationHandler.setCommand(ISVNNotifyListener.Command.MOVE);
- String src = fileToSVNPath(srcPath, false);
+ Set<String> src = new HashSet<String>();
+ src.add(fileToSVNPath(srcPath, false));
String dest = fileToSVNPath(destPath, false);
notificationHandler.logCommandLine(
- "move "+src+' '+dest);
+ "move "+fileToSVNPath(srcPath, false)+' '+dest);
notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(new File[] {srcPath, destPath}));
- svnClient.move(src,dest,"",force);
+ svnClient.move(src,dest,force, false, false,null,null,null);
} catch (ClientException e) {
notificationHandler.logException(e);
throw new SVNClientException(e);
@@ -1014,17 +1069,18 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
if (fixedMessage == null)
fixedMessage = "";
notificationHandler.setCommand(ISVNNotifyListener.Command.MOVE);
- String src = srcUrl.toString();
+ Set<String> src = new HashSet<String>();
+ src.add(srcUrl.toString());
String dest = destUrl.toString();
notificationHandler.logCommandLine(
"move -m \""
+ getFirstMessageLine(fixedMessage)
+ ' '
- + src
+ + srcUrl.toString()
+ ' '
+ dest);
notificationHandler.setBaseDir();
- svnClient.move(src, dest, fixedMessage, false);
+ svnClient.move(src, dest, false, false, false, null, new JhlCommitMessage(fixedMessage), null);
} catch (ClientException e) {
notificationHandler.logException(e);
throw new SVNClientException(e);
@@ -1036,7 +1092,7 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
*/
public long update(File path, SVNRevision revision, boolean recurse)
throws SVNClientException {
- return update(path, revision, Depth.unknownOrFiles(recurse), false, false, true);
+ return update(path, revision, Depth.unknownOrFiles(recurse).ordinal(), false, false, true);
}
/* (non-Javadoc)
@@ -1046,20 +1102,25 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
throws SVNClientException {
try {
notificationHandler.setCommand(ISVNNotifyListener.Command.UPDATE);
- String target = fileToSVNPath(path, false);
+ Set<String> target = new HashSet<String>();
+ String t = fileToSVNPath(path, false);
+ target.add(t);
+ Depth d = JhlConverter.depth(depth);
StringBuffer commandLine;
- if (depth == Depth.exclude)
- commandLine = new StringBuffer("update " + target + " --set-depth=exclude");
+ if (d == Depth.exclude)
+ commandLine = new StringBuffer("update " + t + " --set-depth=exclude");
else {
- commandLine = new StringBuffer("update " + target + " -r " +
- revision.toString() + depthCommandLine(depth));
+ commandLine = new StringBuffer("update " + t + " -r " +
+ revision.toString() + depthCommandLine(d));
if (ignoreExternals) commandLine.append(" --ignore-externals");
if (force) commandLine.append(" --force");
}
notificationHandler.logCommandLine(commandLine.toString());
notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(path));
- return svnClient.update(target, JhlConverter.convert(revision), depth, setDepth,
- ignoreExternals, force);
+ boolean makeParents = false;
+ long rev[] = svnClient.update(target, JhlConverter.convert(revision), d, setDepth,
+ makeParents, ignoreExternals, force);
+ return rev[0];
} catch (ClientException e) {
notificationHandler.logException(e);
throw new SVNClientException(e);
@@ -1072,7 +1133,7 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
public long[] update(File[] path, SVNRevision revision, boolean recurse, boolean ignoreExternals)
throws SVNClientException
{
- return update(path, revision, Depth.unknownOrFiles(recurse), false, ignoreExternals, true);
+ return update(path, revision, Depth.unknownOrFiles(recurse).ordinal(), false, ignoreExternals, true);
}
/* (non-Javadoc)
@@ -1083,21 +1144,20 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
{
try {
notificationHandler.setCommand(ISVNNotifyListener.Command.UPDATE);
- String[] targets = new String[path.length];
- StringBuffer targetsString = new StringBuffer();
- for (int i = 0; i < targets.length; i++) {
- targets[i] = fileToSVNPath(path[i], false);
- targetsString.append(targets[i]);
- targetsString.append(" ");
+ Set<String> targets = new HashSet<String>(path.length);
+ for (int i = 0; i < path.length; i++) {
+ targets.add(fileToSVNPath(path[i], false));
}
- StringBuffer commandLine = new StringBuffer("update " + targetsString.toString() + " -r " +
- revision.toString() + depthCommandLine(depth));
+ Depth d = JhlConverter.depth(depth);
+ StringBuffer commandLine = new StringBuffer(appendPaths("update ", targets) + " -r " +
+ revision.toString() + depthCommandLine(d));
if (ignoreExternals) commandLine.append(" --ignore-externals");
if (force) commandLine.append(" --force");
notificationHandler.logCommandLine(commandLine.toString());
notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(path));
notificationHandler.holdStats();
- long[] rtnCode = svnClient.update(targets, JhlConverter.convert(revision), depth, setDepth, ignoreExternals, force);
+ boolean makeParents = false;
+ long[] rtnCode = svnClient.update(targets, JhlConverter.convert(revision), d, setDepth, makeParents, ignoreExternals, force);
notificationHandler.releaseStats();
return rtnCode;
} catch (ClientException e) {
@@ -1118,7 +1178,7 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
(recurse?"":"-N ")+
target);
notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(path));
- svnClient.revert(target,recurse);
+ svnClient.revert(target,Depth.infinityOrEmpty(recurse), null);
} catch (ClientException e) {
notificationHandler.logException(e);
throw new SVNClientException(e);
@@ -1185,7 +1245,7 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
if (status.getTextStatus().equals(SVNStatusKind.ADDED))
return new ByteArrayInputStream(new byte[0]);
}
- byte[] contents = svnClient.fileContent(target, JhlConverter.convert(revision));
+ byte[] contents = svnClient.fileContent(target, JhlConverter.convert(revision), Revision.BASE);
InputStream input = new ByteArrayInputStream(contents);
return input;
} catch (ClientException e) {
@@ -1193,28 +1253,36 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
throw new SVNClientException(e);
}
}
+
+ /* (non-Javadoc)
+ * @see org.tigris.subversion.svnclientadapter.ISVNClientAdapter#getProperties(java.io.File)
+ */
+ public ISVNProperty[] getProperties(File path) throws SVNClientException {
+ return getProperties(path, false);
+ }
/* (non-Javadoc)
* @see org.tigris.subversion.svnclientadapter.ISVNClientAdapter#getProperties(java.io.File)
*/
- public ISVNProperty[] getProperties(File path) throws SVNClientException {
+ public ISVNProperty[] getProperties(File path, boolean descend) throws SVNClientException {
try {
notificationHandler.setCommand(ISVNNotifyListener.Command.PROPLIST);
String target = fileToSVNPath(path, false);
- notificationHandler.logCommandLine(
- "proplist "+ target);
- notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(path));
- PropertyData[] propertiesData = svnClient.properties(target);
- if (propertiesData == null) {
- // no properties
- return new JhlPropertyData[0];
+ StringBuffer commandLine = new StringBuffer("propList ");
+ if (descend) {
+ commandLine.append(" -R ");
}
- JhlPropertyData[] svnProperties = new JhlPropertyData[propertiesData.length];
- for (int i = 0; i < propertiesData.length;i++) {
- svnProperties[i] = JhlPropertyData.newForFile(propertiesData[i]);
+ commandLine.append(target);
+ notificationHandler.logCommandLine(commandLine.toString());
+ notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(path));
+ JhlProplistCallback callback = new JhlProplistCallback(true);
+ if (descend) {
+ svnClient.properties(target, null, null, Depth.infinity, null, callback);
+ } else {
+ svnClient.properties(target, null, null, Depth.empty, null, callback);
}
- return svnProperties;
+ return callback.getPropertyData();
} catch (ClientException e) {
notificationHandler.logException(e);
throw new SVNClientException(e);
@@ -1227,32 +1295,63 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
public ISVNProperty[] getProperties(SVNUrl url) throws SVNClientException {
return getProperties(url, SVNRevision.HEAD, SVNRevision.HEAD);
}
-
+
/* (non-Javadoc)
* @see org.tigris.subversion.svnclientadapter.ISVNClientAdapter#getProperties(org.tigris.subversion.svnclientadapter.SVNUrl)
*/
public ISVNProperty[] getProperties(SVNUrl url, SVNRevision revision, SVNRevision pegRevision) throws SVNClientException {
+ return getProperties(url, revision, pegRevision, true);
+ }
+
+ /* (non-Javadoc)
+ * @see org.tigris.subversion.svnclientadapter.ISVNClientAdapter#getProperties(org.tigris.subversion.svnclientadapter.SVNUrl)
+ */
+ public ISVNProperty[] getProperties(SVNUrl url, SVNRevision revision, SVNRevision pegRevision, boolean recurse) throws SVNClientException {
try {
notificationHandler.setCommand(ISVNNotifyListener.Command.PROPLIST);
String target = url.toString();
notificationHandler.logCommandLine(
"proplist "+ target);
notificationHandler.setBaseDir();
- PropertyData[] propertiesData = svnClient.properties(target, JhlConverter.convert(revision), JhlConverter.convert(pegRevision));
- if (propertiesData == null) {
- // no properties
- return new JhlPropertyData[0];
+ JhlProplistCallback callback = new JhlProplistCallback(false);
+ Depth depth;
+ if (recurse) {
+ depth = Depth.infinity;
}
- JhlPropertyData[] svnProperties = new JhlPropertyData[propertiesData.length];
- for (int i = 0; i < propertiesData.length;i++) {
- svnProperties[i] = JhlPropertyData.newForUrl(propertiesData[i]);
+ else {
+ depth = Depth.empty;
}
- return svnProperties;
+ svnClient.properties(target, JhlConverter.convert(revision), JhlConverter.convert(pegRevision), depth, null, callback);
+ return callback.getPropertyData();
} catch (ClientException e) {
notificationHandler.logException(e);
throw new SVNClientException(e);
}
}
+
+ /* (non-Javadoc)
+ * @see org.tigris.subversion.svnclientadapter.ISVNClientAdapter#propertySet(org.tigris.subversion.svnclientadapter.SVNUrl, org.tigris.subversion.svnclientadapter.SVNRevision.Number,java.lang.String, java.lang.String, java.lang.String)
+ */
+ public void propertySet(
+ SVNUrl url,
+ SVNRevision.Number baseRev,
+ String propertyName,
+ String propertyValue,
+ String message)
+ throws SVNClientException {
+ try {
+ notificationHandler.setCommand(ISVNNotifyListener.Command.PROPSET);
+ if (propertyName.startsWith("svn:")) {
+ // Normalize line endings in property value
+ svnClient.propertySetRemote(url.toString(), baseRev.getNumber(), propertyName, fixSVNString(propertyValue).getBytes(), new JhlCommitMessage(message), false, null, new JhlCommitCallback());
+ } else {
+ svnClient.propertySetRemote(url.toString(), baseRev.getNumber(), propertyName, propertyValue.getBytes(), new JhlCommitMessage(message), false, null, new JhlCommitCallback());
+ }
+ } catch (ClientException e) {
+ notificationHandler.logException(e);
+ throw new SVNClientException(e);
+ }
+ }
/* (non-Javadoc)
* @see org.tigris.subversion.svnclientadapter.ISVNClientAdapter#propertySet(java.io.File, java.lang.String, java.lang.String, boolean)
@@ -1277,20 +1376,23 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
+ target);
notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(path));
- Set statusBefore = null;
+ Set<String> statusBefore = null;
if (recurse) {
- statusBefore = new HashSet();
+ statusBefore = new HashSet<String>();
ISVNStatus[] statuses = getStatus(path,recurse,false);
for (int i = 0; i < statuses.length;i++) {
statusBefore.add(statuses[i].getFile().getAbsolutePath());
}
}
+ Set<String> paths = new HashSet<String>(1);
+ paths.add(target);
+
if (propertyName.startsWith("svn:")) {
// Normalize line endings in property value
- svnClient.propertySet(target, propertyName, fixSVNString(propertyValue), recurse);
+ svnClient.propertySetLocal(paths, propertyName, fixSVNString(propertyValue).getBytes(), Depth.infinityOrEmpty(recurse), null, false);
} else {
- svnClient.propertySet(target, propertyName, propertyValue, recurse);
+ svnClient.propertySetLocal(paths, propertyName, propertyValue.getBytes(), Depth.infinityOrEmpty(recurse), null, false);
}
// there is no notification (Notify.notify is not called) when we set a property
@@ -1302,8 +1404,8 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
notificationHandler.notifyListenersOfChange(statusPath);
statusBefore.remove(statusPath);
}
- for (Iterator it = statusBefore.iterator(); it.hasNext();)
- notificationHandler.notifyListenersOfChange((String)it.next());
+ for (String status : statusBefore)
+ notificationHandler.notifyListenersOfChange(status);
} else {
notificationHandler.notifyListenersOfChange(path.getAbsolutePath());
}
@@ -1356,16 +1458,19 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
}
}
- Set statusBefore = null;
+ Set<String> statusBefore = null;
if (recurse) {
- statusBefore = new HashSet();
+ statusBefore = new HashSet<String>();
ISVNStatus[] statuses = getStatus(path,recurse,false);
for (int i = 0; i < statuses.length;i++) {
statusBefore.add(statuses[i].getFile().getAbsolutePath());
}
}
+
+ Set<String> paths = new HashSet<String>(1);
+ paths.add(target);
- svnClient.propertySet(target, propertyName, propertyBytes, recurse);
+ svnClient.propertySetLocal(paths, propertyName, propertyBytes, Depth.infinityOrEmpty(recurse), null, false);
// there is no notification (Notify.notify is not called) when we set a property
// so we will do notification ourselves
@@ -1376,8 +1481,8 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
notificationHandler.notifyListenersOfChange(statusPath);
statusBefore.remove(statusPath);
}
- for (Iterator it = statusBefore.iterator(); it.hasNext();)
- notificationHandler.notifyListenersOfChange((String)it.next());
+ for (String status : statusBefore)
+ notificationHandler.notifyListenersOfChange(status);
} else {
notificationHandler.notifyListenersOfChange(path.getAbsolutePath());
}
@@ -1401,11 +1506,11 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
notificationHandler.logCommandLine(
"propget " + propertyName + " " + target);
notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(path));
- PropertyData propData = svnClient.propertyGet(target, propertyName);
- if (propData == null)
+ byte[] bytes = svnClient.propertyGet(target, propertyName, null, null);
+ if (bytes == null)
return null;
else
- return JhlPropertyData.newForFile(propData);
+ return JhlPropertyData.newForFile(target, propertyName, bytes);
} catch (ClientException e) {
notificationHandler.logException(e);
throw new SVNClientException(e);
@@ -1427,12 +1532,12 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
commandLine += "@" + peg.toString();
notificationHandler.logCommandLine(commandLine);
notificationHandler.setBaseDir();
- PropertyData propData = svnClient.propertyGet(target, propertyName, JhlConverter.convert(revision),
+ byte[] bytes = svnClient.propertyGet(target, propertyName, JhlConverter.convert(revision),
JhlConverter.convert(peg));
- if (propData == null)
+ if (bytes == null)
return null;
else
- return JhlPropertyData.newForUrl(propData);
+ return JhlPropertyData.newForUrl(target, propertyName, bytes);
} catch (ClientException e) {
notificationHandler.logException(e);
throw new SVNClientException(e);
@@ -1450,21 +1555,19 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
notificationHandler.logCommandLine("propdel "+propertyName+" "+target);
notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(path));
- Set statusBefore = null;
+ Set<String> statusBefore = null;
if (recurse) {
- statusBefore = new HashSet();
+ statusBefore = new HashSet<String>();
ISVNStatus[] statuses = getStatus(path,recurse,false);
for (int i = 0; i < statuses.length;i++) {
statusBefore.add(statuses[i].getFile().getAbsolutePath());
}
}
- // propertyRemove is on repository, this will be present on next version of javahl
- // svnClient.propertyRemove(target, propertyName,recurse);
- // @TODO : change this method when svnjavahl will be upgraded
- // for now we use this workaround
- PropertyData propData = svnClient.propertyGet(target,propertyName);
- propData.remove(recurse);
+ Set<String> paths = new HashSet<String>(1);
+ paths.add(target);
+
+ svnClient.propertySetLocal(paths, propertyName, null, Depth.infinityOrEmpty(recurse), null, true);
// there is no notification (Notify.notify is not called) when we set a property
// so we will do notification ourselves
@@ -1475,8 +1578,8 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
notificationHandler.notifyListenersOfChange(statusPath);
statusBefore.remove(statusPath);
}
- for (Iterator it = statusBefore.iterator(); it.hasNext();)
- notificationHandler.notifyListenersOfChange((String)it.next());
+ for (String status : statusBefore)
+ notificationHandler.notifyListenersOfChange(status);
} else {
notificationHandler.notifyListenersOfChange(path.getAbsolutePath());
}
@@ -1521,11 +1624,11 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
String relativeToDir = fileToSVNPath(relativeTo, false);
String commandLine = "diff ";
- if ( (oldPathRevision.getKind() != RevisionKind.base) ||
- (newPathRevision.getKind() != RevisionKind.working) )
+ if ( (oldPathRevision.getKind() != Revision.Kind.base.ordinal()) ||
+ (newPathRevision.getKind() != Revision.Kind.working.ordinal()) )
{
commandLine += "-r "+oldPathRevision.toString();
- if (newPathRevision.getKind() != RevisionKind.working)
+ if (newPathRevision.getKind() != Revision.Kind.working.ordinal())
commandLine+= ":"+newPathRevision.toString();
commandLine += " ";
}
@@ -1534,17 +1637,17 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
if (!newPath.equals(oldPath))
commandLine += "--new "+newTarget+" ";
- int depth = Depth.empty;
+ int depth = Depth.empty.ordinal();
if (recurse)
- depth = Depth.infinity;
+ depth = Depth.infinity.ordinal();
else {
if (oldPath.isFile())
- depth = Depth.files;
+ depth = Depth.files.ordinal();
}
notificationHandler.logCommandLine(commandLine);
notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(new File[]{oldPath,newPath}));
- svnClient.diff(oldTarget,JhlConverter.convert(oldPathRevision),newTarget,JhlConverter.convert(newPathRevision), relativeToDir, svnOutFile, depth, null, ignoreAncestry, noDiffDeleted, force);
+ svnClient.diff(oldTarget,JhlConverter.convert(oldPathRevision),newTarget,JhlConverter.convert(newPathRevision), relativeToDir, svnOutFile, JhlConverter.depth(depth), null, ignoreAncestry, noDiffDeleted, force, true);
} catch (ClientException e) {
notificationHandler.logException(e);
throw new SVNClientException(e);
@@ -1577,11 +1680,11 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
String svnOutFile = fileToSVNPath(outFile, false);
String commandLine = "diff ";
- if ( (oldPathRevision.getKind() != RevisionKind.base) ||
- (newPathRevision.getKind() != RevisionKind.working) )
+ if ( (oldPathRevision.getKind() != Revision.Kind.base.ordinal()) ||
+ (newPathRevision.getKind() != Revision.Kind.working.ordinal()) )
{
commandLine += "-r "+oldPathRevision.toString();
- if (newPathRevision.getKind() != RevisionKind.working)
+ if (newPathRevision.getKind() != Revision.Kind.working.ordinal())
commandLine+= ":"+newPathRevision.toString();
commandLine += " ";
}
@@ -1592,7 +1695,7 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
notificationHandler.logCommandLine(commandLine);
notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(new File[]{oldPath,newPath}));
- svnClient.diff(oldTarget,JhlConverter.convert(oldPathRevision),newTarget,JhlConverter.convert(newPathRevision), svnOutFile, recurse, ignoreAncestry, noDiffDeleted, force);
+ svnClient.diff(oldTarget,JhlConverter.convert(oldPathRevision),newTarget,JhlConverter.convert(newPathRevision), null, svnOutFile, Depth.infinityOrEmpty(recurse), null, ignoreAncestry, noDiffDeleted, force, true);
} catch (ClientException e) {
notificationHandler.logException(e);
throw new SVNClientException(e);
@@ -1633,14 +1736,15 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
endRevision = SVNRevision.HEAD;
String commandLine = "diff ";
- commandLine += depthCommandLine(depth);
+ Depth d = JhlConverter.depth(depth);
+ commandLine += depthCommandLine(d);
if (ignoreAncestry)
commandLine += " --ignoreAncestry";
commandLine += " -r " + startRevision + ":" + endRevision + " " + target;
notificationHandler.logCommandLine(commandLine);
notificationHandler.setBaseDir();
svnClient.diff(target.toString(), JhlConverter.convert(pegRevision), JhlConverter.convert(startRevision), JhlConverter.convert(endRevision),
- null, outFile.getAbsolutePath(), depth, null, ignoreAncestry, noDiffDeleted, force);
+ null, outFile.getAbsolutePath(), d, null, ignoreAncestry, noDiffDeleted, force, false);
} catch (ClientException e) {
notificationHandler.logException(e);
throw new SVNClientException(e);
@@ -1652,7 +1756,7 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
*/
public void diff(SVNUrl target, SVNRevision pegRevision, SVNRevision startRevision, SVNRevision endRevision,
File outFile, boolean recurse) throws SVNClientException {
- diff(target, pegRevision, startRevision, endRevision, outFile, Depth.infinityOrImmediates(recurse), true, false, false);
+ diff(target, pegRevision, startRevision, endRevision, outFile, Depth.infinityOrImmediates(recurse).ordinal(), true, false, false);
}
/* (non-Javadoc)
@@ -1675,11 +1779,11 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
String svnOutFile = fileToSVNPath(outFile, false);
String commandLine = "diff ";
- if ( (oldUrlRevision.getKind() != RevisionKind.head) ||
- (newUrlRevision.getKind() != RevisionKind.head) )
+ if ( (oldUrlRevision.getKind() != Revision.Kind.head.ordinal()) ||
+ (newUrlRevision.getKind() != Revision.Kind.head.ordinal()) )
{
commandLine += "-r "+oldUrlRevision.toString();
- if (newUrlRevision.getKind() != RevisionKind.head)
+ if (newUrlRevision.getKind() != Revision.Kind.head.ordinal())
commandLine+= ":"+newUrlRevision.toString();
commandLine += " ";
}
@@ -1689,7 +1793,7 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
notificationHandler.logCommandLine(commandLine);
notificationHandler.setBaseDir();
- svnClient.diff(oldUrl.toString(),JhlConverter.convert(oldUrlRevision),newUrl.toString(),JhlConverter.convert(newUrlRevision), svnOutFile, recurse, ignoreAncestry, noDiffDeleted, force);
+ svnClient.diff(oldUrl.toString(),JhlConverter.convert(oldUrlRevision),newUrl.toString(),JhlConverter.convert(newUrlRevision), null, svnOutFile, Depth.infinityOrEmpty(recurse), null, ignoreAncestry, noDiffDeleted, force, false);
} catch (ClientException e) {
notificationHandler.logException(e);
throw new SVNClientException(e);
@@ -1804,26 +1908,40 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
String target = fileToSVNPath(path, true);
String commandLine = "resolve ";
+ ConflictResult.Choice choice = ConflictResult.Choice.chooseMerged;
switch (result) {
case ISVNConflictResolver.Choice.chooseMerged:
commandLine += "--accept=working ";
+ choice = ConflictResult.Choice.chooseMerged;
break;
case ISVNConflictResolver.Choice.chooseBase:
commandLine += "--accept=base ";
+ choice = ConflictResult.Choice.chooseBase;
break;
case ISVNConflictResolver.Choice.chooseTheirsFull:
commandLine += "--accept=theirs-full ";
+ choice = ConflictResult.Choice.chooseTheirsFull;
break;
+ case ISVNConflictResolver.Choice.chooseTheirs:
+ commandLine += "--accept=theirs-conflict ";
+ choice = ConflictResult.Choice.chooseTheirsConflict;
+ break;
case ISVNConflictResolver.Choice.chooseMineFull:
commandLine += "--accept=mine-full ";
+ choice = ConflictResult.Choice.chooseMineFull;
break;
+ case ISVNConflictResolver.Choice.chooseMine:
+ commandLine += "--accept=mine-conflict ";
+ choice = ConflictResult.Choice.chooseMineConflict;
+ break;
default:
+ choice = ConflictResult.Choice.chooseMerged;
break;
}
commandLine += target;
notificationHandler.logCommandLine(commandLine);
notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(path));
- svnClient.resolve(target, Depth.empty, result);
+ svnClient.resolve(target, Depth.empty, choice);
} catch (SubversionException e) {
notificationHandler.logException(e);
throw new SVNClientException(e);
@@ -1854,12 +1972,14 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
String target = fileToSVNPath(path, false);
notificationHandler.logCommandLine("info "+target);
notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(path));
+ JhlInfoCallback callback = new JhlInfoCallback();
- Info info = svnClient.info(target);
- if (info == null) {
+ svnClient.info2(target, null, null, Depth.empty, null, callback);
+ ISVNInfo[] items = callback.getInfo();
+ if (items == null) {
return new SVNInfoUnversioned(path);
}
- return new JhlInfo(path, info);
+ return items[0];
} catch (ClientException e) {
notificationHandler.logException(e);
throw new SVNClientException(e);
@@ -1877,22 +1997,14 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
notificationHandler.logCommandLine("info "+target);
notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(path));
- //Call the simple info() first to check whether the resource actually exists in repositiory.
- //If yes, the call info2() later to get more data from the repository.
- Info info = svnClient.info(target);
- if (info == null) {
- return new SVNInfoUnversioned(path);
- } else if (info.getLastChangedRevision() == Revision.SVN_INVALID_REVNUM)
- {
- //Item is not in repository (yet or anymore ?)
- return new JhlInfo(path, info);
- }
+ JhlInfoCallback callback = new JhlInfoCallback();
- Info2[] info2 = svnClient.info2(target, Revision.HEAD, Revision.HEAD, false);
- if (info2 == null || info2.length == 0) {
+ svnClient.info2(target, Revision.WORKING, Revision.BASE, Depth.infinity, null, callback);
+ ISVNInfo[] items = callback.getInfo();
+ if (items == null || items.length == 0) {
return new SVNInfoUnversioned(path);
} else {
- return new JhlInfo2(path,info2[0]);
+ return items[0];
}
} catch (ClientException e) {
@@ -1911,22 +2023,15 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
if (descend) notificationHandler.logCommandLine("info " + target + " --depth=infinity");
else notificationHandler.logCommandLine("info " + target);
notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(path));
- List infoList = new ArrayList();
- Info info = svnClient.info(target);
- if (info == null) {
- infoList.add(new SVNInfoUnversioned(path));
+ JhlInfoCallback callback = new JhlInfoCallback();
+
+ svnClient.info2(target, null, null, Depth.infinityOrEmpty(descend), null, callback);
+ ISVNInfo[] items = callback.getInfo();
+ if (items == null) {
+ return new ISVNInfo[]{new SVNInfoUnversioned(path)};
} else {
- Info2[] infos = svnClient.info2(target, null, null, true);
- if (infos == null || infos.length == 0) {
- infoList.add(new SVNInfoUnversioned(path));
- } else {
- for (int i = 0; i < infos.length; i++)
- infoList.add(new JhlInfo2(path,infos[i]));
- }
+ return items;
}
- ISVNInfo[] infoArray = new ISVNInfo[infoList.size()];
- infoList.toArray(infoArray);
- return infoArray;
} catch (ClientException e) {
notificationHandler.logException(e);
throw new SVNClientException(e);
@@ -1942,12 +2047,14 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
String target = url.toString();
notificationHandler.logCommandLine("info "+target);
// notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(url));
+ JhlInfoCallback callback = new JhlInfoCallback();
- Info2[] info = svnClient.info2(target, JhlConverter.convert(revision), JhlConverter.convert(peg), false);
- if (info == null || info.length == 0) {
+ svnClient.info2(target, JhlConverter.convert(revision), JhlConverter.convert(peg), Depth.empty, null, callback);
+ ISVNInfo[] items = callback.getInfo();
+ if (items == null || items.length == 0) {
return new SVNInfoUnversioned(null);
} else {
- return new JhlInfo2(null, info[0]);
+ return items[0];
}
} catch (ClientException e) {
@@ -1961,7 +2068,7 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
* @see org.tigris.subversion.svnclientadapter.ISVNClientAdapter#switchUrl(org.tigris.subversion.svnclientadapter.SVNUrl, java.io.File, org.tigris.subversion.svnclientadapter.SVNRevision, boolean)
*/
public void switchToUrl(File path, SVNUrl url, SVNRevision revision, boolean recurse) throws SVNClientException {
- switchToUrl(path, url, revision, Depth.unknownOrFiles(recurse), false, false, true);
+ switchToUrl(path, url, revision, Depth.unknownOrFiles(recurse).ordinal(), false, false, true);
}
/*
@@ -1970,23 +2077,32 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
*/
public void switchToUrl(File path, SVNUrl url, SVNRevision revision, int depth, boolean setDepth, boolean ignoreExternals, boolean force) throws SVNClientException {
switchToUrl(path, url, revision, revision, depth, setDepth, ignoreExternals, force);
- }
+ }
/*
* (non-Javadoc)
* @see org.tigris.subversion.svnclientadapter.ISVNClientAdapter#switchUrl(org.tigris.subversion.svnclientadapter.SVNUrl, java.io.File, org.tigris.subversion.svnclientadapter.SVNRevision, org.tigris.subversion.svnclientadapter.SVNRevision, int, boolean, boolean, boolean)
*/
public void switchToUrl(File path, SVNUrl url, SVNRevision revision, SVNRevision pegRevision, int depth, boolean setDepth, boolean ignoreExternals, boolean force) throws SVNClientException {
- if (depth == Depth.exclude) {
+ switchToUrl(path, url, revision, pegRevision, depth, setDepth, ignoreExternals, force, false);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.tigris.subversion.svnclientadapter.ISVNClientAdapter#switchUrl(org.tigris.subversion.svnclientadapter.SVNUrl, java.io.File, org.tigris.subversion.svnclientadapter.SVNRevision, org.tigris.subversion.svnclientadapter.SVNRevision, int, boolean, boolean, boolean, boolean)
+ */
+ public void switchToUrl(File path, SVNUrl url, SVNRevision revision, SVNRevision pegRevision, int depth, boolean setDepth, boolean ignoreExternals, boolean force, boolean ignoreAncestry) throws SVNClientException {
+ if (depth == Depth.exclude.ordinal()) {
update(path, pegRevision, depth, true, ignoreExternals, force);
return;
}
try {
notificationHandler.setCommand(ISVNNotifyListener.Command.SWITCH);
+ Depth d = JhlConverter.depth(depth);
String target = fileToSVNPath(path, false);
StringBuffer commandLine = new StringBuffer("switch " + url + " " + target + " -r " + revision.toString() +
- depthCommandLine(depth));
+ depthCommandLine(d));
if (ignoreExternals) commandLine.append(" --ignore-externals");
if (force) commandLine.append(" --force");
notificationHandler.logCommandLine(commandLine.toString());
@@ -1994,7 +2110,7 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
notificationHandler.setBaseDir(baseDir);
Revision rev = JhlConverter.convert(revision);
Revision pegRev = JhlConverter.convert(pegRevision);
- svnClient.doSwitch(target, url.toString(),rev,pegRev,depth, setDepth, ignoreExternals, force);
+ svnClient.doSwitch(target, url.toString(),rev,pegRev,d, setDepth, ignoreExternals, force, ignoreAncestry);
} catch (ClientException e) {
notificationHandler.logException(e);
@@ -2032,12 +2148,28 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
}
/* (non-Javadoc)
+ * @see org.tigris.subversion.svnclientadapter.ISVNClientAdapter#upgrade(java.io.File)
+ */
+ public void upgrade(File path) throws SVNClientException {
+ try {
+ notificationHandler.setCommand(ISVNNotifyListener.Command.UPGRADE);
+ String target = fileToSVNPath(path, false);
+ String commandLine = "upgrade " + target;
+ notificationHandler.logCommandLine(commandLine);
+ svnClient.upgrade(target);
+ } catch (ClientException e) {
+ notificationHandler.logException(e);
+ throw new SVNClientException(e);
+ }
+ }
+
+ /* (non-Javadoc)
* @see org.tigris.subversion.svnclientadapter.ISVNClientAdapter#merge(org.tigris.subversion.svnclientadapter.SVNUrl, org.tigris.subversion.svnclientadapter.SVNRevision, org.tigris.subversion.svnclientadapter.SVNUrl, org.tigris.subversion.svnclientadapter.SVNRevision, java.io.File, boolean, boolean, boolean, boolean)
*/
public void merge(SVNUrl path1, SVNRevision revision1, SVNUrl path2,
SVNRevision revision2, File localPath, boolean force,
boolean recurse, boolean dryRun, boolean ignoreAncestry) throws SVNClientException {
- merge(path1, revision1, path2, revision2, localPath, force, Depth.infinityOrFiles(recurse), dryRun, ignoreAncestry, false);
+ merge(path1, revision1, path2, revision2, localPath, force, Depth.infinityOrFiles(recurse).ordinal(), dryRun, ignoreAncestry, false);
}
public void merge(SVNUrl path1, SVNRevision revision1, SVNUrl path2,
@@ -2046,13 +2178,14 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
try {
notificationHandler.setCommand(ISVNNotifyListener.Command.MERGE);
+ Depth d = JhlConverter.depth(depth);
String target = fileToSVNPath(localPath, false);
String commandLine = "merge";
boolean samePath = false;
if (dryRun) {
commandLine += " --dry-run";
}
- commandLine += depthCommandLine(depth);
+ commandLine += depthCommandLine(d);
if (force) {
commandLine += " --force";
}
@@ -2082,10 +2215,11 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
rev2 = Revision.START;
else
rev2 = JhlConverter.convert(revision2);
- RevisionRange[] revisionRanges = { new RevisionRange(rev1, rev2) };
- svnClient.merge(path1.toString(), JhlConverter.convert(pegRevision), revisionRanges, target, force, depth, ignoreAncestry, dryRun, recordOnly );
+ List<RevisionRange> revisionRanges = new ArrayList<RevisionRange>();
+ revisionRanges.add(new RevisionRange(rev1, rev2));
+ svnClient.merge(path1.toString(), JhlConverter.convert(pegRevision), revisionRanges, target, force, d, ignoreAncestry, dryRun, recordOnly );
} else
- svnClient.merge(path1.toString(), JhlConverter.convert(revision1), path2.toString(), JhlConverter.convert(revision2), target, force, depth, ignoreAncestry, dryRun, recordOnly );
+ svnClient.merge(path1.toString(), JhlConverter.convert(revision1), path2.toString(), JhlConverter.convert(revision2), target, force, d, ignoreAncestry, dryRun, recordOnly );
if (dryRun)
notificationHandler.logCompleted("Dry-run merge complete.");
else
@@ -2191,22 +2325,22 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
throws SVNClientException {
try {
notificationHandler.setCommand(ISVNNotifyListener.Command.LOCK);
- String[] files = new String[paths.length];
+ Set<String> files = new HashSet<String>(paths.length);
String commandLine = "lock -m \""+comment+"\"";
if (force)
commandLine+=" --force";
for (int i = 0; i < paths.length; i++) {
- files[i] = fileToSVNPath(paths[i], false);
+ files.add(fileToSVNPath(paths[i], false));
}
commandLine = appendPaths(commandLine, files);
notificationHandler.logCommandLine(commandLine);
notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(paths));
svnClient.lock(files, comment, force);
- for (int i = 0; i < files.length; i++) {
- notificationHandler.notifyListenersOfChange(files[i]);
- }
+ for (String file : files) {
+ notificationHandler.notifyListenersOfChange(file);
+ }
} catch (ClientException e) {
notificationHandler.logException(e);
// throw new SVNClientException(e);
@@ -2220,22 +2354,22 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
public void unlock(File[] paths, boolean force) throws SVNClientException {
try {
notificationHandler.setCommand(ISVNNotifyListener.Command.LOCK);
- String[] files = new String[paths.length];
+ Set<String> files = new HashSet<String>(paths.length);
String commandLine = "unlock ";
if (force)
commandLine+=" --force";
for (int i = 0; i < paths.length; i++) {
- files[i] = fileToSVNPath(paths[i], false);
+ files.add(fileToSVNPath(paths[i], false));
}
commandLine = appendPaths(commandLine, files);
notificationHandler.logCommandLine(commandLine);
notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(paths));
svnClient.unlock(files, force);
- for (int i = 0; i < files.length; i++) {
- notificationHandler.notifyListenersOfChange(files[i]);
- }
+ for (String file : files) {
+ notificationHandler.notifyListenersOfChange(file);
+ }
} catch (ClientException e) {
notificationHandler.logException(e);
// throw new SVNClientException(e);
@@ -2261,9 +2395,9 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
+ url.toString());
notificationHandler.setBaseDir();
if (propName.startsWith("svn:")) {
- svnClient.setRevProperty(url.toString(), propName, Revision.getInstance(revisionNo.getNumber()), fixSVNString(propertyData), true);
+ svnClient.setRevProperty(url.toString(), propName, Revision.getInstance(revisionNo.getNumber()), fixSVNString(propertyData), null, true);
} else {
- svnClient.setRevProperty(url.toString(), propName, Revision.getInstance(revisionNo.getNumber()), propertyData, true);
+ svnClient.setRevProperty(url.toString(), propName, Revision.getInstance(revisionNo.getNumber()), propertyData, null, true);
}
} catch (ClientException e) {
notificationHandler.logException(e);
@@ -2286,8 +2420,14 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
+ "\" "
+ url.toString());
notificationHandler.setBaseDir();
- PropertyData temp = svnClient.revProperty(url.toString(), propName, Revision.getInstance(revisionNo.getNumber())); //setRevProperty(url.toString(), propName, Revision.getInstance(revisionNo.getNumber()), fixSVNString(propertyData), true);
- propData = temp.getValue();
+ byte[] bytes = svnClient.revProperty(url.toString(), propName, Revision.getInstance(revisionNo.getNumber())); //setRevProperty(url.toString(), propName, Revision.getInstance(revisionNo.getNumber()), fixSVNString(propertyData), true);
+ try {
+ // Assume property data is UTF8. Technically, only svn: props are forced
+ // to be UTF8.
+ propData = new String(bytes, "UTF8");
+ } catch (UnsupportedEncodingException e) {
+ propData = new String(bytes);
+ }
if (propName.startsWith("svn:")) {
fixSVNString(propData);
}
@@ -2310,16 +2450,18 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
+ target);
notificationHandler.setBaseDir();
- PropertyData[] propertiesData = svnClient.revProperties(target, Revision.getInstance(revisionNo.getNumber()));
- //.properties(target, JhlConverter.convert(revision), JhlConverter.convert(pegRevision));
+ Map<String, byte[]> propertiesData = svnClient.revProperties(target, Revision.getInstance(revisionNo.getNumber()));
if (propertiesData == null) {
// no properties
return new JhlPropertyData[0];
}
- JhlPropertyData[] svnProperties = new JhlPropertyData[propertiesData.length];
- for (int i = 0; i < propertiesData.length;i++) {
- svnProperties[i] = JhlPropertyData.newForUrl(propertiesData[i]);
- }
+ Set<String> keys = propertiesData.keySet();
+ JhlPropertyData[] svnProperties = new JhlPropertyData[keys.size()];
+ int i=0;
+ for (String key : keys) {
+ svnProperties[i] = JhlPropertyData.newForUrl(target, key, propertiesData.get(key));
+ i++;
+ }
return svnProperties;
} catch (ClientException e) {
notificationHandler.logException(e);
@@ -2361,16 +2503,20 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
+ target
+ logExtras);
JhlLogMessageCallback callback = new JhlLogMessageCallback(worker);
+ Set<String> revProps = new HashSet<String>(requestedProperties.length);
+ for (int i = 0; i < requestedProperties.length; i++) {
+ revProps.add(requestedProperties[i]);
+ }
+ List<RevisionRange> range = new ArrayList<RevisionRange>();
+ range.add(new RevisionRange(JhlConverter.convert(revisionStart), JhlConverter.convert(revisionEnd)));
svnClient.logMessages(target, JhlConverter.convert(pegRevision),
- JhlConverter.convert(revisionStart),
- JhlConverter.convert(revisionEnd),
- stopOnCopy, fetchChangePath, includeMergedRevisions,
- requestedProperties, limit, callback);
+ range, stopOnCopy, fetchChangePath, includeMergedRevisions,
+ revProps, limit, callback);
} catch (ClientException e) {
if (e.getAprError() == ErrorCodes.unsupportedFeature && includeMergedRevisions) {
getLogMessages(target, pegRevision, revisionStart, revisionEnd, stopOnCopy, fetchChangePath, limit, false, requestedProperties, worker);
} else {
- if (e.getAprError() == ErrorCodes.fsNotFound && pegRevision != null && !pegRevision.equals(revisionStart)) {
+ if ((e.getAprError() == ErrorCodes.fsNotFound || e.getAprError() == ErrorCodes.clientUnrelatedResources) && pegRevision != null && !pegRevision.equals(revisionStart)) {
getLogMessages(target, pegRevision, pegRevision, revisionEnd, stopOnCopy, fetchChangePath, limit, includeMergedRevisions, requestedProperties, worker);
} else {
notificationHandler.logException(e);
@@ -2423,12 +2569,10 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
throws SVNClientException {
try {
notificationHandler.setCommand(ISVNNotifyListener.Command.RELOCATE);
- if (recurse)
- notificationHandler.logCommandLine("switch --relocate "+ from + " " + to + " " + path);
- else
- notificationHandler.logCommandLine("switch --relocate -N"+ from + " " + to + " " + path);
+ notificationHandler.logCommandLine("switch --relocate "+ from + " " + to + " " + path);
notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(new File(path)));
- svnClient.relocate(from, to, path, recurse);
+ boolean ignoreAncestry = false;
+ svnClient.relocate(from, to, path, ignoreAncestry);
} catch (ClientException e) {
notificationHandler.logException(e);
throw new SVNClientException(e);
@@ -2456,7 +2600,7 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
notificationHandler.logCommandLine(commandLine);
notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(path));
- svnClient.diff(wcPath,Revision.WORKING,url.toString(),JhlConverter.convert(urlRevision), svnOutFile, recurse);
+ svnClient.diff(wcPath,Revision.WORKING,url.toString(),JhlConverter.convert(urlRevision), null, svnOutFile, Depth.infinityOrEmpty(recurse), null, false, true, false, true);
} catch (ClientException e) {
notificationHandler.logException(e);
throw new SVNClientException(e);
@@ -2471,7 +2615,8 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
if (fixedMessage == null)
fixedMessage = "";
notificationHandler.setCommand(ISVNNotifyListener.Command.MKDIR);
- String target = url.toString();
+ Set<String> target = new HashSet<String>();
+ target.add(url.toString());
if (makeParents)
notificationHandler.logCommandLine(
"mkdir --parents -m \""+getFirstMessageLine(fixedMessage)+"\" "+target);
@@ -2479,7 +2624,7 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
notificationHandler.logCommandLine(
"mkdir -m \""+getFirstMessageLine(fixedMessage)+"\" "+target);
notificationHandler.setBaseDir();
- svnClient.mkdir(new String[] { target },fixedMessage, makeParents, null);
+ svnClient.mkdir(target, makeParents, null, new JhlCommitMessage(fixedMessage), null);
} catch (ClientException e) {
notificationHandler.logException(e);
throw new SVNClientException(e);
@@ -2495,14 +2640,15 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
if (dryRun) {
commandLine += " --dry-run";
}
- commandLine += depthCommandLine(depth);
+ Depth d = JhlConverter.depth(depth);
+ commandLine += depthCommandLine(d);
if (force) {
commandLine += " --force";
}
if (ignoreAncestry) {
commandLine += " --ignore-ancestry";
}
- RevisionRange[] range = JhlConverter.convert(revisions);
+ List<RevisionRange> range = JhlConverter.convert(revisions);
for (int i = 0; i < revisions.length; i++) {
commandLine += " " + revisions[i].toMergeString();
}
@@ -2514,7 +2660,7 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
notificationHandler.setBaseDir(baseDir);
Revision peg = JhlConverter.convert(pegRevision);
if (peg == null) peg = Revision.HEAD;
- svnClient.merge(url.toString(), peg, range, target, force, depth, ignoreAncestry, dryRun, recordOnly);
+ svnClient.merge(url.toString(), peg, range, target, force, d, ignoreAncestry, dryRun, recordOnly);
if (dryRun)
notificationHandler.logCompleted("Dry-run merge complete.");
else
@@ -2531,16 +2677,18 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
}
}
- private String depthCommandLine(int depth) {
+ private String depthCommandLine(Depth depth) {
switch (depth) {
- case Depth.empty:
+ case empty:
return " --depth=empty";
- case Depth.files:
+ case files:
return " --depth=files";
- case Depth.immediates:
+ case immediates:
return " --depth=immediates";
- case Depth.infinity:
+ case infinity:
return " --depth=infinity";
+ case exclude:
+ return " --depth=exclude";
default:
return "";
}
@@ -2590,14 +2738,15 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
revision2 = SVNRevision.HEAD;
String commandLine = "diff --summarize";
- commandLine += depthCommandLine(depth);
+ Depth d = JhlConverter.depth(depth);
+ commandLine += depthCommandLine(d);
if (ignoreAncestry)
commandLine += " --ignoreAncestry";
commandLine += " " + target1 + "@" + revision1 + " " + target2 + "@" + revision2;
notificationHandler.logCommandLine(commandLine);
notificationHandler.setBaseDir();
JhlDiffSummaryReceiver callback = new JhlDiffSummaryReceiver();
- svnClient.diffSummarize(target1, JhlConverter.convert(revision1), target2, JhlConverter.convert(revision2), depth, null, ignoreAncestry, callback);
+ svnClient.diffSummarize(target1, JhlConverter.convert(revision1), target2, JhlConverter.convert(revision2), d, null, ignoreAncestry, callback);
return callback.getDiffSummary();
} catch (ClientException e) {
notificationHandler.logException(e);
@@ -2620,7 +2769,8 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
endRevision = SVNRevision.HEAD;
String commandLine = "diff --summarize";
- commandLine += depthCommandLine(depth);
+ Depth d = JhlConverter.depth(depth);
+ commandLine += depthCommandLine(d);
if (ignoreAncestry)
commandLine += " --ignoreAncestry";
commandLine += " -r " + startRevision + ":" + endRevision + " " + target;
@@ -2628,7 +2778,7 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
notificationHandler.setBaseDir();
JhlDiffSummaryReceiver callback = new JhlDiffSummaryReceiver();
svnClient.diffSummarize(target, JhlConverter.convert(pegRevision), JhlConverter.convert(startRevision), JhlConverter.convert(endRevision),
- depth, null, ignoreAncestry, callback);
+ d, null, ignoreAncestry, callback);
return callback.getDiffSummary();
} catch (ClientException e) {
notificationHandler.logException(e);
@@ -2672,7 +2822,7 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
// This method does a diff to a temporary file and then parses that file to construct
// the SVNDiffSummary array.
public SVNDiffSummary[] diffSummarize(File path, SVNUrl toUrl, SVNRevision toRevision, boolean recurse) throws SVNClientException {
- List diffSummaryList = new ArrayList();
+ List<SVNDiffSummary> diffSummaryList = new ArrayList<SVNDiffSummary>();
BufferedReader input = null;
String changedResource = null;
boolean deletedLines = false;
@@ -2776,19 +2926,27 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
}
public String[] suggestMergeSources(File path) throws SVNClientException {
+ String[] sources = null;
try {
- return svnClient.suggestMergeSources(fileToSVNPath(path, false), Revision.HEAD);
+ Set<String> s = svnClient.suggestMergeSources(fileToSVNPath(path, false), Revision.HEAD);
+ sources = new String[s.size()];
+ s.toArray(sources);
} catch (SubversionException e) {
throw new SVNClientException(e);
}
+ return sources;
}
public String[] suggestMergeSources(SVNUrl url, SVNRevision peg) throws SVNClientException {
+ String[] sources = null;
try {
- return svnClient.suggestMergeSources(url.toString(), JhlConverter.convert(peg));
+ Set<String> s = svnClient.suggestMergeSources(url.toString(), JhlConverter.convert(peg));
+ sources = new String[s.size()];
+ s.toArray(sources);
} catch (SubversionException e) {
throw new SVNClientException(e);
}
+ return sources;
}
@@ -2796,7 +2954,7 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
boolean recurse) throws SVNClientException {
FileOutputStream os = null;
try {
- ArrayList tempFiles = new ArrayList();
+ List<File> tempFiles = new ArrayList<File>();
for (int i = 0; i < paths.length; i++) {
File tempFile = File.createTempFile("tempDiff", ".txt");
tempFile.deleteOnExit();
@@ -2806,9 +2964,7 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
tempFiles.add(tempFile);
}
os = new FileOutputStream(outFile);
- Iterator iter = tempFiles.iterator();
- while (iter.hasNext()) {
- File tempFile = (File)iter.next();
+ for (File tempFile : tempFiles) {
FileInputStream is = new FileInputStream(tempFile);
byte[] buffer = new byte[4096];
int bytes_read;
@@ -2849,10 +3005,13 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
notificationHandler.setCommand(
ISVNNotifyListener.Command.MERGEINFO);
String show = "";
+ org.apache.subversion.javahl.types.Mergeinfo.LogKind mergeKind = org.apache.subversion.javahl.types.Mergeinfo.LogKind.eligible;
if (kind == ISVNMergeinfoLogKind.eligible)
show = show + " --show-revs eligible ";
- if (kind == ISVNMergeinfoLogKind.merged)
+ if (kind == ISVNMergeinfoLogKind.merged) {
show = show + " --show-revs merged ";
+ mergeKind = org.apache.subversion.javahl.types.Mergeinfo.LogKind.merged;
+ }
notificationHandler.logCommandLine(
"mergeinfo "
+ show
@@ -2861,9 +3020,13 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
+ target);
SVNLogMessageCallback worker = new SVNLogMessageCallback();
JhlLogMessageCallback callback = new JhlLogMessageCallback(worker);
- svnClient.getMergeinfoLog(kind, target, JhlConverter.convert(pegRevision),
+ Set<String> revProps = new HashSet<String>();
+ revProps.add("svn:author");
+ revProps.add("svn:date");
+ revProps.add("svn:log");
+ svnClient.getMergeinfoLog(mergeKind, target, JhlConverter.convert(pegRevision),
mergeSourceUrl.toString(), JhlConverter.convert(srcPegRevision),
- discoverChangedPaths, ISVNClientAdapter.DEFAULT_LOG_PROPERTIES, callback);
+ discoverChangedPaths, Depth.infinity, revProps, callback);
return worker.getLogMessages();
} catch (ClientException e) {
if (e.getAprError() == ErrorCodes.unsupportedFeature) {
@@ -2874,11 +3037,13 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
}
}
- private String appendPaths(String commandLine, String[] paths) {
+ private String appendPaths(String commandLine, Set<String> paths) {
StringBuffer stringBuffer = new StringBuffer(commandLine);
- if (paths.length > 5) stringBuffer.append(" (" + paths.length + " paths specified)");
+ if (paths.size() > 5) stringBuffer.append(" (" + paths.size() + " paths specified)");
else {
- for (int i = 0; i < paths.length; i++) stringBuffer.append(" " + paths[i]);
+ for (String s : paths) {
+ stringBuffer.append(" " + s);
+ }
}
return stringBuffer.toString();
}
@@ -2903,5 +3068,5 @@ public abstract class AbstractJhlClientAdapter extends AbstractClientAdapter {
// Normalize all line endings to LF
return message.replaceAll("\r\n", "\n").replaceAll("\r", "\n");
}
-
+
}
diff --git a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/ErrorCodes.java b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/ErrorCodes.java
new file mode 100644
index 0000000..0c0e3e6
--- /dev/null
+++ b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/ErrorCodes.java
@@ -0,0 +1,239 @@
+package org.tigris.subversion.svnclientadapter.javahl;
+
+
+/**
+ * Provide mappings from error codes generated by the C runtime to meaningful
+ * Java values. For a better description of each error, please see
+ * svn_error_codes.h in the C source.
+ */
+public class ErrorCodes
+{
+ public static final int categorySize = 5000;
+ public static final int badContainingPool = 125000;
+ public static final int badFilename = 125001;
+ public static final int badUrl = 125002;
+ public static final int badDate = 125003;
+ public static final int badMimeType = 125004;
+ public static final int badPropertyValue = 125005;
+ public static final int badVersionFileFormat = 125006;
+ public static final int badRelativePath = 125007;
+ public static final int badUuid = 125008;
+ public static final int xmlAttribNotFound = 130000;
+ public static final int xmlMissingAncestry = 130001;
+ public static final int xmlUnknownEncoding = 130002;
+ public static final int xmlMalformed = 130003;
+ public static final int xmlUnescapableData = 130004;
+ public static final int ioInconsistentEol = 135000;
+ public static final int ioUnknownEol = 135001;
+ public static final int ioCorruptEol = 135002;
+ public static final int ioUniqueNamesExhausted = 135003;
+ public static final int ioPipeFrameError = 135004;
+ public static final int ioPipeReadError = 135005;
+ public static final int ioWriteError = 135006;
+ public static final int streamUnexpectedEof = 140000;
+ public static final int streamMalformedData = 140001;
+ public static final int streamUnrecognizedData = 140002;
+ public static final int nodeUnknownKind = 145000;
+ public static final int nodeUnexpectedKind = 145001;
+ public static final int entryNotFound = 150000;
+ public static final int entryExists = 150002;
+ public static final int entryMissingRevision = 150003;
+ public static final int entryMissingUrl = 150004;
+ public static final int entryAttributeInvalid = 150005;
+ public static final int wcObstructedUpdate = 155000;
+ public static final int wcUnwindMismatch = 155001;
+ public static final int wcUnwindEmpty = 155002;
+ public static final int wcUnwindNotEmpty = 155003;
+ public static final int wcLocked = 155004;
+ public static final int wcNotLocked = 155005;
+ public static final int wcInvalidLock = 155006;
+ public static final int wcNotDirectory = 155007;
+ public static final int wcNotFile = 155008;
+ public static final int wcBadAdmLog = 155009;
+ public static final int wcPathNotFound = 155010;
+ public static final int wcNotUpToDate = 155011;
+ public static final int wcLeftLocalMod = 155012;
+ public static final int wcScheduleConflict = 155013;
+ public static final int wcPathFound = 155014;
+ public static final int wcFoundConflict = 155015;
+ public static final int wcCorrupt = 155016;
+ public static final int wcCorruptTextBase = 155017;
+ public static final int wcNodeKindChange = 155018;
+ public static final int wcInvalidOpOnCwd = 155019;
+ public static final int wcBadAdmLogStart = 155020;
+ public static final int wcUnsupportedFormat = 155021;
+ public static final int wcBadPath = 155022;
+ public static final int wcInvalidSchedule = 155023;
+ public static final int wcInvalidRelocation = 155024;
+ public static final int wcInvalidSwitch = 155025;
+ public static final int wcMismatchedChangelist = 155026;
+ public static final int wcConflictResolverFailure = 155027;
+ public static final int wcCopyfromPathNotFound = 155028;
+ public static final int wcChangelistMove = 155029;
+ public static final int fsGeneral = 160000;
+ public static final int fsCleanup = 160001;
+ public static final int fsAlreadyOpen = 160002;
+ public static final int fsNotOpen = 160003;
+ public static final int fsCorrupt = 160004;
+ public static final int fsPathSyntax = 160005;
+ public static final int fsNoSuchRevision = 160006;
+ public static final int fsNoSuchTransaction = 160007;
+ public static final int fsNoSuchEntry = 160008;
+ public static final int fsNoSuchRepresentation = 160009;
+ public static final int fsNoSuchString = 160010;
+ public static final int fsNoSuchCopy = 160011;
+ public static final int fsTransactionNotMutable = 160012;
+ public static final int fsNotFound = 160013;
+ public static final int fsIdNotFound = 160014;
+ public static final int fsNotId = 160015;
+ public static final int fsNotDirectory = 160016;
+ public static final int fsNotFile = 160017;
+ public static final int fsNotSinglePathComponent = 160018;
+ public static final int fsNotMutable = 160019;
+ public static final int fsAlreadyExists = 160020;
+ public static final int fsRootDir = 160021;
+ public static final int fsNotTxnRoot = 160022;
+ public static final int fsNotRevisionRoot = 160023;
+ public static final int fsConflict = 160024;
+ public static final int fsRepChanged = 160025;
+ public static final int fsRepNotMutable = 160026;
+ public static final int fsMalformedSkel = 160027;
+ public static final int fsTxnOutOfDate = 160028;
+ public static final int fsBerkeleyDb = 160029;
+ public static final int fsBerkeleyDbDeadlock = 160030;
+ public static final int fsTransactionDead = 160031;
+ public static final int fsTransactionNotDead = 160032;
+ public static final int fsUnknownFsType = 160033;
+ public static final int fsNoUser = 160034;
+ public static final int fsPathAlreadyLocked = 160035;
+ public static final int fsPathNotLocked = 160036;
+ public static final int fsBadLockToken = 160037;
+ public static final int fsNoLockToken = 160038;
+ public static final int fsLockOwnerMismatch = 160039;
+ public static final int fsNoSuchLock = 160040;
+ public static final int fsLockExpired = 160041;
+ public static final int fsOutOfDate = 160042;
+ public static final int fsUnsupportedFormat = 160043;
+ public static final int fsRepBeingWritten = 160044;
+ public static final int fsTxnNameTooLong = 160045;
+ public static final int fsNoSuchNodeOrigin = 160046;
+ public static final int reposLocked = 165000;
+ public static final int reposHookFailure = 165001;
+ public static final int reposBadArgs = 165002;
+ public static final int reposNoDataForReport = 165003;
+ public static final int reposBadRevisionReport = 165004;
+ public static final int reposUnsupportedVersion = 165005;
+ public static final int reposDisabledFeature = 165006;
+ public static final int reposPostCommitHookFailed = 165007;
+ public static final int reposPostLockHookFailed = 165008;
+ public static final int reposPostUnlockHookFailed = 165009;
+ public static final int raIllegalUrl = 170000;
+ public static final int raNotAuthorized = 170001;
+ public static final int raUnknownAuth = 170002;
+ public static final int raNotImplemented = 170003;
+ public static final int raOutOfDate = 170004;
+ public static final int raNoReposUuid = 170005;
+ public static final int raUnsupportedAbiVersion = 170006;
+ public static final int raNotLocked = 170007;
+ public static final int raUnknownCapability = 170008;
+ public static final int raPartialReplayNotSupported = 170009;
+ public static final int raDavSockInit = 175000;
+ public static final int raDavCreatingRequest = 175001;
+ public static final int raDavRequestFailed = 175002;
+ public static final int raDavOptionsReqFailed = 175003;
+ public static final int raDavPropsNotFound = 175004;
+ public static final int raDavAlreadyExists = 175005;
+ public static final int raDavInvalidConfigValue = 175006;
+ public static final int raDavPathNotFound = 175007;
+ public static final int raDavProppatchFailed = 175008;
+ public static final int raDavMalformedData = 175009;
+ public static final int raDavResponseHeaderBadness = 175010;
+ public static final int raDavRelocated = 175011;
+ public static final int raLocalReposNotFound = 180000;
+ public static final int raLocalReposOpenFailed = 180001;
+ public static final int svndiffInvalidHeader = 185000;
+ public static final int svndiffCorruptWindow = 185001;
+ public static final int svndiffBackwardView = 185002;
+ public static final int svndiffInvalidOps = 185003;
+ public static final int svndiffUnexpectedEnd = 185004;
+ public static final int svndiffInvalidCompressedData = 185005;
+ public static final int apmodMissingPathToFs = 190000;
+ public static final int apmodMalformedUri = 190001;
+ public static final int apmodActivityNotFound = 190002;
+ public static final int apmodBadBaseline = 190003;
+ public static final int apmodConnectionAborted = 190004;
+ public static final int clientVersionedPathRequired = 195000;
+ public static final int clientRaAccessRequired = 195001;
+ public static final int clientBadRevision = 195002;
+ public static final int clientDuplicateCommitUrl = 195003;
+ public static final int clientIsBinaryFile = 195004;
+ public static final int clientInvalidExternalsDescription = 195005;
+ public static final int clientModified = 195006;
+ public static final int clientIsDirectory = 195007;
+ public static final int clientRevisionRange = 195008;
+ public static final int clientInvalidRelocation = 195009;
+ public static final int clientRevisionAuthorContainsNewline = 195010;
+ public static final int clientPropertyName = 195011;
+ public static final int clientUnrelatedResources = 195012;
+ public static final int clientMissingLockToken = 195013;
+ public static final int clientMultipleSourcesDisallowed = 195014;
+ public static final int clientNoVersionedParent = 195015;
+ public static final int clientNotReadyToMerge = 195016;
+ public static final int base = 200000;
+ public static final int pluginLoadFailure = 200001;
+ public static final int malformedFile = 200002;
+ public static final int incompleteData = 200003;
+ public static final int incorrectParams = 200004;
+ public static final int unversionedResource = 200005;
+ public static final int testFailed = 200006;
+ public static final int unsupportedFeature = 200007;
+ public static final int badPropKind = 200008;
+ public static final int illegalTarget = 200009;
+ public static final int deltaMd5ChecksumAbsent = 200010;
+ public static final int dirNotEmpty = 200011;
+ public static final int externalProgram = 200012;
+ public static final int swigPyExceptionSet = 200013;
+ public static final int checksumMismatch = 200014;
+ public static final int cancelled = 200015;
+ public static final int invalidDiffOption = 200016;
+ public static final int propertyNotFound = 200017;
+ public static final int noAuthFilePath = 200018;
+ public static final int versionMismatch = 200019;
+ public static final int mergeinfoParseError = 200020;
+ public static final int ceaseInvocation = 200021;
+ public static final int revnumParseFailure = 200022;
+ public static final int iterBreak = 200023;
+ public static final int unknownChangelist = 200024;
+ public static final int clArgParsingError = 205000;
+ public static final int clInsufficientArgs = 205001;
+ public static final int clMutuallyExclusiveArgs = 205002;
+ public static final int clAdmDirReserved = 205003;
+ public static final int clLogMessageIsVersionedFile = 205004;
+ public static final int clLogMessageIsPathname = 205005;
+ public static final int clCommitInAddedDir = 205006;
+ public static final int clNoExternalEditor = 205007;
+ public static final int clBadLogMessage = 205008;
+ public static final int clUnnecessaryLogMessage = 205009;
+ public static final int clNoExternalMergeTool = 205010;
+ public static final int last = 205011;
+ public static final int raSvnCmdErr = 210000;
+ public static final int raSvnUnknownCmd = 210001;
+ public static final int raSvnConnectionClosed = 210002;
+ public static final int raSvnIoError = 210003;
+ public static final int raSvnMalformedData = 210004;
+ public static final int raSvnReposNotFound = 210005;
+ public static final int raSvnBadVersion = 210006;
+ public static final int raSvnNoMechanisms = 210007;
+ public static final int authnCredsUnavailable = 215000;
+ public static final int authnNoProvider = 215001;
+ public static final int authnProvidersExhausted = 215002;
+ public static final int authnCredsNotSaved = 215003;
+ public static final int authnFailed = 215004;
+ public static final int authzRootUnreadable = 220000;
+ public static final int authzUnreadable = 220001;
+ public static final int authzPartiallyReadable = 220002;
+ public static final int authzInvalidConfig = 220003;
+ public static final int authzUnwritable = 220004;
+ public static final int diffDatasourceModified = 225000;
+ public static final int raSerfSspiInitialisationFailed = 230000;
+}
\ No newline at end of file
diff --git a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlAnnotations.java b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlAnnotations.java
index ae81717..dde96f8 100644
--- a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlAnnotations.java
+++ b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlAnnotations.java
@@ -18,10 +18,15 @@
******************************************************************************/
package org.tigris.subversion.svnclientadapter.javahl;
+import java.io.UnsupportedEncodingException;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
import java.util.Date;
+import java.util.Map;
-import org.tigris.subversion.javahl.BlameCallback;
-import org.tigris.subversion.javahl.BlameCallback2;
+import org.apache.subversion.javahl.ClientException;
+import org.apache.subversion.javahl.callback.BlameCallback;
import org.tigris.subversion.svnclientadapter.Annotations;
/**
@@ -30,17 +35,11 @@ import org.tigris.subversion.svnclientadapter.Annotations;
* as means of constructing the annotation records.
*
*/
-public class JhlAnnotations extends Annotations implements BlameCallback, BlameCallback2 {
-
- /* (non-Javadoc)
- * @see org.tigris.subversion.javahl.BlameCallback#singleLine(java.util.Date, long, java.lang.String, java.lang.String)
- */
- public void singleLine(Date changed, long revision, String author,
- String line) {
- addAnnotation(new Annotation(revision, author, changed, line));
- }
+public class JhlAnnotations extends Annotations implements BlameCallback {
- public void singleLine(Date changed, long revision, String author,
+ private static final DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS");
+
+ private void singleLine(Date changed, long revision, String author,
Date merged_date, long merged_revision, String merged_author,
String mergedPath, String line) {
if (merged_revision == -1 || revision <= merged_revision)
@@ -48,5 +47,39 @@ public class JhlAnnotations extends Annotations implements BlameCallback, BlameC
else
addAnnotation(new Annotation(merged_revision, merged_author, merged_date, line));
}
+
+ public void singleLine(long lineNum, long revision,
+ Map<String, byte[]> revProps, long mergedRevision,
+ Map<String, byte[]> mergedRevProps, String mergedPath, String line,
+ boolean localChange) throws ClientException {
+
+ String author = null;
+ String mergedAuthor = null;
+ try {
+ author = new String(revProps.get("svn:author"), "UTF8");
+ } catch (UnsupportedEncodingException e) {
+ author = new String(revProps.get("svn:author"));
+ }
+ if (mergedRevProps != null) {
+ try {
+ mergedAuthor = new String(mergedRevProps.get("svn:author"), "UTF8");
+ } catch (UnsupportedEncodingException e) {
+ mergedAuthor = new String(mergedRevProps.get("svn:author"));
+ }
+ }
+ try {
+ singleLine(
+ df.parse(new String(revProps.get("svn:date"))),
+ revision,
+ author,
+ mergedRevProps == null ? null
+ : df.parse(new String(mergedRevProps.get("svn:date"))),
+ mergedRevision,
+ mergedAuthor,
+ mergedPath, line);
+ } catch (ParseException e) {
+ throw ClientException.fromException(e);
+ }
+ }
}
diff --git a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlClientAdapter.java b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlClientAdapter.java
index bce35d5..d80567e 100644
--- a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlClientAdapter.java
+++ b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlClientAdapter.java
@@ -24,12 +24,16 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.channels.FileChannel;
import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
-import org.tigris.subversion.javahl.ClientException;
-import org.tigris.subversion.javahl.CopySource;
-import org.tigris.subversion.javahl.Revision;
-import org.tigris.subversion.javahl.SVNAdmin;
-import org.tigris.subversion.javahl.SVNClient;
+import org.apache.subversion.javahl.ClientException;
+import org.apache.subversion.javahl.types.CopySource;
+import org.apache.subversion.javahl.types.Revision;
+import org.apache.subversion.javahl.SVNClient;
+import org.apache.subversion.javahl.SVNRepos;
import org.tigris.subversion.svnclientadapter.ISVNNotifyListener;
import org.tigris.subversion.svnclientadapter.ISVNProperty;
import org.tigris.subversion.svnclientadapter.SVNBaseDir;
@@ -44,23 +48,23 @@ import org.tigris.subversion.svnclientadapter.SVNClientException;
*/
public class JhlClientAdapter extends AbstractJhlClientAdapter {
- private SVNAdmin svnAdmin;
+ private SVNRepos svnAdmin;
/**
* Default constructor
*/
public JhlClientAdapter() {
svnClient = new SVNClient();
- svnAdmin = new SVNAdmin();
+ svnAdmin = new SVNRepos();
notificationHandler = new JhlNotificationHandler();
progressListener = new JhlProgressListener();
svnClient.notification2(notificationHandler);
svnClient.setPrompt(new DefaultPromptUserPassword());
- svnClient.setProgressListener(progressListener);
+ svnClient.setProgressCallback(progressListener);
}
public boolean isThreadsafe() {
- return true;
+ return false;
}
/**
@@ -88,12 +92,11 @@ public class JhlClientAdapter extends AbstractJhlClientAdapter {
String fsType = (repositoryType == null) ? REPOSITORY_FSTYPE_FSFS : repositoryType;
notificationHandler.setCommand(ISVNNotifyListener.Command.CREATE_REPOSITORY);
- String target = fileToSVNPath(path,false);
notificationHandler.logCommandLine(
MessageFormat.format(
"create --fstype {0} {1}",
- new String[] { fsType, target }));
- svnAdmin.create(target, false, false, null, fsType);
+ (Object[])new String[] { fsType, fileToSVNPath(path, false) }));
+ svnAdmin.create(path, false, false, null, fsType);
} catch (ClientException e) {
notificationHandler.logException(e);
throw new SVNClientException(e);
@@ -101,14 +104,6 @@ public class JhlClientAdapter extends AbstractJhlClientAdapter {
}
- /**
- * @param logLevel
- * @param filePath
- */
- public static void enableLogging(int logLevel,File filePath) {
- SVNClient.enableLogging(logLevel,fileToSVNPath(filePath, false));
- }
-
public boolean statusReturnsRemoteInfo() {
return true;
}
@@ -135,16 +130,18 @@ public class JhlClientAdapter extends AbstractJhlClientAdapter {
notificationHandler.logCommandLine(
"move "+src+' '+dest);
notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(new File[] {srcPath, destPath}));
- CopySource[] copySources = { new CopySource(src, Revision.WORKING, Revision.WORKING) };
- svnClient.copy(copySources, dest, null, true, true, null);
+ List<CopySource> copySources = new ArrayList<CopySource>();
+ copySources.add(new CopySource(src, Revision.WORKING, Revision.WORKING));
+ svnClient.copy(copySources, dest, true, true, true, null, null, null);
try {
overwriteFile(srcPath, destPath);
} catch (IOException e) {
// If file contents do not copy, just
// proceed.
}
- String paths[] = {src};
- svnClient.remove(paths, null, true, false, null);
+ Set<String> paths = new HashSet<String>();
+ paths.add(src);
+ svnClient.remove(paths, true, false, null, null, null);
} catch (ClientException e) {
notificationHandler.logException(e);
throw new SVNClientException(e);
diff --git a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlClientAdapterFactory.java b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlClientAdapterFactory.java
index f3108a4..40b9834 100644
--- a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlClientAdapterFactory.java
+++ b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlClientAdapterFactory.java
@@ -18,9 +18,9 @@
******************************************************************************/
package org.tigris.subversion.svnclientadapter.javahl;
-import org.tigris.subversion.javahl.SVNClient;
-import org.tigris.subversion.javahl.SVNClientInterface;
-import org.tigris.subversion.javahl.Version;
+import org.apache.subversion.javahl.ISVNClient;
+import org.apache.subversion.javahl.SVNClient;
+import org.apache.subversion.javahl.types.Version;
import org.tigris.subversion.svnclientadapter.ISVNClientAdapter;
import org.tigris.subversion.svnclientadapter.SVNClientAdapterFactory;
import org.tigris.subversion.svnclientadapter.SVNClientException;
@@ -31,6 +31,15 @@ import org.tigris.subversion.svnclientadapter.SVNClientException;
*/
public class JhlClientAdapterFactory extends SVNClientAdapterFactory {
+ private static final String[] WINDOWSLIBS = new String[] {
+ "msvcr100", "msvcp100",
+ "libapr-1", "libapriconv-1", "libeay32", "ssleay32", "libaprutil-1",
+ "dbghelp", "libsasl",
+ // libraries as of 1.5
+ "libsvn_subr-1", "libsvn_delta-1", "libsvn_diff-1", "libsvn_wc-1",
+ "libsvn_fs-1", "libsvn_repos-1", "libsvn_ra-1", "libsvn_client-1"
+ };
+
private static boolean availabilityCached = false;
private static boolean available;
private static StringBuffer javaHLErrors = new StringBuffer("Failed to load JavaHL Library.\nThese are the errors that were encountered:\n");
@@ -73,13 +82,14 @@ public class JhlClientAdapterFactory extends SVNClientAdapterFactory {
SVNClientAdapterFactory.registerAdapterFactory(new JhlClientAdapterFactory());
}
- public static boolean isAvailable() {
+ @SuppressWarnings("rawtypes")
+ public static boolean isAvailable() {
if (!availabilityCached) {
- Class c = null;
+ Class c = null;
try {
// load a JavaHL class to see if it is found. Do not use SVNClient as
// it will try to load native libraries and we do not want that yet
- c = Class.forName("org.tigris.subversion.javahl.ClientException");
+ c = Class.forName("org.apache.subversion.javahl.ClientException");
if (c == null)
return false;
} catch (Throwable t) {
@@ -94,112 +104,17 @@ public class JhlClientAdapterFactory extends SVNClientAdapterFactory {
// because of a problem in one of these libraries the proper behavior
// will still occur -- meaning JavaHL adapter is disabled.
if(isOsWindows()) {
- try {
- System.loadLibrary("libapr-1");
- } catch (Exception e) {
- javaHLErrors.append(e.getMessage()).append("\n");
- } catch (UnsatisfiedLinkError e) {
- javaHLErrors.append(e.getMessage()).append("\n");
- }
- try {
- System.loadLibrary("libapriconv-1");
- } catch (Exception e) {
- javaHLErrors.append(e.getMessage()).append("\n");
- } catch (UnsatisfiedLinkError e) {
- javaHLErrors.append(e.getMessage()).append("\n");
- }
- try {
- System.loadLibrary("libeay32");
- } catch (Exception e) {
- javaHLErrors.append(e.getMessage()).append("\n");
- } catch (UnsatisfiedLinkError e) {
- javaHLErrors.append(e.getMessage()).append("\n");
- }
- try {
- System.loadLibrary("ssleay32");
- } catch (Exception e) {
- javaHLErrors.append(e.getMessage()).append("\n");
- } catch (UnsatisfiedLinkError e) {
- javaHLErrors.append(e.getMessage()).append("\n");
- }
- try {
- System.loadLibrary("libaprutil-1");
- } catch (Exception e) {
- javaHLErrors.append(e.getMessage()).append("\n");
- } catch (UnsatisfiedLinkError e) {
- javaHLErrors.append(e.getMessage()).append("\n");
- }
- try {
- System.loadLibrary("dbghelp");
- } catch (Exception e) {
- javaHLErrors.append(e.getMessage()).append("\n");
- } catch (UnsatisfiedLinkError e) {
- javaHLErrors.append(e.getMessage()).append("\n");
- }
- try {
- System.loadLibrary("libsasl");
- } catch (Exception e) {
- javaHLErrors.append(e.getMessage()).append("\n");
- } catch (UnsatisfiedLinkError e) {
- javaHLErrors.append(e.getMessage()).append("\n");
- }
- // Load DLL's for Subversion libraries -- as of 1.5
- try {
- System.loadLibrary("libsvn_subr-1");
- } catch (Exception e) {
- javaHLErrors.append(e.getMessage()).append("\n");
- } catch (UnsatisfiedLinkError e) {
- javaHLErrors.append(e.getMessage()).append("\n");
- }
- try {
- System.loadLibrary("libsvn_delta-1");
- } catch (Exception e) {
- javaHLErrors.append(e.getMessage()).append("\n");
- } catch (UnsatisfiedLinkError e) {
- javaHLErrors.append(e.getMessage()).append("\n");
- }
- try {
- System.loadLibrary("libsvn_diff-1");
- } catch (Exception e) {
- javaHLErrors.append(e.getMessage()).append("\n");
- } catch (UnsatisfiedLinkError e) {
- javaHLErrors.append(e.getMessage()).append("\n");
- }
- try {
- System.loadLibrary("libsvn_wc-1");
- } catch (Exception e) {
- javaHLErrors.append(e.getMessage()).append("\n");
- } catch (UnsatisfiedLinkError e) {
- javaHLErrors.append(e.getMessage()).append("\n");
- }
- try {
- System.loadLibrary("libsvn_fs-1");
- } catch (Exception e) {
- javaHLErrors.append(e.getMessage()).append("\n");
- } catch (UnsatisfiedLinkError e) {
- javaHLErrors.append(e.getMessage()).append("\n");
- }
- try {
- System.loadLibrary("libsvn_repos-1");
- } catch (Exception e) {
- javaHLErrors.append(e.getMessage()).append("\n");
- } catch (UnsatisfiedLinkError e) {
- javaHLErrors.append(e.getMessage()).append("\n");
- }
- try {
- System.loadLibrary("libsvn_ra-1");
- } catch (Exception e) {
- javaHLErrors.append(e.getMessage()).append("\n");
- } catch (UnsatisfiedLinkError e) {
- javaHLErrors.append(e.getMessage()).append("\n");
- }
- try {
- System.loadLibrary("libsvn_client-1");
- } catch (Exception e) {
- javaHLErrors.append(e.getMessage()).append("\n");
- } catch (UnsatisfiedLinkError e) {
- javaHLErrors.append(e.getMessage()).append("\n");
- }
+
+ for (int i = 0; i < WINDOWSLIBS.length; i++) {
+ try {
+ System.loadLibrary(WINDOWSLIBS[i]);
+ } catch (Exception e) {
+ javaHLErrors.append(e.getMessage()).append("\n");
+ } catch (UnsatisfiedLinkError e) {
+ javaHLErrors.append(e.getMessage()).append("\n");
+ }
+ }
+
}
//workaround to solve Subclipse ISSUE #83
available = false;
@@ -265,17 +180,17 @@ public class JhlClientAdapterFactory extends SVNClientAdapterFactory {
// it could be too old version of JavaHL library. We have to try
// to get the version of the library to be sure.
try {
- SVNClientInterface svnClient = new SVNClient();
+ ISVNClient svnClient = new SVNClient();
Version version = svnClient.getVersion();
- if (version.getMajor() == 1 && version.getMinor() == 6)
+ if (version.getMajor() == 1 && version.getMinor() == 7)
available = true;
else {
available = false;
- javaHLErrors = new StringBuffer("Incompatible JavaHL library loaded. 1.6.x or later required.");
+ javaHLErrors = new StringBuffer("Incompatible JavaHL library loaded. Subversion 1.7.x required.");
}
} catch (UnsatisfiedLinkError e) {
available = false;
- javaHLErrors = new StringBuffer("Incompatible JavaHL library loaded. 1.6.x or later required.");
+ javaHLErrors = new StringBuffer("Incompatible JavaHL library loaded. 1.7.x or later required.");
}
}
}
diff --git a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlCommitCallback.java b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlCommitCallback.java
new file mode 100644
index 0000000..cce1ab1
--- /dev/null
+++ b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlCommitCallback.java
@@ -0,0 +1,45 @@
+package org.tigris.subversion.svnclientadapter.javahl;
+
+import java.util.Date;
+
+import org.apache.subversion.javahl.CommitInfo;
+import org.apache.subversion.javahl.callback.CommitCallback;
+
+public class JhlCommitCallback implements CommitCallback {
+
+ CommitInfo commitInfo;
+
+ public void commitInfo(CommitInfo info) {
+ commitInfo = info;
+ }
+
+ /**
+ * retrieve the revision of the commit
+ */
+ public long getRevision() {
+ if (commitInfo == null) return 0L;
+ return commitInfo.getRevision();
+ }
+
+ /**
+ * return the date of the commit
+ */
+ public Date getDate() {
+ if (commitInfo == null) return null;
+ return commitInfo.getDate();
+ }
+
+ /**
+ * return the author of the commit
+ */
+ public String getAuthor() {
+ if (commitInfo == null) return null;
+ return commitInfo.getAuthor();
+ }
+
+ public String getPostCommitError() {
+ if (commitInfo == null) return null;
+ return commitInfo.getPostCommitError();
+ }
+
+}
diff --git a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlCommitMessage.java b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlCommitMessage.java
new file mode 100644
index 0000000..4bb05a2
--- /dev/null
+++ b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlCommitMessage.java
@@ -0,0 +1,22 @@
+package org.tigris.subversion.svnclientadapter.javahl;
+
+import java.util.Set;
+
+import org.apache.subversion.javahl.CommitItem;
+import org.apache.subversion.javahl.callback.CommitMessageCallback;
+
+public class JhlCommitMessage implements CommitMessageCallback {
+
+ private String message;
+
+ public JhlCommitMessage(String message) {
+ super();
+ this.message = message;
+ }
+
+
+ public String getLogMessage(Set<CommitItem> elementsToBeCommited) {
+ return message;
+ }
+
+}
diff --git a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlConflictResolver.java b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlConflictResolver.java
index 6687d79..5eae989 100644
--- a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlConflictResolver.java
+++ b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlConflictResolver.java
@@ -1,9 +1,9 @@
package org.tigris.subversion.svnclientadapter.javahl;
-import org.tigris.subversion.javahl.ConflictDescriptor;
-import org.tigris.subversion.javahl.ConflictResolverCallback;
-import org.tigris.subversion.javahl.ConflictResult;
-import org.tigris.subversion.javahl.SubversionException;
+import org.apache.subversion.javahl.ConflictDescriptor;
+import org.apache.subversion.javahl.ConflictResult;
+import org.apache.subversion.javahl.SubversionException;
+import org.apache.subversion.javahl.callback.ConflictResolverCallback;
import org.tigris.subversion.svnclientadapter.ISVNConflictResolver;
import org.tigris.subversion.svnclientadapter.SVNClientException;
import org.tigris.subversion.svnclientadapter.SVNConflictResult;
@@ -21,7 +21,7 @@ public class JhlConflictResolver implements ConflictResolverCallback {
throws SubversionException {
try {
SVNConflictResult svnConflictResult = worker.resolve(JhlConverter.convertConflictDescriptor(descrip));
- return new ConflictResult(svnConflictResult.getChoice(), svnConflictResult.getMergedPath());
+ return new ConflictResult(JhlConverter.convert(svnConflictResult), svnConflictResult.getMergedPath());
} catch (SVNClientException e) {
throw new JhlException(e);
}
diff --git a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlConverter.java b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlConverter.java
index e3e38dc..17c61f4 100644
--- a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlConverter.java
+++ b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlConverter.java
@@ -18,21 +18,22 @@
******************************************************************************/
package org.tigris.subversion.svnclientadapter.javahl;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
import java.util.logging.Logger;
-import org.tigris.subversion.javahl.ChangePath;
-import org.tigris.subversion.javahl.ConflictDescriptor;
-import org.tigris.subversion.javahl.ConflictResult;
-import org.tigris.subversion.javahl.DiffSummary;
-import org.tigris.subversion.javahl.DirEntry;
-import org.tigris.subversion.javahl.Lock;
-import org.tigris.subversion.javahl.NodeKind;
-import org.tigris.subversion.javahl.Revision;
-import org.tigris.subversion.javahl.RevisionKind;
-import org.tigris.subversion.javahl.RevisionRange;
-import org.tigris.subversion.javahl.ScheduleKind;
-import org.tigris.subversion.javahl.Status;
-import org.tigris.subversion.javahl.StatusKind;
+import org.apache.subversion.javahl.types.ChangePath;
+import org.apache.subversion.javahl.ConflictDescriptor;
+import org.apache.subversion.javahl.ConflictResult;
+import org.apache.subversion.javahl.DiffSummary;
+import org.apache.subversion.javahl.ISVNClient;
+import org.apache.subversion.javahl.types.DirEntry;
+import org.apache.subversion.javahl.types.Info;
+import org.apache.subversion.javahl.types.Lock;
+import org.apache.subversion.javahl.types.Revision;
+import org.apache.subversion.javahl.types.RevisionRange;
+import org.apache.subversion.javahl.types.Status;
import org.tigris.subversion.svnclientadapter.ISVNLogMessageChangePath;
import org.tigris.subversion.svnclientadapter.SVNConflictDescriptor;
import org.tigris.subversion.svnclientadapter.SVNConflictResult;
@@ -44,6 +45,7 @@ import org.tigris.subversion.svnclientadapter.SVNRevision;
import org.tigris.subversion.svnclientadapter.SVNRevisionRange;
import org.tigris.subversion.svnclientadapter.SVNScheduleKind;
import org.tigris.subversion.svnclientadapter.SVNStatusKind;
+import org.tigris.subversion.svnclientadapter.utils.Depth;
/**
* Convert from javahl types to subversion.svnclientadapter.* types
@@ -100,18 +102,20 @@ public class JhlConverter {
return new SVNRevisionRange(JhlConverter.convert(svnRevisionRange.getFromRevision()), JhlConverter.convert(svnRevisionRange.getToRevision()));
}
- public static SVNRevisionRange[] convert(RevisionRange[] jhlRange) {
- SVNRevisionRange[] range = new SVNRevisionRange[jhlRange.length];
- for(int i=0; i < jhlRange.length; i++) {
- range[i] = JhlConverter.convert(jhlRange[i]);
- }
+ public static SVNRevisionRange[] convertRevisionRange(List<RevisionRange> jhlRange) {
+ SVNRevisionRange[] range = new SVNRevisionRange[jhlRange.size()];
+ int i=0;
+ for (RevisionRange item : jhlRange) {
+ range[i] = JhlConverter.convert(item);
+ i++;
+ }
return range;
}
- public static RevisionRange[] convert(SVNRevisionRange[] range) {
- RevisionRange[] jhlRange = new RevisionRange[range.length];
+ public static List<RevisionRange> convert(SVNRevisionRange[] range) {
+ List<RevisionRange> jhlRange = new ArrayList<RevisionRange>(range.length);
for(int i=0; i < range.length; i++) {
- jhlRange[i] = JhlConverter.convert(range[i]);
+ jhlRange.add(JhlConverter.convert(range[i]));
}
return jhlRange;
}
@@ -124,11 +128,11 @@ public class JhlConverter {
public static SVNRevision convert(Revision rev) {
if (rev == null) return null;
switch (rev.getKind()) {
- case RevisionKind.base :
+ case base :
return SVNRevision.BASE;
- case RevisionKind.committed :
+ case committed :
return SVNRevision.COMMITTED;
- case RevisionKind.number :
+ case number :
Revision.Number n = (Revision.Number) rev;
if (n.getNumber() == -1) {
// we return null when resource is not managed ...
@@ -136,9 +140,9 @@ public class JhlConverter {
} else {
return new SVNRevision.Number(n.getNumber());
}
- case RevisionKind.previous :
+ case previous :
return SVNRevision.PREVIOUS;
- case RevisionKind.working :
+ case working :
return SVNRevision.WORKING;
default :
return SVNRevision.HEAD;
@@ -153,12 +157,12 @@ public class JhlConverter {
}
}
- public static SVNNodeKind convertNodeKind(int javahlNodeKind) {
+ public static SVNNodeKind convertNodeKind(org.apache.subversion.javahl.types.NodeKind javahlNodeKind) {
switch(javahlNodeKind) {
- case NodeKind.dir : return SVNNodeKind.DIR;
- case NodeKind.file : return SVNNodeKind.FILE;
- case NodeKind.none : return SVNNodeKind.NONE;
- case NodeKind.unknown : return SVNNodeKind.UNKNOWN;
+ case dir : return SVNNodeKind.DIR;
+ case file : return SVNNodeKind.FILE;
+ case none : return SVNNodeKind.NONE;
+ case unknown : return SVNNodeKind.UNKNOWN;
default: {
log.severe("unknown node kind :"+javahlNodeKind);
return SVNNodeKind.UNKNOWN; // should never go here
@@ -166,39 +170,39 @@ public class JhlConverter {
}
}
- public static JhlStatus convert(Status status) {
- return new JhlStatus(status);
+ public static JhlStatus convert(Status status, ISVNClient client) {
+ return new JhlStatus(status, client);
}
- public static SVNStatusKind convertStatusKind(int kind) {
+ public static SVNStatusKind convertStatusKind(Status.Kind kind) {
switch (kind) {
- case StatusKind.none :
+ case none :
return SVNStatusKind.NONE;
- case StatusKind.normal :
+ case normal :
return SVNStatusKind.NORMAL;
- case StatusKind.added :
+ case added :
return SVNStatusKind.ADDED;
- case StatusKind.missing :
+ case missing :
return SVNStatusKind.MISSING;
- case StatusKind.incomplete :
+ case incomplete :
return SVNStatusKind.INCOMPLETE;
- case StatusKind.deleted :
+ case deleted :
return SVNStatusKind.DELETED;
- case StatusKind.replaced :
+ case replaced :
return SVNStatusKind.REPLACED;
- case StatusKind.modified :
+ case modified :
return SVNStatusKind.MODIFIED;
- case StatusKind.merged :
+ case merged :
return SVNStatusKind.MERGED;
- case StatusKind.conflicted :
+ case conflicted :
return SVNStatusKind.CONFLICTED;
- case StatusKind.obstructed :
+ case obstructed :
return SVNStatusKind.OBSTRUCTED;
- case StatusKind.ignored :
+ case ignored :
return SVNStatusKind.IGNORED;
- case StatusKind.external:
+ case external:
return SVNStatusKind.EXTERNAL;
- case StatusKind.unversioned :
+ case unversioned :
return SVNStatusKind.UNVERSIONED;
default : {
log.severe("unknown status kind :"+kind);
@@ -207,51 +211,42 @@ public class JhlConverter {
}
}
-
- /**
- * Wrap everything up.
- * @param dirEntry
- * @return an JhlDirEntry[] array constructed from the given DirEntry[]
- */
- static JhlDirEntry[] convert(DirEntry[] dirEntry) {
- JhlDirEntry[] entries = new JhlDirEntry[dirEntry.length];
- for(int i=0; i < dirEntry.length; i++) {
- entries[i] = new JhlDirEntry(dirEntry[i]);
- }
- return entries;
- }
static JhlDirEntry convert(DirEntry dirEntry) {
return new JhlDirEntry(dirEntry);
}
- public static JhlStatus[] convert(Status[] status) {
- JhlStatus[] jhlStatus = new JhlStatus[status.length];
- for(int i=0; i < status.length; i++) {
- jhlStatus[i] = new JhlStatus(status[i]);
- }
+ public static JhlStatus[] convertStatus(List<Status> status, ISVNClient client) {
+ JhlStatus[] jhlStatus = new JhlStatus[status.size()];
+ int i=0;
+ for (Status stat : status) {
+ jhlStatus[i] = new JhlStatus(stat, client);
+ i++;
+ }
return jhlStatus;
}
- static ISVNLogMessageChangePath[] convert(ChangePath[] changePaths) {
+ static ISVNLogMessageChangePath[] convertChangePaths(Set<ChangePath> changePaths) {
if (changePaths == null)
return new SVNLogMessageChangePath[0];
- SVNLogMessageChangePath[] jhlChangePaths = new SVNLogMessageChangePath[changePaths.length];
- for(int i=0; i < changePaths.length; i++) {
- jhlChangePaths[i] = new JhlLogMessageChangePath(changePaths[i]);
- }
+ SVNLogMessageChangePath[] jhlChangePaths = new SVNLogMessageChangePath[changePaths.size()];
+ int i =0;
+ for (ChangePath path : changePaths) {
+ jhlChangePaths[i] = new JhlLogMessageChangePath(path);
+ i++;
+ }
return jhlChangePaths;
}
- public static SVNScheduleKind convertScheduleKind(int kind) {
+ public static SVNScheduleKind convertScheduleKind(Info.ScheduleKind kind) {
switch (kind) {
- case ScheduleKind.normal:
+ case normal:
return SVNScheduleKind.NORMAL;
- case ScheduleKind.delete:
+ case delete:
return SVNScheduleKind.DELETE;
- case ScheduleKind.add:
+ case add:
return SVNScheduleKind.ADD;
- case ScheduleKind.replace:
+ case replace:
return SVNScheduleKind.REPLACE;
default : {
log.severe("unknown schedule kind :"+kind);
@@ -268,39 +263,92 @@ public class JhlConverter {
if (d == null) return null;
SVNConflictVersion srcLeftVersion = null;
if (d.getSrcLeftVersion() != null) {
- srcLeftVersion = new SVNConflictVersion(d.getSrcLeftVersion().getReposURL(), d.getSrcLeftVersion().getPegRevision(), d.getSrcLeftVersion().getPathInRepos(), d.getSrcLeftVersion().getNodeKind());
+ srcLeftVersion = new SVNConflictVersion(d.getSrcLeftVersion().getReposURL(), d.getSrcLeftVersion().getPegRevision(), d.getSrcLeftVersion().getPathInRepos(), d.getSrcLeftVersion().getNodeKind().ordinal());
}
SVNConflictVersion srcRightVersion = null;
if (d.getSrcRightVersion() != null) {
- srcRightVersion = new SVNConflictVersion(d.getSrcRightVersion().getReposURL(), d.getSrcRightVersion().getPegRevision(), d.getSrcRightVersion().getPathInRepos(), d.getSrcRightVersion().getNodeKind());
+ srcRightVersion = new SVNConflictVersion(d.getSrcRightVersion().getReposURL(), d.getSrcRightVersion().getPegRevision(), d.getSrcRightVersion().getPathInRepos(), d.getSrcRightVersion().getNodeKind().ordinal());
}
- return new SVNConflictDescriptor(d.getPath(), d.getKind(), d.getNodeKind(),
+ return new SVNConflictDescriptor(d.getPath(), d.getKind().ordinal(), d.getNodeKind().ordinal(),
d.getPropertyName(), d.isBinary(),
- d.getMIMEType(), d.getAction(), d.getReason(), d.getOperation(),
+ d.getMIMEType(), d.getAction().ordinal(), d.getReason().ordinal(), d.getOperation().ordinal(),
srcLeftVersion, srcRightVersion,
d.getBasePath(), d.getTheirPath(),
d.getMyPath(), d.getMergedPath());
}
public static SVNConflictResult convertConflictResult(ConflictResult r) {
- return new SVNConflictResult(r.getChoice(), r.getMergedPath());
+ return new SVNConflictResult(r.getChoice().ordinal(), r.getMergedPath());
}
public static SVNDiffSummary convert(DiffSummary d) {
return new SVNDiffSummary(d.getPath(), JhlConverter.convert(d.getDiffKind()),
- d.propsChanged(), d.getNodeKind());
+ d.propsChanged(), d.getNodeKind().ordinal());
}
public static SVNDiffSummary.SVNDiffKind convert(DiffSummary.DiffKind d) {
- if (d == DiffSummary.DiffKind.ADDED) {
+ if (d == DiffSummary.DiffKind.added) {
return SVNDiffSummary.SVNDiffKind.ADDED;
- } else if (d == DiffSummary.DiffKind.MODIFIED) {
+ } else if (d == DiffSummary.DiffKind.modified) {
return SVNDiffSummary.SVNDiffKind.MODIFIED;
- } else if (d == DiffSummary.DiffKind.DELETED) {
+ } else if (d == DiffSummary.DiffKind.deleted) {
return SVNDiffSummary.SVNDiffKind.DELETED;
} else {
return SVNDiffSummary.SVNDiffKind.NORMAL;
}
}
+
+ public static ConflictResult.Choice convert(SVNConflictResult result) {
+ switch (result.getChoice()) {
+ case SVNConflictResult.chooseBase:
+ return ConflictResult.Choice.chooseBase;
+ case SVNConflictResult.chooseMerged:
+ return ConflictResult.Choice.chooseMerged;
+ case SVNConflictResult.chooseMine:
+ return ConflictResult.Choice.chooseMineConflict;
+ case SVNConflictResult.chooseMineFull:
+ return ConflictResult.Choice.chooseMineFull;
+ case SVNConflictResult.chooseTheirs:
+ return ConflictResult.Choice.chooseTheirsConflict;
+ case SVNConflictResult.chooseTheirsFull:
+ return ConflictResult.Choice.chooseTheirsFull;
+ case SVNConflictResult.postpone:
+ return ConflictResult.Choice.postpone;
+ default:
+ return ConflictResult.Choice.postpone;
+ }
+ }
+ public static char convert(ChangePath.Action action) {
+ switch (action) {
+ case add:
+ return 'A';
+ case delete:
+ return 'D';
+ case modify:
+ return 'M';
+ case replace:
+ return 'R';
+ default:
+ return '?';
+ }
+ }
+
+ public static org.apache.subversion.javahl.types.Depth depth(int depthValue) {
+ switch(depthValue) {
+ case Depth.empty:
+ return org.apache.subversion.javahl.types.Depth.empty;
+ case Depth.files:
+ return org.apache.subversion.javahl.types.Depth.files;
+ case Depth.immediates:
+ return org.apache.subversion.javahl.types.Depth.immediates;
+ case Depth.infinity:
+ return org.apache.subversion.javahl.types.Depth.infinity;
+ case Depth.exclude:
+ return org.apache.subversion.javahl.types.Depth.exclude;
+ default:
+ return org.apache.subversion.javahl.types.Depth.unknown;
+ }
+
+ }
}
diff --git a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlDiffSummaryReceiver.java b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlDiffSummaryReceiver.java
index 0339dd9..5a20f57 100644
--- a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlDiffSummaryReceiver.java
+++ b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlDiffSummaryReceiver.java
@@ -3,13 +3,13 @@ package org.tigris.subversion.svnclientadapter.javahl;
import java.util.ArrayList;
import java.util.List;
-import org.tigris.subversion.javahl.DiffSummary;
-import org.tigris.subversion.javahl.DiffSummaryReceiver;
+import org.apache.subversion.javahl.DiffSummary;
+import org.apache.subversion.javahl.callback.DiffSummaryCallback;
import org.tigris.subversion.svnclientadapter.SVNDiffSummary;
-public class JhlDiffSummaryReceiver implements DiffSummaryReceiver {
+public class JhlDiffSummaryReceiver implements DiffSummaryCallback {
- List summary = new ArrayList();
+ List<SVNDiffSummary> summary = new ArrayList<SVNDiffSummary>();
public void onSummary(DiffSummary descriptor) {
summary.add(JhlConverter.convert(descriptor));
diff --git a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlDirEntry.java b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlDirEntry.java
index f08494e..04a04c6 100644
--- a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlDirEntry.java
+++ b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlDirEntry.java
@@ -20,7 +20,7 @@ package org.tigris.subversion.svnclientadapter.javahl;
import java.util.Date;
-import org.tigris.subversion.javahl.DirEntry;
+import org.apache.subversion.javahl.types.DirEntry;
import org.tigris.subversion.svnclientadapter.ISVNDirEntry;
import org.tigris.subversion.svnclientadapter.SVNNodeKind;
import org.tigris.subversion.svnclientadapter.SVNRevision;
diff --git a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlDirEntryWithLock.java b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlDirEntryWithLock.java
index 5936ddc..40ba141 100644
--- a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlDirEntryWithLock.java
+++ b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlDirEntryWithLock.java
@@ -1,7 +1,7 @@
package org.tigris.subversion.svnclientadapter.javahl;
-import org.tigris.subversion.javahl.DirEntry;
-import org.tigris.subversion.javahl.Lock;
+import org.apache.subversion.javahl.types.DirEntry;
+import org.apache.subversion.javahl.types.Lock;
import org.tigris.subversion.svnclientadapter.ISVNDirEntry;
import org.tigris.subversion.svnclientadapter.ISVNDirEntryWithLock;
import org.tigris.subversion.svnclientadapter.ISVNLock;
diff --git a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlException.java b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlException.java
index 37032e9..efd5ce1 100644
--- a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlException.java
+++ b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlException.java
@@ -1,10 +1,12 @@
package org.tigris.subversion.svnclientadapter.javahl;
-import org.tigris.subversion.javahl.SubversionException;
+import org.apache.subversion.javahl.SubversionException;
import org.tigris.subversion.svnclientadapter.SVNClientException;
public class JhlException extends SubversionException {
+ private static final long serialVersionUID = 328804379812661422L;
+
protected JhlException(String message) {
super(message);
}
diff --git a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlInfo.java b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlInfo.java
index 00c3e3e..9806930 100644
--- a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlInfo.java
+++ b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlInfo.java
@@ -23,13 +23,12 @@ import java.io.IOException;
import java.net.MalformedURLException;
import java.util.Date;
-import org.tigris.subversion.javahl.Depth;
-import org.tigris.subversion.javahl.Info;
+import org.apache.subversion.javahl.types.Info;
import org.tigris.subversion.svnclientadapter.ISVNInfo;
import org.tigris.subversion.svnclientadapter.SVNNodeKind;
+import org.tigris.subversion.svnclientadapter.SVNRevision.Number;
import org.tigris.subversion.svnclientadapter.SVNScheduleKind;
import org.tigris.subversion.svnclientadapter.SVNUrl;
-import org.tigris.subversion.svnclientadapter.SVNRevision.Number;
/**
* A JavaHL based implementation of {@link ISVNInfo}.
@@ -87,7 +86,7 @@ public class JhlInfo implements ISVNInfo {
* @see org.tigris.subversion.svnclientadapter.ISVNInfo#getUuid()
*/
public String getUuid() {
- return info.getUuid();
+ return info.getReposUUID();
}
/* (non-Javadoc)
@@ -95,7 +94,7 @@ public class JhlInfo implements ISVNInfo {
*/
public SVNUrl getRepository() {
try {
- return new SVNUrl(info.getRepository());
+ return new SVNUrl(info.getUrl());
} catch (MalformedURLException e) {
//should never happen.
return null;
@@ -113,28 +112,28 @@ public class JhlInfo implements ISVNInfo {
* @see org.tigris.subversion.svnclientadapter.ISVNInfo#getNodeKind()
*/
public SVNNodeKind getNodeKind() {
- return JhlConverter.convertNodeKind(info.getNodeKind());
+ return JhlConverter.convertNodeKind(info.getKind());
}
/* (non-Javadoc)
* @see org.tigris.subversion.svnclientadapter.ISVNInfo#getAuthor()
*/
public String getLastCommitAuthor() {
- return info.getAuthor();
+ return info.getLastChangedAuthor();
}
/* (non-Javadoc)
* @see org.tigris.subversion.svnclientadapter.ISVNInfo#getRevision()
*/
public Number getRevision() {
- return JhlConverter.convertRevisionNumber(info.getRevision());
+ return JhlConverter.convertRevisionNumber(info.getRev());
}
/* (non-Javadoc)
* @see org.tigris.subversion.svnclientadapter.ISVNInfo#getLastChangedRevision()
*/
public Number getLastChangedRevision() {
- return JhlConverter.convertRevisionNumber(info.getLastChangedRevision());
+ return JhlConverter.convertRevisionNumber(info.getLastChangedRev());
}
/* (non-Javadoc)
@@ -148,28 +147,28 @@ public class JhlInfo implements ISVNInfo {
* @see org.tigris.subversion.svnclientadapter.ISVNInfo#getLastDateTextUpdate()
*/
public Date getLastDateTextUpdate() {
- return info.getLastDateTextUpdate();
+ return info.getTextTime();
}
/* (non-Javadoc)
* @see org.tigris.subversion.svnclientadapter.ISVNInfo#getLastDatePropsUpdate()
*/
public Date getLastDatePropsUpdate() {
- return info.getLastDatePropsUpdate();
+ return null;
}
/* (non-Javadoc)
* @see org.tigris.subversion.svnclientadapter.ISVNInfo#isCopied()
*/
public boolean isCopied() {
- return (info.getCopyRev() > 0);
+ return (info.getCopyFromRev() > 0);
}
/* (non-Javadoc)
* @see org.tigris.subversion.svnclientadapter.ISVNInfo#getCopyRev()
*/
public Number getCopyRev() {
- return JhlConverter.convertRevisionNumber(info.getCopyRev());
+ return JhlConverter.convertRevisionNumber(info.getCopyFromRev());
}
/* (non-Javadoc)
@@ -177,7 +176,7 @@ public class JhlInfo implements ISVNInfo {
*/
public SVNUrl getCopyUrl() {
try {
- return new SVNUrl(info.getCopyUrl());
+ return new SVNUrl(info.getCopyFromUrl());
} catch (MalformedURLException e) {
//should never happen.
return null;
@@ -213,6 +212,6 @@ public class JhlInfo implements ISVNInfo {
*/
public int getDepth() {
//Not available in info(1)
- return Depth.unknown;
+ return info.getDepth().ordinal();
}
}
diff --git a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlInfo2.java b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlInfo2.java
index 1f4ee8f..50fec0c 100644
--- a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlInfo2.java
+++ b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlInfo2.java
@@ -23,13 +23,12 @@ import java.io.IOException;
import java.net.MalformedURLException;
import java.util.Date;
-import org.tigris.subversion.javahl.Depth;
-import org.tigris.subversion.javahl.Info2;
+import org.apache.subversion.javahl.types.Info;
import org.tigris.subversion.svnclientadapter.ISVNInfo;
import org.tigris.subversion.svnclientadapter.SVNNodeKind;
+import org.tigris.subversion.svnclientadapter.SVNRevision.Number;
import org.tigris.subversion.svnclientadapter.SVNScheduleKind;
import org.tigris.subversion.svnclientadapter.SVNUrl;
-import org.tigris.subversion.svnclientadapter.SVNRevision.Number;
/**
* A JavaHL based implementation of {@link ISVNInfo}.
@@ -39,7 +38,7 @@ import org.tigris.subversion.svnclientadapter.SVNRevision.Number;
*/
public class JhlInfo2 implements ISVNInfo {
- private Info2 info;
+ private Info info;
private File file;
/**
@@ -47,9 +46,12 @@ public class JhlInfo2 implements ISVNInfo {
* @param file
* @param info
*/
- public JhlInfo2(File file, Info2 info) {
+ public JhlInfo2(String path, Info info) {
super();
- this.file = file;
+ if (path == null)
+ file = null;
+ else
+ file = new File(path);
this.info = info;
}
@@ -156,7 +158,7 @@ public class JhlInfo2 implements ISVNInfo {
* @see org.tigris.subversion.svnclientadapter.ISVNInfo#getLastDatePropsUpdate()
*/
public Date getLastDatePropsUpdate() {
- return info.getPropTime();
+ return null;
}
/* (non-Javadoc)
@@ -218,6 +220,6 @@ public class JhlInfo2 implements ISVNInfo {
* @see org.tigris.subversion.svnclientadapter.ISVNInfo#getDepth()
*/
public int getDepth() {
- return info.getDepth();
+ return info.getDepth().ordinal();
}
}
diff --git a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlInfoCallback.java b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlInfoCallback.java
new file mode 100644
index 0000000..695a47d
--- /dev/null
+++ b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlInfoCallback.java
@@ -0,0 +1,23 @@
+package org.tigris.subversion.svnclientadapter.javahl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.subversion.javahl.types.Info;
+import org.apache.subversion.javahl.callback.InfoCallback;
+import org.tigris.subversion.svnclientadapter.ISVNInfo;
+
+public class JhlInfoCallback implements InfoCallback {
+
+ List<ISVNInfo> items = new ArrayList<ISVNInfo>();
+
+ public void singleInfo(Info info) {
+ items.add(new JhlInfo2(info.getPath(), info));
+ }
+
+ public ISVNInfo[] getInfo() {
+ ISVNInfo[] itemArray = new ISVNInfo[items.size()];
+ return items.toArray(itemArray);
+ }
+
+}
diff --git a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlLock.java b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlLock.java
index 379d769..969d060 100644
--- a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlLock.java
+++ b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlLock.java
@@ -20,7 +20,7 @@ package org.tigris.subversion.svnclientadapter.javahl;
import java.util.Date;
-import org.tigris.subversion.javahl.Lock;
+import org.apache.subversion.javahl.types.Lock;
import org.tigris.subversion.svnclientadapter.ISVNLock;
/**
diff --git a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlLogMessage.java b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlLogMessage.java
index cb4c947..67b8ef1 100644
--- a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlLogMessage.java
+++ b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlLogMessage.java
@@ -18,15 +18,17 @@
******************************************************************************/
package org.tigris.subversion.svnclientadapter.javahl;
+import java.io.UnsupportedEncodingException;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.Set;
-import org.tigris.subversion.javahl.ChangePath;
-import org.tigris.subversion.javahl.LogDate;
+import org.apache.subversion.javahl.types.ChangePath;
+import org.apache.subversion.javahl.types.LogDate;
import org.tigris.subversion.svnclientadapter.ISVNLogMessage;
import org.tigris.subversion.svnclientadapter.ISVNLogMessageChangePath;
import org.tigris.subversion.svnclientadapter.SVNRevision;
@@ -41,32 +43,33 @@ public class JhlLogMessage implements ISVNLogMessage {
private static final String EMPTY = "";
- private List children;
+ private List<ISVNLogMessage> children;
private boolean hasChildren;
private ISVNLogMessageChangePath[] changedPaths;
private SVNRevision.Number revision;
- private Map revprops;
+ private Map<String, byte[]> revprops;
private LogDate logDate;
- public JhlLogMessage(ChangePath[] changedPaths, long revision, Map revprops, boolean hasChildren) {
- this.changedPaths = JhlConverter.convert(changedPaths);
+ public JhlLogMessage(Set<ChangePath> changedPaths, long revision,
+ Map<String, byte[]> revprops, boolean hasChildren) {
+ this.changedPaths = JhlConverter.convertChangePaths(changedPaths);
this.revision = new SVNRevision.Number(revision);
this.revprops = revprops;
if (this.revprops == null) {
- this.revprops = new HashMap(2); // avoid NullPointerErrors
- this.revprops.put(AUTHOR, EMPTY);
- this.revprops.put(MESSAGE, EMPTY);
+ this.revprops = new HashMap<String, byte[]>(2); // avoid NullPointerErrors
+ this.revprops.put(AUTHOR, EMPTY.getBytes());
+ this.revprops.put(MESSAGE, EMPTY.getBytes());
}
this.hasChildren = hasChildren;
try {
- logDate = new LogDate((String) this.revprops.get(DATE));
+ logDate = new LogDate(new String(this.revprops.get(DATE)));
} catch (ParseException e) {
}
}
public void addChild(ISVNLogMessage msg) {
if (children == null)
- children = new ArrayList();
+ children = new ArrayList<ISVNLogMessage>();
children.add(msg);
}
@@ -81,7 +84,17 @@ public class JhlLogMessage implements ISVNLogMessage {
* @see org.tigris.subversion.svnclientadapter.ISVNLogMessage#getAuthor()
*/
public String getAuthor() {
- return (String) revprops.get(AUTHOR);
+ byte[] author = revprops.get(AUTHOR);
+ if (author == null) {
+ return "";
+ }
+ else {
+ try {
+ return new String(author, "UTF8");
+ } catch (UnsupportedEncodingException e) {
+ return new String(author);
+ }
+ }
}
/* (non-Javadoc)
@@ -97,7 +110,17 @@ public class JhlLogMessage implements ISVNLogMessage {
* @see org.tigris.subversion.svnclientadapter.ISVNLogMessage#getMessage()
*/
public String getMessage() {
- return (String) revprops.get(MESSAGE);
+ byte[] message = revprops.get(MESSAGE);
+ if (message == null) {
+ return "";
+ }
+ else {
+ try {
+ return new String(message, "UTF8");
+ } catch (UnsupportedEncodingException e) {
+ return new String(message);
+ }
+ }
}
/* (non-Javadoc)
diff --git a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlLogMessageCallback.java b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlLogMessageCallback.java
index 649b437..df90794 100644
--- a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlLogMessageCallback.java
+++ b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlLogMessageCallback.java
@@ -1,10 +1,11 @@
package org.tigris.subversion.svnclientadapter.javahl;
import java.util.Map;
+import java.util.Set;
-import org.tigris.subversion.javahl.ChangePath;
-import org.tigris.subversion.javahl.LogMessageCallback;
-import org.tigris.subversion.javahl.Revision;
+import org.apache.subversion.javahl.types.ChangePath;
+import org.apache.subversion.javahl.types.Revision;
+import org.apache.subversion.javahl.callback.LogMessageCallback;
import org.tigris.subversion.svnclientadapter.ISVNLogMessageCallback;
public class JhlLogMessageCallback implements LogMessageCallback {
@@ -20,15 +21,15 @@ public class JhlLogMessageCallback implements LogMessageCallback {
super();
}
- public void singleMessage(ChangePath[] changedPaths, long revision,
- Map revprops, boolean hasChildren) {
+
+ public void singleMessage(Set<ChangePath> changedPaths, long revision,
+ Map<String, byte[]> revprops, boolean hasChildren) {
if (revision == Revision.SVN_INVALID_REVNUM) {
worker.singleMessage(null);
} else {
worker.singleMessage(new JhlLogMessage(changedPaths, revision, revprops, hasChildren));
}
-
}
-
+
}
diff --git a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlLogMessageChangePath.java b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlLogMessageChangePath.java
index 27f4608..704857c 100644
--- a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlLogMessageChangePath.java
+++ b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlLogMessageChangePath.java
@@ -18,7 +18,7 @@
******************************************************************************/
package org.tigris.subversion.svnclientadapter.javahl;
-import org.tigris.subversion.javahl.ChangePath;
+import org.apache.subversion.javahl.types.ChangePath;
import org.tigris.subversion.svnclientadapter.SVNLogMessageChangePath;
import org.tigris.subversion.svnclientadapter.SVNRevision;
@@ -39,7 +39,7 @@ public class JhlLogMessageChangePath extends SVNLogMessageChangePath {
(changePath.getCopySrcRevision() != -1) ? new SVNRevision.Number(
changePath.getCopySrcRevision()) : null,
changePath.getCopySrcPath(),
- changePath.getAction());
+ JhlConverter.convert(changePath.getAction()));
}
}
diff --git a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlMergeInfo.java b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlMergeInfo.java
index 2d40bde..62e8e68 100644
--- a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlMergeInfo.java
+++ b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlMergeInfo.java
@@ -18,11 +18,8 @@
******************************************************************************/
package org.tigris.subversion.svnclientadapter.javahl;
-import java.util.Iterator;
-import java.util.List;
-import org.tigris.subversion.javahl.Mergeinfo;
-import org.tigris.subversion.javahl.RevisionRange;
+import org.apache.subversion.javahl.types.Mergeinfo;
import org.tigris.subversion.svnclientadapter.ISVNMergeInfo;
import org.tigris.subversion.svnclientadapter.SVNRevisionRange;
@@ -55,26 +52,20 @@ public class JhlMergeInfo implements ISVNMergeInfo {
public String[] getPaths() {
if (info == null)
return null;
- return info.getPaths();
+ return (String[]) info.getPaths().toArray();
}
public SVNRevisionRange[] getRevisionRange(String path) {
if (info == null)
return null;
- return JhlConverter.convert(info.getRevisionRange(path));
+ return JhlConverter.convertRevisionRange(info.getRevisionRange(path));
}
public SVNRevisionRange[] getRevisions(String path) {
if (info == null)
return null;
- List rangeList = info.getRevisions(path);
- SVNRevisionRange[] range = new SVNRevisionRange[rangeList.size()];
- int i = 0;
- for (Iterator iter = rangeList.iterator(); iter.hasNext();) {
- range[i] = JhlConverter.convert((RevisionRange) iter.next());
- }
- return range;
+ return JhlConverter.convertRevisionRange(info.getRevisions(path));
}
public void loadFromMergeInfoProperty(String mergeInfo) {
diff --git a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlNotificationHandler.java b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlNotificationHandler.java
index db21765..44bfa2b 100644
--- a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlNotificationHandler.java
+++ b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlNotificationHandler.java
@@ -18,14 +18,12 @@
******************************************************************************/
package org.tigris.subversion.svnclientadapter.javahl;
-import org.tigris.subversion.javahl.NodeKind;
-import org.tigris.subversion.javahl.Notify2;
-import org.tigris.subversion.javahl.NotifyAction;
-import org.tigris.subversion.javahl.NotifyInformation;
-import org.tigris.subversion.javahl.NotifyStatus;
-import org.tigris.subversion.javahl.Revision;
-import org.tigris.subversion.javahl.RevisionRange;
+import org.apache.subversion.javahl.ClientNotifyInformation;
+import org.apache.subversion.javahl.types.Revision;
+import org.apache.subversion.javahl.types.RevisionRange;
+import org.apache.subversion.javahl.callback.ClientNotifyCallback;
import org.tigris.subversion.svnclientadapter.ISVNNotifyListener;
+import org.tigris.subversion.svnclientadapter.SVNConflictVersion.NodeKind;
import org.tigris.subversion.svnclientadapter.SVNNotificationHandler;
import org.tigris.subversion.svnclientadapter.utils.Messages;
@@ -41,7 +39,7 @@ import org.tigris.subversion.svnclientadapter.utils.Messages;
*
*
*/
-public class JhlNotificationHandler extends SVNNotificationHandler implements Notify2 {
+public class JhlNotificationHandler extends SVNNotificationHandler implements ClientNotifyCallback {
private boolean receivedSomeChange;
private boolean sentFirstTxdelta;
@@ -65,23 +63,13 @@ public class JhlNotificationHandler extends SVNNotificationHandler implements No
private static final int COMMIT_ACROSS_WC_COMPLETED = -11;
private static final int ENDED_ABNORMAL = -1;
- public void onNotify(NotifyInformation info) {
-
+ public void onNotify(ClientNotifyInformation info) {
// for some actions, we don't want to call notifyListenersOfChange :
// when the status of the target has not been modified
boolean notify = true;
switch (info.getAction()) {
- case ENDED_ABNORMAL:
- if (command == ISVNNotifyListener.Command.COMMIT)
- logError(Messages.bind("notify.commit.abnormal")); //$NON-NLS-1$
- else
- logError(Messages.bind("notify.end.abnormal")); //$NON-NLS-1$
- if (info.getErrMsg() != null)
- logError(info.getErrMsg());
- notify = false;
- break;
- case NotifyAction.foreign_merge_begin :
+ case foreign_merge_begin :
if (info.getMergeRange() != null) {
if (info.getMergeRange().getFromRevision().equals(info.getMergeRange().getToRevision()))
logMessage("--- Merging (from foreign repository) r" + info.getMergeRange().getFromRevision().toString() + " into " + info.getPath());
@@ -96,7 +84,7 @@ public class JhlNotificationHandler extends SVNNotificationHandler implements No
}
notify = false;
break;
- case NotifyAction.merge_begin :
+ case merge_begin :
if (info.getMergeRange() != null) {
if (info.getMergeRange().getFromRevision().equals(info.getMergeRange().getToRevision()))
logMessage("--- Merging r" + info.getMergeRange().getFromRevision().toString() + " into " + info.getPath());
@@ -111,122 +99,141 @@ public class JhlNotificationHandler extends SVNNotificationHandler implements No
}
notify = false;
break;
- case NotifyAction.skip :
- logMessage(Messages.bind("notify.skipped", info.getPath())); //$NON-NLS-1$
- notify = false;
+ case skip :
+ notify = logSkipped(info, Messages.bind("notify.skipped", info.getPath())); //$NON-NLS-1$
break;
- case NotifyAction.failed_lock:
- if (info.getErrMsg() == null)
- logError(Messages.bind("notify.lock.failed", info.getPath())); //$NON-NLS-1$
- else
- logError(info.getErrMsg());
- notify = false;
+ case update_skip_obstruction :
+ notify = logSkipped(info, Messages.bind("notify.update.skip.obstruction", info.getPath())); //$NON-NLS-1$
break;
- case NotifyAction.failed_unlock:
- if (info.getErrMsg() == null)
- logError(Messages.bind("notify.unlock.failed", info.getPath())); //$NON-NLS-1$
- else
- logError(info.getErrMsg());
- notify = false;
+ case update_skip_working_only :
+ notify = logSkipped(info, Messages.bind("notify.update.skip.working.only", info.getPath())); //$NON-NLS-1$
+ break;
+ case update_skip_access_denied :
+ notify = logSkipped(info, Messages.bind("notify.update.skip.access.denied", info.getPath())); //$NON-NLS-1$
+ break;
+ case failed_lock:
+ notify = logFailedOperation(info, Messages.bind("notify.lock.failed", info.getPath())); //$NON-NLS-1$
+ break;
+ case failed_unlock:
+ notify = logFailedOperation(info, Messages.bind("notify.unlock.failed", info.getPath())); //$NON-NLS-1$
break;
- case NotifyAction.locked:
+ case locked:
if (info.getLock() != null && info.getLock().getOwner() != null)
logMessage(Messages.bind("notify.lock.other", info.getLock().getPath(), info.getLock().getOwner())); //$NON-NLS-1$
else
logMessage(Messages.bind("notify.lock", info.getPath())); //$NON-NLS-1$
notify = false; // for JavaHL bug
break;
- case NotifyAction.unlocked:
+ case unlocked:
logMessage(Messages.bind("notify.unlock", info.getPath())); //$NON-NLS-1$
notify = false; // for JavaHL bug
break;
- case NotifyAction.update_delete :
+ case update_delete :
+ case update_shadowed_delete :
logMessage("D " + info.getPath()); //$NON-NLS-1$
receivedSomeChange = true;
deletes += 1;
break;
- case NotifyAction.update_replaced :
+ case update_replaced :
logMessage("R " + info.getPath()); //$NON-NLS-1$
receivedSomeChange = true;
adds += 1;
deletes += 1;
break;
- case NotifyAction.update_add :
+ case update_add :
+ case update_shadowed_add :
logMessage("A " + info.getPath()); //$NON-NLS-1$
receivedSomeChange = true;
adds += 1;
break;
- case NotifyAction.exists :
+ case exists :
logMessage("E " + info.getPath()); //$NON-NLS-1$
receivedSomeChange = true;
exists += 1;
break;
- case NotifyAction.restore :
+ case changelist_set :
+ logMessage(Messages.bind("notify.changelist.set", info.getPath())); //$NON-NLS-1$
+ notify = false;
+ break;
+ case changelist_clear :
+ logMessage(Messages.bind("notify.changelist.clear", info.getPath())); //$NON-NLS-1$
+ notify = false;
+ break;
+ case changelist_moved :
+ logMessage(Messages.bind("notify.changelist.moved", info.getPath())); //$NON-NLS-1$
+ notify = false;
+ break;
+ case restore :
logMessage(Messages.bind("notify.restored", info.getPath())); //$NON-NLS-1$
break;
- case NotifyAction.revert :
+ case revert :
logMessage(Messages.bind("notify.reverted", info.getPath())); //$NON-NLS-1$
break;
- case NotifyAction.failed_revert :
+ case failed_revert :
logError(Messages.bind("notify.revert.failed", info.getPath())); //$NON-NLS-1$
notify = false;
break;
- case NotifyAction.resolved :
+ case resolved :
logMessage(Messages.bind("notify.resolved", info.getPath())); //$NON-NLS-1$
break;
- case NotifyAction.add :
+ case add :
logMessage("A " + info.getPath()); //$NON-NLS-1$
break;
- case NotifyAction.delete :
+ case copy :
+ logMessage(Messages.bind("notify.copy", info.getPath())); //$NON-NLS-1$
+ notify = false;
+ break;
+ case delete :
logMessage("D " + info.getPath()); //$NON-NLS-1$
receivedSomeChange = true;
break;
- case NotifyAction.tree_conflict :
+ case tree_conflict :
logError(" C " + info.getPath()); //$NON-NLS-1$
receivedSomeChange = true;
treeConflicts += 1;
break;
- case NotifyAction.update_update :
+ case update_update :
+ case update_shadowed_update :
boolean error = false;
- if (!((info.getKind() == NodeKind.dir)
- && ((info.getPropState() == NotifyStatus.inapplicable)
- || (info.getPropState() == NotifyStatus.unknown)
- || (info.getPropState() == NotifyStatus.unchanged)))) {
+ if (!((info.getKind().ordinal() == NodeKind.directory)
+ && ((info.getPropState() == ClientNotifyInformation.Status.inapplicable)
+ || (info.getPropState() == ClientNotifyInformation.Status.unknown)
+ || (info.getPropState() == ClientNotifyInformation.Status.unchanged)))) {
receivedSomeChange = true;
char[] statecharBuf = new char[] { ' ', ' ' };
- if (info.getKind() == NodeKind.file) {
- if (info.getContentState() == NotifyStatus.conflicted) {
+ if (info.getKind().ordinal() == NodeKind.file) {
+ if (info.getContentState() == ClientNotifyInformation.Status.conflicted) {
statecharBuf[0] = 'C';
conflicts += 1;
error = true;
}
- else if (info.getContentState() == NotifyStatus.merged) {
+ else if (info.getContentState() == ClientNotifyInformation.Status.merged) {
statecharBuf[0] = 'G';
merges += 1;
error = true;
}
- else if (info.getContentState() == NotifyStatus.changed) {
+ else if (info.getContentState() == ClientNotifyInformation.Status.changed) {
statecharBuf[0] = 'U';
updates += 1;
}
- else if (info.getContentState() == NotifyStatus.unchanged && info.getPropState() < NotifyStatus.obstructed)
+ else if (info.getContentState() == ClientNotifyInformation.Status.unchanged && info.getPropState().ordinal() < ClientNotifyInformation.Status.obstructed.ordinal())
break;
}
- if (info.getPropState() == NotifyStatus.conflicted) {
+ if (info.getPropState() == ClientNotifyInformation.Status.conflicted) {
statecharBuf[1] = 'C';
propConflicts += 1;
error = true;
}
- else if (info.getPropState() == NotifyStatus.merged) {
+ else if (info.getPropState() == ClientNotifyInformation.Status.merged) {
statecharBuf[1] = 'G';
propMerges += 1;
error = true;
}
- else if (info.getPropState() == NotifyStatus.changed) {
+ else if (info.getPropState() == ClientNotifyInformation.Status.changed) {
statecharBuf[1] = 'U';
propUpdates += 1;
}
- if (info.getContentState() == NotifyStatus.unknown && info.getPropState() == NotifyStatus.unknown)
+ if (info.getContentState() == ClientNotifyInformation.Status.unknown && info.getPropState() == ClientNotifyInformation.Status.unknown)
break;
if (error)
logError("" + statecharBuf[0] + statecharBuf[1] + " " + info.getPath()); //$NON-NLS-1$ //$NON-NLS-2$
@@ -234,11 +241,14 @@ public class JhlNotificationHandler extends SVNNotificationHandler implements No
logMessage("" + statecharBuf[0] + statecharBuf[1] + " " + info.getPath()); //$NON-NLS-1$ //$NON-NLS-2$
}
break;
- case NotifyAction.update_external :
+ case update_external :
logMessage(Messages.bind("notify.update.external", info.getPath())); //$NON-NLS-1$
inExternal = true;
break;
- case NotifyAction.update_completed :
+ case update_external_removed :
+ logMessage(Messages.bind("notify.update.external.removed", info.getPath())); //$NON-NLS-1$
+ break;
+ case update_completed :
notify = false;
if (info.getRevision() >= 0) {
logRevision( info.getRevision(), info.getPath() );
@@ -280,12 +290,12 @@ public class JhlNotificationHandler extends SVNNotificationHandler implements No
}
}
break;
- case NotifyAction.status_external :
+ case status_external :
if (!skipCommand())
logMessage(Messages.bind("notify.status.external", info.getPath())); //$NON-NLS-1$
notify = false;
break;
- case NotifyAction.status_completed :
+ case status_completed :
notify = false;
if (info.getRevision() >= 0) {
logRevision(info.getRevision(), info.getPath());
@@ -293,63 +303,148 @@ public class JhlNotificationHandler extends SVNNotificationHandler implements No
logMessage(Messages.bind("notify.status.revision", Long.toString(info.getRevision()))); //$NON-NLS-1$
}
break;
- case NotifyAction.commit_modified :
+ case commit_modified :
logMessage(Messages.bind("notify.commit.modified", info.getPath())); //$NON-NLS-1$
break;
- case NotifyAction.commit_added :
+ case commit_added :
+ case commit_copied :
logMessage(Messages.bind("notify.commit.add", info.getPath())); //$NON-NLS-1$
break;
- case NotifyAction.commit_deleted :
+ case commit_deleted :
logMessage(Messages.bind("notify.commit.delete", info.getPath())); //$NON-NLS-1$
break;
- case NotifyAction.commit_replaced :
+ case commit_replaced :
+ case commit_copied_replaced :
logMessage(Messages.bind("notify.commit.replace", info.getPath())); //$NON-NLS-1$
break;
- case NotifyAction.commit_postfix_txdelta :
+ case commit_postfix_txdelta :
notify = false;
if (!sentFirstTxdelta) {
logMessage(Messages.bind("notify.commit.transmit")); //$NON-NLS-1$
sentFirstTxdelta = true;
}
- break;
- case COMMIT_ACROSS_WC_COMPLETED :
- notify = false;
- logCompleted(Messages.bind("notify.commit", Long.toString(info.getRevision()))); //$NON-NLS-1$
- break;
- case NotifyAction.property_added:
+ break;
+ case url_redirect :
+ break;
+ case property_added:
logMessage(Messages.bind("notify.property.set", info.getPath())); //$NON-NLS-1$
break;
- case NotifyAction.property_modified:
+ case property_modified:
logMessage(Messages.bind("notify.property.set", info.getPath())); //$NON-NLS-1$
break;
- case NotifyAction.property_deleted:
+ case property_deleted:
logMessage(Messages.bind("notify.property.deleted", info.getPath())); //$NON-NLS-1$
break;
- case NotifyAction.property_deleted_nonexistent:
+ case property_deleted_nonexistent:
notify = false;
logMessage(Messages.bind("notify.property.deleted.nonexistent")); //$NON-NLS-1$
break;
- case NotifyAction.revprop_set:
+ case revprop_set:
notify = false;
logMessage(Messages.bind("notify.revision.property.set")); //$NON-NLS-1$
break;
- case NotifyAction.revprop_deleted:
+ case revprop_deleted:
notify = false;
logMessage(Messages.bind("notify.revision.property.deleted")); //$NON-NLS-1$
break;
- case NotifyAction.merge_completed:
- break;
- case NotifyAction.blame_revision:
+ case merge_completed:
break;
+ case blame_revision:
+ break;
+ case update_started:
+ break;
+ case merge_record_info:
+ logMessage(Messages.bind("notify.merge.record.info", info.getPath())); //$NON-NLS-1$
+ propUpdates += 1;
+ break;
+ case merge_record_info_begin:
+ break;
+ case merge_elide_info:
+ break;
+ case patch:
+ notify = false;
+ logMessage(Messages.bind("notify.patch")); //$NON-NLS-1$
+ break;
+ case patch_applied_hunk:
+ logMessage(Messages.bind("notify.patch.applied.hunk", info.getPath())); //$NON-NLS-1$
+ break;
+ case patch_rejected_hunk:
+ notify = logFailedOperation(info, Messages.bind("notify.patch.rejected.hunk", info.getPath()));
+ break;
+ case patch_hunk_already_applied:
+ notify = logFailedOperation(info, Messages.bind("notify.patch.hunk.already.applied", info.getPath()));
+ break;
+ case upgraded_path:
+ logMessage(Messages.bind("notify.upgraded.path", info.getPath())); //$NON-NLS-1$
+ break;
+ case failed_external:
+ notify = logFailedOperation(info, Messages.bind("notify.external", info.getPath())); //$NON-NLS-1$
+ break;
+ case failed_conflict:
+ notify = logFailedOperation(info, Messages.bind("notify.conflict", info.getPath())); //$NON-NLS-1$
+ break;
+ case failed_missing:
+ notify = logFailedOperation(info, Messages.bind("notify.missing", info.getPath())); //$NON-NLS-1$
+ break;
+ case failed_out_of_date:
+ notify = logFailedOperation(info, Messages.bind("notify.out.of.date", info.getPath())); //$NON-NLS-1$
+ break;
+ case failed_no_parent:
+ notify = logFailedOperation(info, Messages.bind("notify.no.parent")); //$NON-NLS-1$
+ break;
+ case failed_locked:
+ notify = logFailedOperation(info, Messages.bind("notify.locked", info.getPath())); //$NON-NLS-1$
+ break;
+ case failed_forbidden_by_server:
+ notify = logFailedOperation(info, Messages.bind("notify.forbidden.by.server")); //$NON-NLS-1$
+ break;
+ case path_nonexistent:
+ notify = logFailedOperation(info, Messages.bind("notify.path.nonexistent", info.getPath())); //$NON-NLS-1$
+ break;
+ case exclude:
+ logMessage(Messages.bind("notify.exclude", info.getPath()));
+ break;
default:
+ if (info.getAction().ordinal() == ENDED_ABNORMAL) {
+ if (command == ISVNNotifyListener.Command.COMMIT)
+ logError(Messages.bind("notify.commit.abnormal")); //$NON-NLS-1$
+ else
+ logError(Messages.bind("notify.end.abnormal")); //$NON-NLS-1$
+ if (info.getErrMsg() != null)
+ logError(info.getErrMsg());
+ notify = false;
+ break;
+ }
+ if (info.getAction().ordinal() == COMMIT_ACROSS_WC_COMPLETED) {
+ notify = false;
+ logCompleted(Messages.bind("notify.commit", Long.toString(info.getRevision()))); //$NON-NLS-1$
+ break;
+ }
logMessage("Unknown action received: " + info.getAction());
}
+
if (notify) {
// only when the status changed
notifyListenersOfChange(info.getPath(), JhlConverter.convertNodeKind(info.getKind()));
}
}
+
+ private boolean logFailedOperation(ClientNotifyInformation info, String defaultErrorMessage) {
+ if (info.getErrMsg() == null)
+ logError(defaultErrorMessage);
+ else
+ logError(info.getErrMsg());
+ return false;
+ }
+
+ private boolean logSkipped(ClientNotifyInformation info, String defaultErrorMessage) {
+ if (info.getErrMsg() == null)
+ logMessage(defaultErrorMessage);
+ else
+ logError(info.getErrMsg());
+ return false;
+ }
public void setCommand(int command) {
receivedSomeChange = false;
@@ -481,4 +576,4 @@ public class JhlNotificationHandler extends SVNNotificationHandler implements No
}
logStats();
}
-}
+}
\ No newline at end of file
diff --git a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlProgressListener.java b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlProgressListener.java
index 744e03c..123b780 100644
--- a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlProgressListener.java
+++ b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlProgressListener.java
@@ -1,11 +1,11 @@
package org.tigris.subversion.svnclientadapter.javahl;
-import org.tigris.subversion.javahl.ProgressEvent;
-import org.tigris.subversion.javahl.ProgressListener;
+import org.apache.subversion.javahl.ProgressEvent;
+import org.apache.subversion.javahl.callback.ProgressCallback;
import org.tigris.subversion.svnclientadapter.ISVNProgressListener;
import org.tigris.subversion.svnclientadapter.SVNProgressEvent;
-public class JhlProgressListener implements ProgressListener {
+public class JhlProgressListener implements ProgressCallback {
ISVNProgressListener worker;
public JhlProgressListener() {
diff --git a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlPromptUserPassword.java b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlPromptUserPassword.java
index 94fb3b4..3b9b46f 100644
--- a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlPromptUserPassword.java
+++ b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlPromptUserPassword.java
@@ -18,14 +18,14 @@
******************************************************************************/
package org.tigris.subversion.svnclientadapter.javahl;
-import org.tigris.subversion.javahl.PromptUserPassword3;
+import org.apache.subversion.javahl.callback.UserPasswordCallback;
import org.tigris.subversion.svnclientadapter.ISVNPromptUserPassword;
/**
* A JavaHL's PromptUserPassword3 implementation.
* Actually an adapter to {@link ISVNPromptUserPassword}
*/
-public class JhlPromptUserPassword implements PromptUserPassword3 {
+public class JhlPromptUserPassword implements UserPasswordCallback {
private ISVNPromptUserPassword worker;
diff --git a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlPropertyData.java b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlPropertyData.java
index 9f26657..e7117c6 100644
--- a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlPropertyData.java
+++ b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlPropertyData.java
@@ -19,9 +19,9 @@
package org.tigris.subversion.svnclientadapter.javahl;
import java.io.File;
+import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
-import org.tigris.subversion.javahl.PropertyData;
import org.tigris.subversion.svnclientadapter.ISVNProperty;
import org.tigris.subversion.svnclientadapter.SVNUrl;
@@ -33,7 +33,9 @@ import org.tigris.subversion.svnclientadapter.SVNUrl;
*/
public class JhlPropertyData implements ISVNProperty
{
- private PropertyData _propertyData;
+ private String key;
+ private byte[] data;
+ private String path;
private boolean isForUrl;
/**
@@ -41,9 +43,9 @@ public class JhlPropertyData implements ISVNProperty
* @param propertyData
* @return a JhlPropertyData constructed from supplied propertyData
*/
- public static JhlPropertyData newForFile(PropertyData propertyData)
+ public static JhlPropertyData newForFile(String path, String key, byte[] data)
{
- return new JhlPropertyData(propertyData, false);
+ return new JhlPropertyData(path, key, data, false);
}
/**
@@ -51,18 +53,20 @@ public class JhlPropertyData implements ISVNProperty
* @param propertyData
* @return a JhlPropertyData constructed from supplied propertyData
*/
- public static JhlPropertyData newForUrl(PropertyData propertyData)
+ public static JhlPropertyData newForUrl(String path, String key, byte[] data)
{
- return new JhlPropertyData(propertyData, true);
+ return new JhlPropertyData(path, key, data, true);
}
/**
* Constructor
* @param propertyData
*/
- private JhlPropertyData(PropertyData propertyData, boolean isForUrl)
+ private JhlPropertyData(String path, String key, byte[] data, boolean isForUrl)
{
- this._propertyData = propertyData;
+ this.path = path;
+ this.key = key;
+ this.data = data;
this.isForUrl = isForUrl;
}
@@ -71,7 +75,7 @@ public class JhlPropertyData implements ISVNProperty
*/
public String getName()
{
- return _propertyData.getName();
+ return key;
}
/* (non-Javadoc)
@@ -79,7 +83,11 @@ public class JhlPropertyData implements ISVNProperty
*/
public String getValue()
{
- return _propertyData.getValue();
+ try {
+ return new String(data, "UTF8");
+ } catch (UnsupportedEncodingException e) {
+ return new String(data);
+ }
}
/* (non-Javadoc)
@@ -87,7 +95,7 @@ public class JhlPropertyData implements ISVNProperty
*/
public File getFile()
{
- return isForUrl ? null : new File(_propertyData.getPath()).getAbsoluteFile();
+ return isForUrl ? null : new File(path).getAbsoluteFile();
}
/* (non-Javadoc)
@@ -96,7 +104,7 @@ public class JhlPropertyData implements ISVNProperty
public SVNUrl getUrl()
{
try {
- return isForUrl ? new SVNUrl(_propertyData.getPath()) : null;
+ return isForUrl ? new SVNUrl(path) : null;
} catch (MalformedURLException e) {
//should never happen.
return null;
@@ -108,6 +116,6 @@ public class JhlPropertyData implements ISVNProperty
*/
public byte[] getData()
{
- return _propertyData.getData();
+ return data;
}
}
diff --git a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlProplistCallback.java b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlProplistCallback.java
new file mode 100644
index 0000000..9aee11a
--- /dev/null
+++ b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlProplistCallback.java
@@ -0,0 +1,36 @@
+package org.tigris.subversion.svnclientadapter.javahl;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.subversion.javahl.callback.ProplistCallback;
+import org.tigris.subversion.svnclientadapter.ISVNProperty;
+
+public class JhlProplistCallback implements ProplistCallback {
+ private boolean isFile;
+ List<ISVNProperty> props;
+
+ public JhlProplistCallback(boolean file) {
+ isFile = file;
+ props = new ArrayList<ISVNProperty>();
+ }
+
+ public void singlePath(String path, Map<String, byte[]> properties) {
+ Set<String> keys = properties.keySet();
+ for (String key : keys) {
+ if (isFile) {
+ props.add(JhlPropertyData.newForFile(path, key, properties.get(key)));
+ } else {
+ props.add(JhlPropertyData.newForUrl(path, key, properties.get(key)));
+ }
+ }
+ }
+
+ public ISVNProperty[] getPropertyData() {
+ ISVNProperty[] propArray = new ISVNProperty[props.size()];
+ return props.toArray(propArray);
+ }
+
+}
diff --git a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlStatus.java b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlStatus.java
index ea6389a..3e2ab64 100644
--- a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlStatus.java
+++ b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlStatus.java
@@ -22,13 +22,18 @@ import java.io.File;
import java.net.MalformedURLException;
import java.util.Date;
-import org.tigris.subversion.javahl.Status;
-import org.tigris.subversion.svnclientadapter.ISVNInfo;
+import org.apache.subversion.javahl.ClientException;
+import org.apache.subversion.javahl.ConflictDescriptor;
+import org.apache.subversion.javahl.ISVNClient;
+import org.apache.subversion.javahl.callback.InfoCallback;
+import org.apache.subversion.javahl.types.Depth;
+import org.apache.subversion.javahl.types.Info;
+import org.apache.subversion.javahl.types.Status;
import org.tigris.subversion.svnclientadapter.ISVNStatus;
import org.tigris.subversion.svnclientadapter.SVNConflictDescriptor;
-import org.tigris.subversion.svnclientadapter.SVNStatusKind;
import org.tigris.subversion.svnclientadapter.SVNNodeKind;
import org.tigris.subversion.svnclientadapter.SVNRevision;
+import org.tigris.subversion.svnclientadapter.SVNStatusKind;
import org.tigris.subversion.svnclientadapter.SVNUrl;
/**
@@ -43,24 +48,81 @@ public class JhlStatus implements ISVNStatus {
private SVNRevision.Number lastChangedRevision;
private String lastChangedAuthor;
private Date lastChangedDate;
+
+ private boolean treeConflict = false;
+ private ConflictDescriptor conflictDescriptor;
+ private String conflictOld;
+ private String conflictWorking;
+ private String conflictNew;
/**
* Constructor
* @param status
*/
- public JhlStatus(Status status) {
+ public JhlStatus(Status status, ISVNClient client) {
// note that status.textStatus must be different than 0 (the resource must exist)
super();
_s = status;
+ try {
+ if (client != null && _s.isConflicted())
+ populateInfo(client, _s.getPath());
+ } catch (ClientException e) {
+ // Ignore
+ }
}
+ private void populateInfo(ISVNClient aClient, String path)
+ throws ClientException {
+
+ class MyInfoCallback implements InfoCallback {
+ Info info;
+
+ public void singleInfo(Info aInfo) {
+ info = aInfo;
+ }
+
+ public Info getInfo() {
+ return info;
+ }
+ }
+
+ MyInfoCallback callback = new MyInfoCallback();
+
+ aClient.info2(path, null, null, Depth.empty, null,
+ callback);
+
+ Info aInfo = callback.getInfo();
+ if (aInfo == null)
+ return;
+
+ if (aInfo.getConflicts() != null) {
+ for (ConflictDescriptor conflict : aInfo.getConflicts()) {
+ switch (conflict.getKind()) {
+ case tree:
+ this.treeConflict = true;
+ this.conflictDescriptor = conflict;
+ break;
+
+ case text:
+ this.conflictOld = conflict.getBasePath();
+ this.conflictWorking = conflict.getMyPath();
+ this.conflictNew = conflict.getTheirPath();
+ break;
+
+ case property:
+ // Ignore
+ break;
+ }
+ }
+ }
+ }
+
/* (non-Javadoc)
* @see org.tigris.subversion.svnclientadapter.ISVNStatus#getUrl()
*/
public SVNUrl getUrl() {
try {
- String urlString = getUrlString();
- return (urlString != null) ? new SVNUrl(urlString) : null;
+ return (_s.getUrl() != null) ? new SVNUrl(_s.getUrl()) : null;
} catch (MalformedURLException e) {
//should never happen.
return null;
@@ -196,20 +258,6 @@ public class JhlStatus implements ISVNStatus {
nodeKind = JhlConverter.convertNodeKind(_s.getReposKind());
return nodeKind;
}
-
- /*
- * (non-Javadoc)
- * @see org.tigris.subversion.svnclientadapter.ISVNStatus#getUrlCopiedFrom()
- */
- public SVNUrl getUrlCopiedFrom() {
- try {
- String url = _s.getUrlCopiedFrom();
- return (url != null) ? new SVNUrl(url) : null;
- } catch (MalformedURLException e) {
- //should never happen.
- return null;
- }
- }
/* (non-Javadoc)
* @see org.tigris.subversion.svnclientadapter.ISVNStatus#getRepositoryTextStatus()
@@ -236,9 +284,9 @@ public class JhlStatus implements ISVNStatus {
* @see org.tigris.subversion.svnclientadapter.ISVNStatus#getConflictNew()
*/
public File getConflictNew() {
- String path = _s.getConflictNew();
- return (path != null) ? new File(getFile().getParent(), path)
- .getAbsoluteFile() : null;
+ String path = conflictNew;
+ return (path != null) ? new File(path)
+ .getAbsoluteFile() : null;
}
/*
@@ -247,9 +295,9 @@ public class JhlStatus implements ISVNStatus {
* @see org.tigris.subversion.svnclientadapter.ISVNStatus#getConflictOld()
*/
public File getConflictOld() {
- String path = _s.getConflictOld();
- return (path != null) ? new File(getFile().getParent(), path)
- .getAbsoluteFile() : null;
+ String path = conflictOld;
+ return (path != null) ? new File(path)
+ .getAbsoluteFile() : null;
}
/*
@@ -258,9 +306,9 @@ public class JhlStatus implements ISVNStatus {
* @see org.tigris.subversion.svnclientadapter.ISVNStatus#getConflictWorking()
*/
public File getConflictWorking() {
- String path = _s.getConflictWorking();
- return (path != null) ? new File(getFile().getParent(), path)
- .getAbsoluteFile() : null;
+ String path = conflictWorking;
+ return (path != null) ? new File(path)
+ .getAbsoluteFile() : null;
}
/*
@@ -269,28 +317,34 @@ public class JhlStatus implements ISVNStatus {
* @see org.tigris.subversion.svnclientadapter.ISVNStatus#getLockCreationDate()
*/
public Date getLockCreationDate() {
- return _s.getLockCreationDate();
+ if (_s.getLocalLock() == null)
+ return null;
+ return _s.getLocalLock().getCreationDate();
}
/* (non-Javadoc)
* @see org.tigris.subversion.svnclientadapter.ISVNStatus#getLockOwner()
*/
public String getLockOwner() {
- return _s.getLockOwner();
+ if (_s.getLocalLock() == null)
+ return null;
+ return _s.getLocalLock().getOwner();
}
/* (non-Javadoc)
* @see org.tigris.subversion.svnclientadapter.ISVNStatus#getLockComment()
*/
public String getLockComment() {
- return _s.getLockComment();
+ if (_s.getLocalLock() == null)
+ return null;
+ return _s.getLocalLock().getComment();
}
/* (non-Javadoc)
* @see org.tigris.subversion.svnclientadapter.ISVNStatus#getTreeConflicted()
*/
public boolean hasTreeConflict() {
- return _s.hasTreeConflict();
+ return treeConflict;
}
/* (non-Javadoc)
@@ -304,15 +358,10 @@ public class JhlStatus implements ISVNStatus {
* @see org.tigris.subversion.svnclientadapter.ISVNStatus#getConflictDescriptor()
*/
public SVNConflictDescriptor getConflictDescriptor() {
- return JhlConverter.convertConflictDescriptor(_s.getConflictDescriptor());
+ return JhlConverter.convertConflictDescriptor(conflictDescriptor);
}
- public void updateFromInfo(ISVNInfo info) {
- lastChangedRevision = info.getLastChangedRevision();
- lastChangedAuthor = info.getLastCommitAuthor();
- lastChangedDate = info.getLastChangedDate();
- }
-
+
public void updateFromStatus(JhlStatus info) {
lastChangedRevision = info.getLastChangedRevision();
lastChangedAuthor = info.getLastCommitAuthor();
@@ -321,43 +370,22 @@ public class JhlStatus implements ISVNStatus {
/**
* A special JhlStatus subclass representing svn:external resource.
- * (JavaHL answer two sort of statuses on externals:
- * - when ignoreExternals is set to true during call to status(),
- * the return status has textStatus set to EXTERNAL, but the url is null.<br>
- * - when ignoreExternals is set to false during call to status(),
- * besides the "external" status, second status with url and all fields is returned too,
- * but this one has textStatus NORMAL)
*/
public static class JhlStatusExternal extends JhlStatus
{
- private String url;
-
- /**
- * Constructor
- * @param status
- */
- public JhlStatusExternal(JhlStatus status) {
- this(status, null);
- }
/**
* Constructor
* @param status
- * @param url
*/
- public JhlStatusExternal(JhlStatus status, String url) {
- super(status._s);
- this.url = url;
+ public JhlStatusExternal(JhlStatus status, ISVNClient client) {
+ super(status._s, client);
}
public SVNStatusKind getTextStatus() {
return SVNStatusKind.EXTERNAL;
}
- public String getUrlString()
- {
- return (url != null) ? url : super.getUrlString();
- }
}
}
diff --git a/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlStatusCallback.java b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlStatusCallback.java
new file mode 100644
index 0000000..08bcdef
--- /dev/null
+++ b/src/javahl/org/tigris/subversion/svnclientadapter/javahl/JhlStatusCallback.java
@@ -0,0 +1,30 @@
+package org.tigris.subversion.svnclientadapter.javahl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.subversion.javahl.callback.StatusCallback;
+import org.apache.subversion.javahl.types.Status;
+import org.tigris.subversion.svnclientadapter.ISVNStatusCallback;
+
+public class JhlStatusCallback implements StatusCallback {
+ private List<Status> statusList = new ArrayList<Status>();
+ private ISVNStatusCallback worker;
+
+ public JhlStatusCallback(ISVNStatusCallback callback) {
+ super();
+ worker = callback;
+ }
+
+ public void doStatus(String path, Status status) {
+ worker.doStatus(path, new JhlStatus(status, null));
+ if (status != null) {
+ statusList.add(status);
+ }
+ }
+
+ public List<Status> getStatusList() {
+ return statusList;
+ }
+
+}
diff --git a/src/main/org/tigris/subversion/svnclientadapter/ISVNClientAdapter.java b/src/main/org/tigris/subversion/svnclientadapter/ISVNClientAdapter.java
index 0ae56c7..3d8f350 100644
--- a/src/main/org/tigris/subversion/svnclientadapter/ISVNClientAdapter.java
+++ b/src/main/org/tigris/subversion/svnclientadapter/ISVNClientAdapter.java
@@ -23,7 +23,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.List;
-
/**
* High level API for Subversion
*
@@ -202,6 +201,8 @@ public interface ISVNClientAdapter {
public abstract long[] commitAcrossWC(File[] paths, String message, boolean recurse, boolean keepLocks, boolean atomic)
throws SVNClientException;
+ public String getPostCommitError();
+
/**
* List directory entries of a URL
* @param url
@@ -359,6 +360,25 @@ public interface ISVNClientAdapter {
*/
public abstract ISVNStatus[] getStatus(File path, boolean descend, boolean getAll, boolean contactServer, boolean ignoreExternals)
throws SVNClientException;
+
+ /**
+ * Returns the status of path and its children.
+ * If descend is true, recurse fully, else do only immediate children.
+ * If getAll is set, retrieve all entries; otherwise, retrieve only
+ * "interesting" entries (local mods and/or out-of-date). Use the
+ * contactServer option to get server change information.
+ *
+ * @param path File to gather status.
+ * @param descend get recursive status information
+ * @param getAll get status information for all files
+ * @param contactServer contact server to get remote changes
+ * @param ignoreExternals if externals are ignored during status
+ * @param callback callback to collect statuses
+ * @return a Status
+ * @throws SVNClientException
+ */
+ public abstract ISVNStatus[] getStatus(File path, boolean descend, boolean getAll, boolean contactServer, boolean ignoreExternals, ISVNStatusCallback callback)
+ throws SVNClientException;
/**
* copy and schedule for addition (with history)
@@ -972,6 +992,23 @@ public interface ISVNClientAdapter {
String propertyValue,
boolean recurse)
throws SVNClientException;
+
+ /**
+ * set a property
+ * @param url
+ * @param baseRev
+ * @param propertyName
+ * @param propertyValue
+ * @param recurse
+ * @throws SVNClientException
+ */
+ public abstract void propertySet(
+ SVNUrl url,
+ SVNRevision.Number baseRev,
+ String propertyName,
+ String propertyValue,
+ String message)
+ throws SVNClientException;
/**
* set a property using the content of a file
@@ -1409,6 +1446,26 @@ public interface ISVNClientAdapter {
public abstract ISVNProperty[] getProperties(File path) throws SVNClientException;
/**
+ * Get all the properties for the given file or dir
+ * @param path
+ * @param descend get properties recursively
+ * @return the properties for the given url
+ * @throws SVNClientException
+ */
+ public abstract ISVNProperty[] getProperties(File path, boolean descend) throws SVNClientException;
+
+ /**
+ * Get all the properties for the given url
+ * @param url
+ * @param revision
+ * @param peg
+ * @param recurse
+ * @return information about an URL.
+ * @throws SVNClientException
+ */
+ public abstract ISVNProperty[] getProperties(SVNUrl url, SVNRevision revision, SVNRevision peg, boolean recurse) throws SVNClientException;
+
+ /**
* Get all the properties for the given url
* @param url
* @param revision
@@ -1558,7 +1615,24 @@ public interface ISVNClientAdapter {
* @param force
* @throws SVNClientException
*/
- public void switchToUrl(File path, SVNUrl url, SVNRevision revision, SVNRevision pegRevision, int depth, boolean setDepth, boolean ignoreExternals, boolean force) throws SVNClientException;
+ public void switchToUrl(File path, SVNUrl url, SVNRevision revision, SVNRevision pegRevision, int depth, boolean setDepth, boolean ignoreExternals, boolean force) throws SVNClientException;
+
+ /**
+ * Update the working copy to mirror a new URL within the repository.
+ * This behaviour is similar to 'svn update', and is the way to
+ * move a working copy to a branch or tag within the same repository.
+ * @param url
+ * @param path
+ * @param revision
+ * @param pegRevision
+ * @param depth
+ * @param setDepth
+ * @param ignoreExternals
+ * @param force
+ * @param ignoreAncestry
+ * @throws SVNClientException
+ */
+ public void switchToUrl(File path, SVNUrl url, SVNRevision revision, SVNRevision pegRevision, int depth, boolean setDepth, boolean ignoreExternals, boolean force, boolean ignoreAncestry) throws SVNClientException;
/**
* Set the configuration directory.
@@ -1573,6 +1647,13 @@ public interface ISVNClientAdapter {
* @throws SVNClientException
*/
public abstract void cleanup(File dir) throws SVNClientException;
+
+ /**
+ * Recursively upgrade a working copy to a new metadata storage format.
+ * @param dir
+ * @throws SVNClientException
+ */
+ public abstract void upgrade(File dir) throws SVNClientException;
/**
* Merge changes from two paths into a new local path.
diff --git a/src/main/org/tigris/subversion/svnclientadapter/ISVNNotifyListener.java b/src/main/org/tigris/subversion/svnclientadapter/ISVNNotifyListener.java
index a1476e3..fd23f12 100644
--- a/src/main/org/tigris/subversion/svnclientadapter/ISVNNotifyListener.java
+++ b/src/main/org/tigris/subversion/svnclientadapter/ISVNNotifyListener.java
@@ -67,6 +67,7 @@ public interface ISVNNotifyListener {
public static final int RELOCATE = 30;
public static final int RESOLVE = 31;
public static final int MERGEINFO = 32;
+ public static final int UPGRADE = 33;
}
/**
diff --git a/src/main/org/tigris/subversion/svnclientadapter/ISVNStatus.java b/src/main/org/tigris/subversion/svnclientadapter/ISVNStatus.java
index 9473c76..3067743 100644
--- a/src/main/org/tigris/subversion/svnclientadapter/ISVNStatus.java
+++ b/src/main/org/tigris/subversion/svnclientadapter/ISVNStatus.java
@@ -112,11 +112,6 @@ public interface ISVNStatus {
* @return true when the resource was switched relative to its parent.
*/
boolean isSwitched();
-
- /**
- * @return the url of the copy source if copied, null otherwise
- */
- SVNUrl getUrlCopiedFrom();
/**
* Returns in case of conflict, the file of the most recent repository
diff --git a/src/main/org/tigris/subversion/svnclientadapter/ISVNStatusCallback.java b/src/main/org/tigris/subversion/svnclientadapter/ISVNStatusCallback.java
new file mode 100644
index 0000000..35236b1
--- /dev/null
+++ b/src/main/org/tigris/subversion/svnclientadapter/ISVNStatusCallback.java
@@ -0,0 +1,7 @@
+package org.tigris.subversion.svnclientadapter;
+
+public interface ISVNStatusCallback {
+
+ public void doStatus(String path, ISVNStatus status);
+
+}
diff --git a/src/main/org/tigris/subversion/svnclientadapter/SVNConstants.java b/src/main/org/tigris/subversion/svnclientadapter/SVNConstants.java
index 953166a..5b7c887 100644
--- a/src/main/org/tigris/subversion/svnclientadapter/SVNConstants.java
+++ b/src/main/org/tigris/subversion/svnclientadapter/SVNConstants.java
@@ -25,7 +25,7 @@ package org.tigris.subversion.svnclientadapter;
public class SVNConstants {
/** a "entries" workingCopy metadata directory name */
- public static final String SVN_ENTRIES = "entries";
+ public static final String SVN_ENTRIES = "wc.db";
/** a "dir-props" workingCopy metadata directory name */
public static final String SVN_DIRPROPS = "dir-props";
diff --git a/src/main/org/tigris/subversion/svnclientadapter/SVNStatusCallback.java b/src/main/org/tigris/subversion/svnclientadapter/SVNStatusCallback.java
new file mode 100644
index 0000000..0cb2512
--- /dev/null
+++ b/src/main/org/tigris/subversion/svnclientadapter/SVNStatusCallback.java
@@ -0,0 +1,21 @@
+package org.tigris.subversion.svnclientadapter;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class SVNStatusCallback implements ISVNStatusCallback {
+ private List statuses = new ArrayList();
+
+ public void doStatus(String path, ISVNStatus status) {
+ if (status != null) {
+ statuses.add(status);
+ }
+ }
+
+ public ISVNStatus[] getStatuses() {
+ ISVNStatus[] statusArray = new ISVNStatus[statuses.size()];
+ statuses.toArray(statusArray);
+ return statusArray;
+ }
+
+}
diff --git a/src/main/org/tigris/subversion/svnclientadapter/SVNStatusUnversioned.java b/src/main/org/tigris/subversion/svnclientadapter/SVNStatusUnversioned.java
index c6f2773..d043a16 100644
--- a/src/main/org/tigris/subversion/svnclientadapter/SVNStatusUnversioned.java
+++ b/src/main/org/tigris/subversion/svnclientadapter/SVNStatusUnversioned.java
@@ -174,13 +174,6 @@ public class SVNStatusUnversioned implements ISVNStatus {
return SVNNodeKind.UNKNOWN;
}
- /* (non-Javadoc)
- * @see org.tigris.subversion.svnclientadapter.ISVNStatus#getUrlCopiedFrom()
- */
- public SVNUrl getUrlCopiedFrom() {
- return null;
- }
-
/* (non-Javadoc)
* @see org.tigris.subversion.svnclientadapter.ISVNStatus#getConflictNew()
*/
diff --git a/src/main/org/tigris/subversion/svnclientadapter/SVNUrl.java b/src/main/org/tigris/subversion/svnclientadapter/SVNUrl.java
index cd3c1ab..1015875 100644
--- a/src/main/org/tigris/subversion/svnclientadapter/SVNUrl.java
+++ b/src/main/org/tigris/subversion/svnclientadapter/SVNUrl.java
@@ -19,6 +19,8 @@
package org.tigris.subversion.svnclientadapter;
import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
import org.tigris.subversion.svnclientadapter.utils.StringUtils;
@@ -296,6 +298,16 @@ public class SVNUrl {
* @see java.lang.Object#toString()
*/
public String toString() {
- return get();
+ // The URI class will throw Exception if there are spaces in the URL, but it seems
+ // to handle other classes OK. I tested with @ + and Unicode characters. It leaves
+ // the @ and + alone and converts Unicode to %nn. It is possible there are other
+ // characters we need to replace here besides space.
+ String s = get().replaceAll(" ", "%20");
+ try {
+ URI u = new URI(s);
+ return u.toASCIIString();
+ } catch (URISyntaxException e) {
+ return s;
+ }
}
}
diff --git a/src/main/org/tigris/subversion/svnclientadapter/messages.properties b/src/main/org/tigris/subversion/svnclientadapter/messages.properties
index 48809ce..7b7b07e 100644
--- a/src/main/org/tigris/subversion/svnclientadapter/messages.properties
+++ b/src/main/org/tigris/subversion/svnclientadapter/messages.properties
@@ -17,16 +17,38 @@
# svnClientAdapter project committers - initial API and implementation
#******************************************************************************/
notify.skipped=Skipped {0}
+notify.update.skip.obstruction=Skipped {0} because of working copy obstruction.
+notify.update.skip.working.only=Skipped {0} because it is working only.
+notify.update.skip.access.denied=Skipped {0} because access could not be obtained.
+notify.out.of.date=Operation failed because {0} is out of date -- try updating.
+notify.conflict=Operation failed because {0} remains in conflict.
+notify.external=Operation failed because {0} is a subdirectory referenced in an externals definition which is unable to be operated on.
+notify.locked=Operation failed because {0} is locked.
+notify.path.nonexistent=Operation failed because {0} does not exist.
notify.lock.failed=Failed to lock {0}
+notify.missing=Operation failed because {0} is missing.
+notify.no.parent=Operation failed because an added parent is not selected.
+notify.forbidden.by.server=Operation failed because it was forbidden by server.
+notify.copy=Copying {0}
+notify.changelist.set=Changelist set for {0}
+notify.changelist.clear=Changelist cleared for {0}
+notify.changelist.moved=Changelist moved for {0}
notify.unlock.failed=Failed to unlock {0}
notify.lock.other={0} locked by user {1}
notify.lock={0} locked
notify.unlock={0} unlocked
notify.restored=Restored {0}
notify.reverted=Reverted {0}
+notify.upgraded.path=Upgraded {0}
+notify.exclude={0} excluded
notify.revert.failed=Failed to revert {0} -- try updating instead.
notify.resolved=Resolved conflicted state of {0}
notify.update.external=Updating external location at: {0}
+notify.update.external.removed=Removed external location {0}
+notify.patch=A file in the working copy was patched.
+notify.patch.applied.hunk=Hunk from patch applied to {0}
+notify.patch.rejected.hunk=Hunk from patch to {0} rejected.
+notify.patch.hunk.already.applied=Hunk from patch has already been applied to {0}
notify.export=Exported revision {0}.
notify.checkout=Checked out revision {0}.
notify.update=Updated to revision {0}.
@@ -60,4 +82,5 @@ notify.property.set=Property set on {0}
notify.property.deleted=Property deleted from {0}
notify.property.deleted.nonexistent=Attempting to delete nonexistent property
notify.revision.property.set=Property set on repository revision
-notify.revision.property.deleted=Property deleted from repository revision
\ No newline at end of file
+notify.revision.property.deleted=Property deleted from repository revision
+notify.merge.record.info=Merge info recorded for {0}
\ No newline at end of file
diff --git a/src/main/org/tigris/subversion/svnclientadapter/utils/Depth.java b/src/main/org/tigris/subversion/svnclientadapter/utils/Depth.java
index 8213ad4..c06e2c8 100644
--- a/src/main/org/tigris/subversion/svnclientadapter/utils/Depth.java
+++ b/src/main/org/tigris/subversion/svnclientadapter/utils/Depth.java
@@ -20,23 +20,23 @@ package org.tigris.subversion.svnclientadapter.utils;
public class Depth {
- /** Depth undetermined or ignored.
- public static final int unknown = -2;
+ /** Depth undetermined or ignored. */
+ public static final int unknown = 0;
- /** Exclude (remove, whatever) directory D.
- public static final int exclude = -1;
+ /** Exclude (remove, whatever) directory D. */
+ public static final int exclude = 1;
/** Just the named directory D, no entries. */
- public static final int empty = 0;
+ public static final int empty = 2;
/** D + its file children, but not subdirs. */
- public static final int files = 1;
+ public static final int files = 3;
/** D + immediate children (D and its entries). */
- public static final int immediates = 2;
+ public static final int immediates = 4;
/** D + all descendants (full recursion from D). */
- public static final int infinity = 3;
+ public static final int infinity = 5;
public static final int fromRecurse(boolean recurse)
{
diff --git a/src/svnkit/org/tigris/subversion/svnclientadapter/svnkit/SvnKitClientAdapter.java b/src/svnkit/org/tigris/subversion/svnclientadapter/svnkit/SvnKitClientAdapter.java
index 1512e3f..f54fc84 100644
--- a/src/svnkit/org/tigris/subversion/svnclientadapter/svnkit/SvnKitClientAdapter.java
+++ b/src/svnkit/org/tigris/subversion/svnclientadapter/svnkit/SvnKitClientAdapter.java
@@ -20,9 +20,6 @@ package org.tigris.subversion.svnclientadapter.svnkit;
import java.io.File;
-import org.tigris.subversion.javahl.ClientException;
-import org.tigris.subversion.javahl.SVNClient;
-import org.tigris.subversion.svnclientadapter.ISVNNotifyListener;
import org.tigris.subversion.svnclientadapter.ISVNPromptUserPassword;
import org.tigris.subversion.svnclientadapter.ISVNStatus;
import org.tigris.subversion.svnclientadapter.SVNClientException;
@@ -31,10 +28,9 @@ import org.tigris.subversion.svnclientadapter.javahl.AbstractJhlClientAdapter;
import org.tigris.subversion.svnclientadapter.javahl.JhlNotificationHandler;
import org.tigris.subversion.svnclientadapter.javahl.JhlProgressListener;
import org.tmatesoft.svn.core.SVNException;
-import org.tmatesoft.svn.core.internal.io.dav.http.IHTTPConnectionFactory;
-import org.tmatesoft.svn.core.internal.io.svn.ISVNConnectorFactory;
import org.tmatesoft.svn.core.io.SVNRepositoryFactory;
-import org.tmatesoft.svn.core.javahl.SVNClientImpl;
+import org.tmatesoft.svn.core.javahl17.SVNClientImpl;
+
/**
@@ -47,18 +43,12 @@ import org.tmatesoft.svn.core.javahl.SVNClientImpl;
public class SvnKitClientAdapter extends AbstractJhlClientAdapter {
public SvnKitClientAdapter() {
- this(null, null, null);
- }
-
- public SvnKitClientAdapter(SVNClient owner,
- IHTTPConnectionFactory httpConnectionFactory,
- ISVNConnectorFactory svnConnectorFactory) {
- svnClient = SVNClientImpl.newInstance(owner, httpConnectionFactory, svnConnectorFactory);
+ svnClient = SVNClientImpl.newInstance();
notificationHandler = new JhlNotificationHandler();
progressListener = new JhlProgressListener();
svnClient.notification2(notificationHandler);
svnClient.setPrompt(new DefaultPromptUserPassword());
- svnClient.setProgressListener(progressListener);
+ svnClient.setProgressCallback(progressListener);
}
public boolean isThreadsafe() {
@@ -91,38 +81,11 @@ public class SvnKitClientAdapter extends AbstractJhlClientAdapter {
return true;
}
- public long[] commitAcrossWC(File[] paths, String message, boolean recurse,
- boolean keepLocks, boolean atomic) throws SVNClientException {
- try {
- String fixedMessage = fixSVNString(message);
- if (fixedMessage == null)
- fixedMessage = "";
- notificationHandler.setCommand(ISVNNotifyListener.Command.COMMIT);
- String[] files = new String[paths.length];
- String commandLine = "commit -m \""+fixedMessage+"\"";
- if (!recurse)
- commandLine+=" -N";
- if (keepLocks)
- commandLine+=" --no-unlock";
-
- for (int i = 0; i < paths.length; i++) {
- files[i] = fileToSVNPath(paths[i], false);
- commandLine+=" "+ files[i];
- }
- notificationHandler.logCommandLine(commandLine);
- notificationHandler.setBaseDir();
-
- long[] newRev = ((SVNClientImpl)svnClient).commit(files, fixedMessage, recurse, keepLocks, atomic);
- return newRev;
- } catch (ClientException e) {
- notificationHandler.logException(e);
- throw new SVNClientException(e);
- }
-
- }
public boolean canCommitAcrossWC() {
- return true;
+ // Native SVN now supports this with normal commit method, so support for
+ // the special method has been removed.
+ return false;
}
/**
diff --git a/src/svnkit/org/tigris/subversion/svnclientadapter/svnkit/SvnKitClientAdapterFactory.java b/src/svnkit/org/tigris/subversion/svnclientadapter/svnkit/SvnKitClientAdapterFactory.java
index e4762e4..fd73c0b 100644
--- a/src/svnkit/org/tigris/subversion/svnclientadapter/svnkit/SvnKitClientAdapterFactory.java
+++ b/src/svnkit/org/tigris/subversion/svnclientadapter/svnkit/SvnKitClientAdapterFactory.java
@@ -56,7 +56,7 @@ public class SvnKitClientAdapterFactory extends SVNClientAdapterFactory {
public static boolean isAvailable() {
try {
- Class c = Class.forName("org.tmatesoft.svn.core.javahl.SVNClientImpl");
+ Class c = Class.forName("org.tmatesoft.svn.core.javahl17.SVNClientImpl");
if (c != null)
return true;
else
diff --git a/src/svnkit/org/tigris/subversion/svnclientadapter/svnkit/SvnKitPromptUserPassword.java b/src/svnkit/org/tigris/subversion/svnclientadapter/svnkit/SvnKitPromptUserPassword.java
index 0b58e38..18d0a1d 100644
--- a/src/svnkit/org/tigris/subversion/svnclientadapter/svnkit/SvnKitPromptUserPassword.java
+++ b/src/svnkit/org/tigris/subversion/svnclientadapter/svnkit/SvnKitPromptUserPassword.java
@@ -19,14 +19,13 @@
package org.tigris.subversion.svnclientadapter.svnkit;
import org.tigris.subversion.svnclientadapter.ISVNPromptUserPassword;
-import org.tmatesoft.svn.core.javahl.PromptUserPasswordSSH;
-import org.tmatesoft.svn.core.javahl.PromptUserPasswordSSL;
-import org.tmatesoft.svn.core.javahl.PromptUserPasswordUser;
+import org.tmatesoft.svn.core.javahl17.UserPasswordSSHCallback;
+import org.tmatesoft.svn.core.javahl17.UserPasswordSSLCallback;
/**
* A SVNKit's PromptUserPassword3 implementation.
*/
-public class SvnKitPromptUserPassword implements PromptUserPasswordSSH, PromptUserPasswordSSL, PromptUserPasswordUser {
+public class SvnKitPromptUserPassword implements UserPasswordSSHCallback, UserPasswordSSLCallback {
private ISVNPromptUserPassword worker;
--
svnclientadapter packaging
More information about the pkg-java-commits
mailing list