You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2010/09/01 22:44:40 UTC

svn commit: r991698 - in /subversion/trunk/subversion/bindings/javahl: src/org/apache/subversion/javahl/ src/org/tigris/subversion/javahl/ tests/org/apache/subversion/javahl/

Author: hwright
Date: Wed Sep  1 20:44:39 2010
New Revision: 991698

URL: http://svn.apache.org/viewvc?rev=991698&view=rev
Log:
Finish making the CommitMessage callbacks part of the public API.

* subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java:
  Update tests.

* subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java
  (SVNTests): Don't set a default handler.

* subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java
  (commitMessageHandler, messageHandler, ConstMsg): Remove.
  (copy, move, mkdir, remove): Remove wrappers, update public API.

* subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java
  (commitMessageHandler): Remove.
  (copy, move, mkdir, remove): Update public API.

* subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java
  (commitMessageHandler): Don't call the proxy version of this method.
  (copy, move, mkdir, remove): Update wrappers.

Modified:
    subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java
    subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java
    subversion/trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java
    subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
    subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java

Modified: subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java?rev=991698&r1=991697&r2=991698&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java (original)
+++ subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java Wed Sep  1 20:44:39 2010
@@ -198,15 +198,6 @@ public interface ISVNClient
     void setProgressCallback(ProgressCallback listener);
 
     /**
-     * Sets the commit message handler. This allows more complex commit message
-     * with the list of the elements to be commited as input.
-     * @param messageHandler    callback for entering commit messages
-     *                          if this is set the message parameter is ignored.
-     * @since 1.0
-     */
-    void commitMessageHandler(CommitMessage messageHandler);
-
-    /**
      * Sets a file for deletion.
      * @param path      path or url to be deleted
      * @param message   if path is a url, this will be the commit message.
@@ -309,10 +300,10 @@ public interface ISVNClient
      * @throws ClientException If the copy operation fails.
      * @since 1.7
      */
-    void copy(List<CopySource> sources, String destPath, String message,
+    void copy(List<CopySource> sources, String destPath,
               boolean copyAsChild, boolean makeParents,
               boolean ignoreExternals, Map<String, String> revpropTable,
-              CommitCallback callback)
+              CommitMessage handler, CommitCallback callback)
             throws ClientException;
 
     /**
@@ -333,9 +324,10 @@ public interface ISVNClient
      * @throws ClientException If the move operation fails.
      * @since 1.5
      */
-    void move(Set<String> srcPaths, String destPath, String message,
-              boolean force, boolean moveAsChild, boolean makeParents,
-              Map<String, String> revpropTable, CommitCallback callback)
+    void move(Set<String> srcPaths, String destPath, boolean force,
+              boolean moveAsChild, boolean makeParents,
+              Map<String, String> revpropTable,
+              CommitMessage handler, CommitCallback callback)
         throws ClientException;
 
     /**
@@ -350,8 +342,9 @@ public interface ISVNClient
      * @throws ClientException
      * @since 1.5
      */
