Modified: subversion/branches/performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/ChangelistCallback.java URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/ChangelistCallback.java?rev=993141&r1=993140&r2=993141&view=diff ============================================================================== --- subversion/branches/performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/ChangelistCallback.java (original) +++ subversion/branches/performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/ChangelistCallback.java Mon Sep 6 20:02:15 2010 @@ -23,9 +23,11 @@ package org.apache.subversion.javahl.callback; +import org.apache.subversion.javahl.ISVNClient; + /** * This interface is used to receive every status item for - * the SVNClientInterface.status call. + * the {...@link ISVNClient#status} call. */ public interface ChangelistCallback {
Modified: subversion/branches/performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/DiffSummaryCallback.java URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/DiffSummaryCallback.java?rev=993141&r1=993140&r2=993141&view=diff ============================================================================== --- subversion/branches/performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/DiffSummaryCallback.java (original) +++ subversion/branches/performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/DiffSummaryCallback.java Mon Sep 6 20:02:15 2010 @@ -24,6 +24,7 @@ package org.apache.subversion.javahl.callback; import org.apache.subversion.javahl.DiffSummary; +import org.apache.subversion.javahl.ISVNClient; /** * Subversion diff summarization interface. An implementation which @@ -45,7 +46,7 @@ public interface DiffSummaryCallback { /** * Implement this interface to receive diff summaries from the - * {...@link SVNClientInterface#diffSummarize} API. + * {...@link ISVNClient#diffSummarize} API. * * @param descriptor A summary of the diff. */ Modified: subversion/branches/performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/InfoCallback.java URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/InfoCallback.java?rev=993141&r1=993140&r2=993141&view=diff ============================================================================== --- subversion/branches/performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/InfoCallback.java (original) +++ subversion/branches/performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/InfoCallback.java Mon Sep 6 20:02:15 2010 @@ -24,10 +24,11 @@ package org.apache.subversion.javahl.callback; import org.apache.subversion.javahl.Info2; +import org.apache.subversion.javahl.ISVNClient; /** * This interface is used to retrieve info each result in a - * SVNClientInterface.info2 call. + * {...@link ISVNClient#info2} call. */ public interface InfoCallback { Modified: subversion/branches/performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/ListCallback.java URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/ListCallback.java?rev=993141&r1=993140&r2=993141&view=diff ============================================================================== --- subversion/branches/performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/ListCallback.java (original) +++ subversion/branches/performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/ListCallback.java Mon Sep 6 20:02:15 2010 @@ -25,10 +25,11 @@ package org.apache.subversion.javahl.cal import org.apache.subversion.javahl.Lock; import org.apache.subversion.javahl.DirEntry; +import org.apache.subversion.javahl.ISVNClient; /** * This interface is used to receive every single line for a file on a - * the SVNClientInterface.blame call. + * the {...@link ISVNClient#blame} call. */ public interface ListCallback { Modified: subversion/branches/performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/LogMessageCallback.java URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/LogMessageCallback.java?rev=993141&r1=993140&r2=993141&view=diff ============================================================================== --- subversion/branches/performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/LogMessageCallback.java (original) +++ subversion/branches/performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/LogMessageCallback.java Mon Sep 6 20:02:15 2010 @@ -24,18 +24,19 @@ package org.apache.subversion.javahl.callback; import org.apache.subversion.javahl.ChangePath; +import org.apache.subversion.javahl.ISVNClient; import java.util.Map; import java.util.Set; /** * This interface is used to receive every log message for the log - * messages found by a SVNClientInterface.logMessages call. + * messages found by a {...@link ISVNClient#logMessages} call. * * All log messages are returned in a list, which is terminated by an * invocation of this callback with the revision set to SVN_INVALID_REVNUM. * - * If the includeMergedRevisions parameter to SVNClientInterface.logMessages + * If the includeMergedRevisions parameter to {...@link ISVNClient#logMessages} * is true, then messages returned through this callback may have the * hasChildren parameter set. This parameter indicates that a separate list, * which includes messages for merged revisions, will immediately follow. Modified: subversion/branches/performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/PatchCallback.java URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/PatchCallback.java?rev=993141&r1=993140&r2=993141&view=diff ============================================================================== --- subversion/branches/performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/PatchCallback.java (original) +++ subversion/branches/performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/PatchCallback.java Mon Sep 6 20:02:15 2010 @@ -23,16 +23,19 @@ package org.apache.subversion.javahl.callback; +import org.apache.subversion.javahl.ISVNClient; + /** * This interface is invoked before each patch in a - * SVNClientInterface.patch call. + * {...@link ISVNClient#patch} call. */ public interface PatchCallback { /** - * the method will be called for every line in a file. - * @param path the path. - * @param properties the properties on the path. + * the method will be called for every patch. + * @param pathFromPatchfile the path in the path file + * @param patchPath the path of the patch + * @param rejectPath the path of the reject file * @return return TRUE to filter out the prospective patch */ public boolean singlePatch(String pathFromPatchfile, String patchPath, Modified: subversion/branches/performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/ProplistCallback.java URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/ProplistCallback.java?rev=993141&r1=993140&r2=993141&view=diff ============================================================================== --- subversion/branches/performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/ProplistCallback.java (original) +++ subversion/branches/performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/ProplistCallback.java Mon Sep 6 20:02:15 2010 @@ -24,10 +24,11 @@ package org.apache.subversion.javahl.callback; import java.util.Map; +import org.apache.subversion.javahl.ISVNClient; /** * This interface is used to property lists for each path in a - * SVNClientInterface.properties call. + * {...@link ISVNClient#properties} call. */ public interface ProplistCallback { Modified: subversion/branches/performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/StatusCallback.java URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/StatusCallback.java?rev=993141&r1=993140&r2=993141&view=diff ============================================================================== --- subversion/branches/performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/StatusCallback.java (original) +++ subversion/branches/performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/StatusCallback.java Mon Sep 6 20:02:15 2010 @@ -24,10 +24,11 @@ package org.apache.subversion.javahl.callback; import org.apache.subversion.javahl.Status; +import org.apache.subversion.javahl.ISVNClient; /** * This interface is used to receive every status item for - * the SVNClientInterface.status call. + * the {...@link ISVNClient#status} call. */ public interface StatusCallback { Modified: subversion/branches/performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/UserPasswordCallback.java URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/UserPasswordCallback.java?rev=993141&r1=993140&r2=993141&view=diff ============================================================================== --- subversion/branches/performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/UserPasswordCallback.java (original) +++ subversion/branches/performance/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/UserPasswordCallback.java Mon Sep 6 20:02:15 2010 @@ -24,9 +24,13 @@ package org.apache.subversion.javahl.callback; /** - * The original interface for receiving callbacks for authentication. - * Consider this code deprecated -- new applications should use - * PromptUserPassword3 instead. + * <p>The interface for requesting authentication credentials from the + * user. Should the javahl bindings need the matching information, + * these methodes will be called.</p> + * + * <p>This callback can also be used to provide the equivalent of the + * <code>--no-auth-cache</code> and <code>--non-interactive</code> + * arguments accepted by the command-line client.</p> */ public interface UserPasswordCallback { @@ -41,12 +45,6 @@ public interface UserPasswordCallback public static final int AcceptTemporary = 1; /** - * @deprecated Use the correctly spelled "AcceptTemporary" - * constant instead. - */ - public static final int AccecptTemporary = AcceptTemporary; - - /** * Accept the connection to the server <i>forever</i>. */ public static final int AcceptPermanently = 2; @@ -106,4 +104,52 @@ public interface UserPasswordCallback * @return the password */ public String getPassword(); + + /** + * Request a user name and password from the user, and (usually) + * store the auth credential caching preference specified by + * <code>maySave</code> (used by {...@link #userAllowedSave()}). + * Applications wanting to emulate the behavior of + * <code>--non-interactive</code> will implement this method in a + * manner which does not require user interaction (e.g. a no-op + * which assumes pre-cached auth credentials). + * + * @param realm The realm from which the question originates. + * @param username The name of the user in <code>realm</code>. + * @param maySave Whether caching of credentials is allowed. + * Usually affects the return value of the {...@link + * #userAllowedSave()} method. + * @return Whether the prompt for authentication credentials was + * successful (e.g. in a GUI application whether the dialog box + * was canceled). + */ + public boolean prompt(String realm, String username, boolean maySave); + + /** + * Ask the user a question, and (usually) store the auth + * credential caching preference specified by <code>maySave</code> + * (used by {...@link #userAllowedSave()}). Applications wanting to + * emulate the behavior of <code>--non-interactive</code> will + * implement this method in a manner which does not require user + * interaction (e.g. a no-op). + * + * @param realm The realm from which the question originates. + * @param question The text of the question. + * @param showAnswer Whether the answer may be displayed. + * @param maySave Whether caching of credentials is allowed. + * Usually affects the return value of the {...@link + * #userAllowedSave()} method. + * @return answer as entered or null if canceled + */ + public String askQuestion(String realm, String question, + boolean showAnswer, boolean maySave); + + /** + * @return Whether the caller allowed caching of credentials the + * last time {...@link #prompt(String, String, boolean)} was called. + * Applications wanting to emulate the behavior of + * <code>--no-auth-cache</code> will probably always return + * <code>false</code>. + */ + public boolean userAllowedSave(); } Modified: subversion/branches/performance/subversion/bindings/javahl/src/org/tigris/subversion/javahl/CommitItem.java URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/bindings/javahl/src/org/tigris/subversion/javahl/CommitItem.java?rev=993141&r1=993140&r2=993141&view=diff ============================================================================== --- subversion/branches/performance/subversion/bindings/javahl/src/org/tigris/subversion/javahl/CommitItem.java (original) +++ subversion/branches/performance/subversion/bindings/javahl/src/org/tigris/subversion/javahl/CommitItem.java Mon Sep 6 20:02:15 2010 @@ -92,7 +92,9 @@ public class CommitItem implements java. public CommitItem(org.apache.subversion.javahl.CommitItem aItem) { this(aItem.getPath(), NodeKind.fromApache(aItem.getNodeKind()), - aItem.getStateFlags(), aItem.getUrl(), aItem.getCopyUrl(), + aItem.getStateFlags(), + aItem.getUrl() != null ? aItem.getUrl().toString() : null, + aItem.getCopyUrl() != null ? aItem.getCopyUrl().toString() : null, aItem.getRevision()); } Modified: subversion/branches/performance/subversion/bindings/javahl/src/org/tigris/subversion/javahl/PromptUserPassword.java URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/bindings/javahl/src/org/tigris/subversion/javahl/PromptUserPassword.java?rev=993141&r1=993140&r2=993141&view=diff ============================================================================== --- subversion/branches/performance/subversion/bindings/javahl/src/org/tigris/subversion/javahl/PromptUserPassword.java (original) +++ subversion/branches/performance/subversion/bindings/javahl/src/org/tigris/subversion/javahl/PromptUserPassword.java Mon Sep 6 20:02:15 2010 @@ -29,6 +29,51 @@ package org.tigris.subversion.javahl; * PromptUserPassword3 instead. */ public interface PromptUserPassword - extends org.apache.subversion.javahl.callback.UserPasswordCallback { + /** + * Ask the user for username and password + * The entered username/password is retrieved by the getUsername + * getPasswort methods. + * + * @param realm for which server realm this information is requested. + * @param username the default username + * @return Whether the prompt for authentication credentials was + * successful (e.g. in a GUI application whether the dialog box + * was canceled). + */ + public boolean prompt(String realm, String username); + + /** + * ask the user a yes/no question + * @param realm for which server realm this information is + * requested. + * @param question question to be asked + * @param yesIsDefault if yes should be the default + * @return the answer + */ + public boolean askYesNo(String realm, String question, + boolean yesIsDefault); + + /** + * ask the user a question where she answers with a text. + * @param realm for which server realm this information is + * requested. + * @param question question to be asked + * @param showAnswer if the answer is shown or hidden + * @return the entered text or null if canceled + */ + public String askQuestion(String realm, String question, + boolean showAnswer); + + /** + * retrieve the username entered during the prompt call + * @return the username + */ + public String getUsername(); + + /** + * retrieve the password entered during the prompt call + * @return the password + */ + public String getPassword(); } Modified: subversion/branches/performance/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNAdmin.java URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNAdmin.java?rev=993141&r1=993140&r2=993141&view=diff ============================================================================== --- subversion/branches/performance/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNAdmin.java (original) +++ subversion/branches/performance/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNAdmin.java Mon Sep 6 20:02:15 2010 @@ -460,7 +460,9 @@ public class SVNAdmin { Set<org.apache.subversion.javahl.Lock> aLocks = aSVNAdmin.lslocks( - new File(path)); + new File(path), + Depth.toADepth( + Depth.infinity)); Lock[] locks = new Lock[aLocks.size()]; int i = 0; Modified: subversion/branches/performance/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java?rev=993141&r1=993140&r2=993141&view=diff ============================================================================== --- subversion/branches/performance/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java (original) +++ subversion/branches/performance/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java Mon Sep 6 20:02:15 2010 @@ -52,7 +52,9 @@ public class SVNClient implements SVNCli public SVNClient() { aSVNClient = new org.apache.subversion.javahl.SVNClient(); - cppAddr = aSVNClient.getCppAddr(); + /* This is a bogus value, there really shouldn't be any reason + for a user of this class to care. You've been warned. */ + cppAddr = 0xdeadbeef; } /** @@ -313,12 +315,71 @@ public class SVNClient implements SVNCli aSVNClient.password(password); } + private class PromptUser1Wrapper + implements org.apache.subversion.javahl.callback.UserPasswordCallback + { + PromptUserPassword oldPrompt; + + PromptUser1Wrapper(PromptUserPassword prompt) + { + oldPrompt = prompt; + } + + public String getPassword() + { + return oldPrompt.getPassword(); + } + + public String getUsername() + { + return oldPrompt.getUsername(); + } + + public String askQuestion(String realm, String question, + boolean showAnswer) + { + return oldPrompt.askQuestion(realm, question, showAnswer); + } + + public boolean askYesNo(String realm, String question, + boolean yesIsDefault) + { + return oldPrompt.askYesNo(realm, question, yesIsDefault); + } + + public boolean prompt(String realm, String username) + { + return oldPrompt.prompt(realm, username); + } + + public int askTrustSSLServer(String info, boolean allowPermanently) + { + return askTrustSSLServer(info, allowPermanently); + } + + public boolean userAllowedSave() + { + return false; + } + + public String askQuestion(String realm, String question, + boolean showAnswer, boolean maySave) + { + return askQuestion(realm, question, showAnswer); + } + + public boolean prompt(String realm, String username, boolean maySave) + { + return prompt(realm, username); + } + } + /** * @since 1.0 */ public void setPrompt(PromptUserPassword prompt) { - aSVNClient.setPrompt(prompt); + aSVNClient.setPrompt(new PromptUser1Wrapper(prompt)); } /** @@ -657,11 +718,18 @@ public class SVNClient implements SVNCli /** * @since 1.0 */ - public void commitMessageHandler(final CommitMessage messageHandler) + public void commitMessageHandler(CommitMessage messageHandler) { class MyCommitMessageHandler - implements org.apache.subversion.javahl.CommitMessage + implements org.apache.subversion.javahl.callback.CommitMessageCallback { + private CommitMessage messageHandler; + + public MyCommitMessageHandler(CommitMessage messageHandler) + { + this.messageHandler = messageHandler; + } + public String getLogMessage( Set<org.apache.subversion.javahl.CommitItem> elementsToBeCommited) { @@ -683,9 +751,11 @@ public class SVNClient implements SVNCli } } - aSVNClient.commitMessageHandler(new MyCommitMessageHandler()); + cachedHandler = new MyCommitMessageHandler(messageHandler); } + private org.apache.subversion.javahl.callback.CommitMessageCallback cachedHandler = null; + /** * @deprecated Use {...@link #remove(String[], String, boolean, boolean, Map)} * instead. @@ -707,7 +777,10 @@ public class SVNClient implements SVNCli try { aSVNClient.remove(new HashSet<String>(Arrays.asList(paths)), - message, force, keepLocal, revpropTable); + force, keepLocal, revpropTable, + message == null ? cachedHandler + : new ConstMsg(message), + null); } catch (org.apache.subversion.javahl.ClientException ex) { @@ -873,12 +946,23 @@ public class SVNClient implements SVNCli { try { - return aSVNClient.commit(new HashSet<String>(Arrays.asList(paths)), - message, Depth.toADepth(depth), noUnlock, - keepChangelist, - changelists == null ? null - : Arrays.asList(changelists), - revpropTable); + final long[] revList = { -1 }; + org.apache.subversion.javahl.callback.CommitCallback callback = + new org.apache.subversion.javahl.callback.CommitCallback () { + public void commitInfo(org.apache.subversion.javahl.CommitInfo info) + { revList[0] = info.getRevision(); } + }; + + aSVNClient.commit(new HashSet<String>(Arrays.asList(paths)), + Depth.toADepth(depth), noUnlock, + keepChangelist, + changelists == null ? null + : Arrays.asList(changelists), + revpropTable, + message == null ? cachedHandler + : new ConstMsg(message), + callback); + return revList[0]; } catch (org.apache.subversion.javahl.ClientException ex) { @@ -905,8 +989,11 @@ public class SVNClient implements SVNCli aCopySources.add(src.toApache()); } - aSVNClient.copy(aCopySources, destPath, message, copyAsChild, - makeParents, ignoreExternals, revpropTable); + aSVNClient.copy(aCopySources, destPath, copyAsChild, + makeParents, ignoreExternals, revpropTable, + message == null ? cachedHandler + : new ConstMsg(message), + null); } catch (org.apache.subversion.javahl.ClientException ex) { @@ -953,8 +1040,11 @@ public class SVNClient implements SVNCli try { aSVNClient.move(new HashSet<String>(Arrays.asList(srcPaths)), - destPath, message, force, moveAsChild, - makeParents, revpropTable); + destPath, force, moveAsChild, makeParents, + revpropTable, + message == null ? cachedHandler + : new ConstMsg(message), + null); } catch (org.apache.subversion.javahl.ClientException ex) { @@ -998,7 +1088,10 @@ public class SVNClient implements SVNCli try { aSVNClient.mkdir(new HashSet<String>(Arrays.asList(paths)), - message, makeParents, revpropTable); + makeParents, revpropTable, + message == null ? cachedHandler + : new ConstMsg(message), + null); } catch (org.apache.subversion.javahl.ClientException ex) { @@ -1178,8 +1271,11 @@ public class SVNClient implements SVNCli { try { - aSVNClient.doImport(path, url, message, Depth.toADepth(depth), - noIgnore, ignoreUnknownNodeTypes, revpropTable); + aSVNClient.doImport(path, url, Depth.toADepth(depth), + noIgnore, ignoreUnknownNodeTypes, revpropTable, + message == null ? cachedHandler + : new ConstMsg(message), + null); } catch (org.apache.subversion.javahl.ClientException ex) { @@ -1760,7 +1856,7 @@ public class SVNClient implements SVNCli aSVNClient.propertySet(path, name, value, Depth.toADepth(depth), changelists == null ? null : Arrays.asList(changelists), - force, revpropTable); + force, revpropTable, null); } catch (org.apache.subversion.javahl.ClientException ex) { @@ -2531,4 +2627,21 @@ public class SVNClient implements SVNCli callback.onSummary(new DiffSummary(summary)); } } + + private class ConstMsg + implements org.apache.subversion.javahl.callback.CommitMessageCallback + { + private String message; + + ConstMsg(String message) + { + this.message = message; + } + + public String getLogMessage( + Set<org.apache.subversion.javahl.CommitItem> items) + { + return message; + } + } }