-    void mkdir(Set<String> path, String message, boolean makeParents,
-               Map<String, String> revpropTable, CommitCallback callback)
+    void mkdir(Set<String> path, boolean makeParents,
+               Map<String, String> revpropTable,
+               CommitMessage handler, CommitCallback callback)
             throws ClientException;
 
     /**

Modified: subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java?rev=991698&r1=991697&r2=991698&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java (original)
+++ subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java Wed Sep  1 20:44:39 2010
@@ -198,16 +198,6 @@ public class SVNClient implements ISVNCl
     }
 
     /**
-     * @since 1.0
-     */
-    public void commitMessageHandler(CommitMessage messageHandler)
-    {
-        this.messageHandler = messageHandler;
-    }
-
-    private CommitMessage messageHandler = null;
-
-    /**
      * @since 1.5
      */
     public native void remove(Set<String> paths, boolean force,
@@ -252,65 +242,29 @@ public class SVNClient implements ISVNCl
     /**
      * @since 1.7
      */
-    public void copy(List<CopySource> sources, String destPath,
-                     String message, boolean copyAsChild,
-                     boolean makeParents, boolean ignoreExternals,
-                     Map<String, String> revpropTable,
-                     CommitCallback callback)
-            throws ClientException
-    {
-        copy(sources, destPath, copyAsChild, makeParents, ignoreExternals,
-             revpropTable, new ConstMsg(message), callback);
-    }
-
-    private native void copy(List<CopySource> sources, String destPath,
-                             boolean copyAsChild,
-                             boolean makeParents, boolean ignoreExternals,
-                             Map<String, String> revpropTable,
-                             CommitMessage handler,
-                             CommitCallback callback)
+    public native void copy(List<CopySource> sources, String destPath,
+                            boolean copyAsChild, boolean makeParents,
+                            boolean ignoreExternals,
+                            Map<String, String> revpropTable,
+                            CommitMessage handler, CommitCallback callback)
             throws ClientException;
 
     /**
      * @since 1.5
      */
-    public void move(Set<String> srcPaths, String destPath,
-                     String message, boolean force, boolean moveAsChild,
-                     boolean makeParents,
-                     Map<String, String> revpropTable,
-                     CommitCallback callback)
-            throws ClientException
-    {
-        move(srcPaths, destPath, force, moveAsChild, makeParents,
-             revpropTable, new ConstMsg(message), callback);
-    }
-
-    private native void move(Set<String> srcPaths, String destPath,
-                             boolean force, boolean moveAsChild,
-                             boolean makeParents,
-                             Map<String, String> revpropTable,
-                             CommitMessage handler,
-                             CommitCallback callback)
+    public native void move(Set<String> srcPaths, String destPath,
+                            boolean force, boolean moveAsChild,
+                            boolean makeParents,
+                            Map<String, String> revpropTable,
+                            CommitMessage handler, CommitCallback callback)
             throws ClientException;
 
     /**
      * @since 1.5
      */
-    public void mkdir(Set<String> paths, String message,
-                      boolean makeParents,
-                      Map<String, String> revpropTable,
-                      CommitCallback callback)
-            throws ClientException
-    {
-        mkdir(paths, makeParents, revpropTable, new ConstMsg(message),
-              callback);
-    }
-
-    private native void mkdir(Set<String> paths,
-                              boolean makeParents,
-                              Map<String, String> revpropTable,
-                              CommitMessage handler,
-                              CommitCallback callback)
+    public native void mkdir(Set<String> paths, boolean makeParents,
+                             Map<String, String> revpropTable,
+                             CommitMessage handler, CommitCallback callback)
             throws ClientException;
 
     /**
@@ -722,25 +676,4 @@ public class SVNClient implements ISVNCl
                                           null);
         }
     }
-
-    private class ConstMsg
-        implements CommitMessage
-    {
-        private String message;
-
-        public ConstMsg(String message)
-        {
-            this.message = message;
-        }
-
-        public String getLogMessage(Set<CommitItem> items)
-        {
-            if (message != null)
-                return message;
-            else if (messageHandler != null)
-                return messageHandler.getLogMessage(items);
-            else
-                return null;
-        }
-    }
 }

Modified: subversion/trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java?rev=991698&r1=991697&r2=991698&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java (original)
+++ subversion/trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java Wed Sep  1 20:44:39 2010
@@ -749,8 +749,6 @@ public class SVNClient implements SVNCli
             }
         }
 
-        aSVNClient.commitMessageHandler(new MyCommitMessageHandler(
-                                                            messageHandler));
         cachedHandler = new MyCommitMessageHandler(messageHandler);
     }
 
@@ -989,8 +987,11 @@ public class SVNClient implements SVNCli
                 aCopySources.add(src.toApache());
             }
 
-            aSVNClient.copy(aCopySources, destPath, message, copyAsChild,
-                            makeParents, ignoreExternals, revpropTable, null);
+            aSVNClient.copy(aCopySources, destPath, copyAsChild,
+                            makeParents, ignoreExternals, revpropTable,
+                            message == null ? cachedHandler
+                                : new ConstMsg(message),
+                            null);
         }
         catch (org.apache.subversion.javahl.ClientException ex)
         {
@@ -1037,8 +1038,11 @@ public class SVNClient implements SVNCli
         try
         {
             aSVNClient.move(new HashSet<String>(Arrays.asList(srcPaths)),
-                            destPath, message, force, moveAsChild,
-                            makeParents, revpropTable, null);
+                            destPath, force, moveAsChild, makeParents,
+                            revpropTable,
+                            message == null ? cachedHandler
+                                : new ConstMsg(message),
+                            null);
         }
         catch (org.apache.subversion.javahl.ClientException ex)
         {
@@ -1082,7 +1086,10 @@ public class SVNClient implements SVNCli
         try
         {
             aSVNClient.mkdir(new HashSet<String>(Arrays.asList(paths)),
-                             message, makeParents, revpropTable, null);
+                             makeParents, revpropTable,
+                             message == null ? cachedHandler
+                                : new ConstMsg(message),
+                             null);
         }
         catch (org.apache.subversion.javahl.ClientException ex)
         {

Modified: subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java?rev=991698&r1=991697&r2=991698&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java (original)
+++ subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java Wed Sep  1 20:44:39 2010
@@ -807,7 +807,7 @@ public class BasicTests extends SVNTests
         Set<String> urls = new HashSet<String>(2);
         urls.add(thisTest.getUrl() + "/Y");
         urls.add(thisTest.getUrl() + "/Y/Z");
-        client.mkdir(urls, "log_msg", false, null, null);
+        client.mkdir(urls, false, null, new ConstMsg("log_msg"), null);
 
         // add the new directories the expected working copy layout
         thisTest.getWc().addItem("Y", null);
@@ -857,7 +857,7 @@ public class BasicTests extends SVNTests
         }
         client.copy(sources,
                     new File(thisTest.getWorkingCopy(), "A/B/F").getPath(),
-                    null, true, false, false, null, null);
+                    true, false, false, null, null, null);
 
         // Commit the changes, and check the state of the WC.
         checkCommitRevision(thisTest,
@@ -873,9 +873,9 @@ public class BasicTests extends SVNTests
         wcSource.add(new CopySource(new File(thisTest.getWorkingCopy(),
                                         "A/B").getPath(), Revision.WORKING,
                                     Revision.WORKING));
-        client.copy(wcSource,
-                    thisTest.getUrl() + "/parent/A/B",
-                    "Copy WC to URL", true, true, false, null, null);
+        client.copy(wcSource, thisTest.getUrl() + "/parent/A/B",
+                    true, true, false, null,
+                    new ConstMsg("Copy WC to URL"), null);
 
         // update the WC to get new folder and confirm the copy
         assertEquals("wrong revision number from update",
@@ -919,7 +919,7 @@ public class BasicTests extends SVNTests
         }
         client.move(srcPaths,
                     new File(thisTest.getWorkingCopy(), "A/B/F").getPath(),
-                    null, false, true, false, null, null);
+                    false, true, false, null, null, null);
 
         // Commit the changes, and check the state of the WC.
         checkCommitRevision(thisTest,
@@ -1332,7 +1332,7 @@ public class BasicTests extends SVNTests
         thisTest.checkStatus();
 
         // create & add the directory X
-        client.mkdir(thisTest.getWCPathSet("/X"), null, false, null, null);
+        client.mkdir(thisTest.getWCPathSet("/X"), false, null, null, null);
         thisTest.getWc().addItem("X", null);
         thisTest.getWc().setItemTextStatus("X", Status.Kind.added);
 
@@ -1456,7 +1456,7 @@ public class BasicTests extends SVNTests
         file = new File(thisTest.getWCPath(), "A/B/X");
         pathSet.clear();
         pathSet.add(file.getAbsolutePath());
-        client.mkdir(pathSet, null, false, null, null);
+        client.mkdir(pathSet, false, null, null, null);
         thisTest.getWc().addItem("A/B/X", null);
         thisTest.getWc().setItemTextStatus("A/B/X", Status.Kind.added);
 
@@ -1473,7 +1473,7 @@ public class BasicTests extends SVNTests
         file = new File(thisTest.getWCPath(), "A/B/Y");
         pathSet.clear();
         pathSet.add(file.getAbsolutePath());
-        client.mkdir(pathSet, null, false, null, null);
+        client.mkdir(pathSet, false, null, null, null);
         thisTest.getWc().addItem("A/B/Y", null);
         thisTest.getWc().setItemTextStatus("A/B/Y", Status.Kind.added);
 
@@ -2613,7 +2613,7 @@ public class BasicTests extends SVNTests
                               NodeKind.none, CommitItemStateFlags.Add);
         Set<String> paths = new HashSet<String>(1);
         paths.add(thisTest.getUrl() + "/branches");
-        client.mkdir(paths, "log_msg", false, null, null);
+        client.mkdir(paths, false, null, new ConstMsg("log_msg"), null);
 
         // copy A to branches (r3)
         addExpectedCommitItem(null, thisTest.getUrl(), "branches/A",
@@ -2622,7 +2622,8 @@ public class BasicTests extends SVNTests
         srcs.add(new CopySource(thisTest.getUrl() + "/A", Revision.HEAD,
                                 Revision.HEAD));
         client.copy(srcs, thisTest.getUrl() + "/branches/A",
-                    "create A branch", true, false, false, null, null);
+                    true, false, false, null,
+                    new ConstMsg("create A branch"), null);
 
         // update the WC (to r3) so that it has the branches folder
         client.update(thisTest.getWCPathSet(), Revision.HEAD,
@@ -3087,7 +3088,7 @@ public class BasicTests extends SVNTests
         }
         client.move(srcPaths,
                     new File(thisTest.getWorkingCopy(), "A/B/F").getPath(),
-                    null, false, true, false, null, null);
+                    false, true, false, null, null, null);
 
         // Commit the changes, and check the state of the WC.
         checkCommitRevision(thisTest,

Modified: subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java?rev=991698&r1=991697&r2=991698&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java (original)
+++ subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java Wed Sep  1 20:44:39 2010
@@ -272,7 +272,6 @@ class SVNTests extends TestCase
     {
         this.client = new SVNClient();
         this.client.notification2(new MyNotifier());
-        this.client.commitMessageHandler(new MyCommitMessage());
         this.client.setPrompt(new DefaultPromptUserPassword());
         this.client.username("jrandom");
         this.client.setProgressCallback(new DefaultProgressListener());