Author: rhuijben
Date: Sun Feb 22 01:36:15 2015
New Revision: 1661451

URL: http://svn.apache.org/r1661451
Log:
Expose the metadataOnly option that is already implemented in libsvn_client's
copy support through the api.

This should have been added when revving the api, as this api has been
available at the libsvn_wc level since 1.8 (and at least used by AnkhSVN
since then).

* subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp
  (Java_org_apache_subversion_javahl_SVNClient_copy): Pass metadataOnly.

* subversion/bindings/javahl/native/SVNClient.cpp
  (SVNClient::copy): Pass metadataOnly.

* subversion/bindings/javahl/native/SVNClient.h
  (SVNClient::copy): Pass metadataOnly.

* subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java
  (copy): Add and document metadataOnly argument.

* subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java
  (copy): Add and document metadataOnly argument.
  (copy): Update caller.

* subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
  (testCopy,
   testCopyPinExternals_wc2wc,
   testCopyPinExternals_wc2repo,
   testCopyPinExternals_repo2wc,
   testCopyPinExternals_repo2repo,
   testCopyPinExternals_repo2repo_explicit,
   setupAndPerformMerge): Update caller.
* subversion/include/svn_client.h
  (svn_client_copy7): Add argument.

* subversion/libsvn_client/copy.c
  (svn_client_copy7): Add argument. Update caller.

* subversion/libsvn_client/deprecated.c
  (svn_client_copy6): Update caller.

* subversion/svn/copy-cmd.c
  (svn_cl__copy): Update caller.

* subversion/tests/libsvn_client/client-test.c
  (test_copy_pin_externals): Update caller.

* subversion/tests/libsvn_wc/utils.c
  (sbox_wc_copy_url): Update caller.

Modified:
    subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp
    subversion/trunk/subversion/bindings/javahl/native/SVNClient.h
    
subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp
    
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/tests/org/apache/subversion/javahl/BasicTests.java
    subversion/trunk/subversion/include/svn_client.h
    subversion/trunk/subversion/libsvn_client/copy.c
    subversion/trunk/subversion/libsvn_client/deprecated.c
    subversion/trunk/subversion/svn/copy-cmd.c
    subversion/trunk/subversion/tests/libsvn_client/client-test.c
    subversion/trunk/subversion/tests/libsvn_wc/utils.c

Modified: subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp?rev=1661451&r1=1661450&r2=1661451&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp Sun Feb 22 
01:36:15 2015
@@ -519,6 +519,7 @@ apr_hash_t *get_externals_to_pin(jobject
 void SVNClient::copy(CopySources &copySources, const char *destPath,
                      CommitMessage *message, bool copyAsChild,
                      bool makeParents, bool ignoreExternals,
+                     bool metadataOnly,
                      bool pinExternals, jobject jexternalsToPin,
                      PropertyTable &revprops, CommitCallback *callback)
 {
@@ -538,6 +539,7 @@ void SVNClient::copy(CopySources &copySo
     if (!JNIUtil::isJavaExceptionThrown())
       SVN_JNI_ERR(svn_client_copy7(srcs, destinationPath.c_str(),
                                    copyAsChild, makeParents, ignoreExternals,
+                                   metadataOnly,
                                    pinExternals, pin_set,
                                    revprops.hash(subPool),
                                    CommitCallback::callback, callback,

Modified: subversion/trunk/subversion/bindings/javahl/native/SVNClient.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/SVNClient.h?rev=1661451&r1=1661450&r2=1661451&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/SVNClient.h (original)
+++ subversion/trunk/subversion/bindings/javahl/native/SVNClient.h Sun Feb 22 
01:36:15 2015
@@ -149,7 +149,7 @@ class SVNClient :public SVNBase
             PropertyTable &revprops, CommitCallback *callback);
   void copy(CopySources &copySources, const char *destPath,
             CommitMessage *message, bool copyAsChild, bool makeParents,
-            bool ignoreExternals, bool pinExternals,
+            bool ignoreExternals, bool metaDataOnly, bool pinExternals,
             jobject jexternalsToPin,
             PropertyTable &revprops, CommitCallback *callback);
   void commit(Targets &targets, CommitMessage *message, svn_depth_t depth,

Modified: 
subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp?rev=1661451&r1=1661450&r2=1661451&view=diff
==============================================================================
--- 
subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp
 (original)
+++ 
subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp
 Sun Feb 22 01:36:15 2015
@@ -559,7 +559,7 @@ JNIEXPORT void JNICALL
 Java_org_apache_subversion_javahl_SVNClient_copy
 (JNIEnv *env, jobject jthis, jobject jcopySources, jstring jdestPath,
  jboolean jcopyAsChild, jboolean jmakeParents, jboolean jignoreExternals,
- jboolean jpinExternals, jobject jexternalsToPin,
+ jboolean jmetadataOnly, jboolean jpinExternals, jobject jexternalsToPin,
  jobject jrevpropTable, jobject jmessage, jobject jcallback)
 {
   JNIEntry(SVNClient, copy);
@@ -593,7 +593,8 @@ Java_org_apache_subversion_javahl_SVNCli
   CommitCallback callback(jcallback);
   cl->copy(copySources, destPath, &message,
            bool(jcopyAsChild), bool(jmakeParents),
-           bool(jignoreExternals), bool(jpinExternals), jexternalsToPin,
+           bool(jignoreExternals), bool(jmetadataOnly),
+           bool(jpinExternals), jexternalsToPin,
            revprops, jcallback ? &callback : NULL);
 }
 

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=1661451&r1=1661450&r2=1661451&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
 Sun Feb 22 01:36:15 2015
@@ -376,6 +376,7 @@ public interface ISVNClient
      * @param makeParents Whether to create intermediate parents
      * @param ignoreExternals Whether or not to process external definitions
      *                        as part of this operation.
+     * @param metadataOnly Copy just the metadata and not the working 
files/dirs
      * @param pinExternals Whether or not to pin external definitions as part
      *                     of this operation.
      * @param externalsToPin The set of externals to pin.
@@ -401,7 +402,8 @@ public interface ISVNClient
      */
     void copy(List<CopySource> sources, String destPath,
               boolean copyAsChild, boolean makeParents,
-              boolean ignoreExternals,  boolean pinExternals,
+              boolean ignoreExternals, boolean metadataOnly,
+              boolean pinExternals,
               Map<String, List<ExternalItem>> externalsToPin,
               Map<String, String> revpropTable,
               CommitMessageCallback handler, CommitCallback callback)

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=1661451&r1=1661450&r2=1661451&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
 Sun Feb 22 01:36:15 2015
@@ -240,7 +240,8 @@ public class SVNClient implements ISVNCl
 
     public native void copy(List<CopySource> sources, String destPath,
                             boolean copyAsChild, boolean makeParents,
-                            boolean ignoreExternals, boolean pinExternals,
+                            boolean ignoreExternals, boolean metadataOnly,
+                            boolean pinExternals,
                             Map<String, List<ExternalItem>> externalsToPin,
                             Map<String, String> revpropTable,
                             CommitMessageCallback handler, CommitCallback 
callback)
@@ -254,7 +255,7 @@ public class SVNClient implements ISVNCl
             throws ClientException
     {
         copy(sources, destPath, copyAsChild, makeParents, ignoreExternals,
-             false, null, revpropTable, handler, callback);
+             false, false, null, revpropTable, handler, callback);
     }
 
     public native void move(Set<String> srcPaths, String destPath,

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=1661451&r1=1661450&r2=1661451&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
 Sun Feb 22 01:36:15 2015
@@ -1060,7 +1060,7 @@ public class BasicTests extends SVNTests
         }
         client.copy(sources,
                     new File(thisTest.getWorkingCopy(), "A/B/F").getPath(),
-                    true, false, false, false, null, null, null, null);
+                    true, false, false, false, false, null, null, null, null);
 
         // Commit the changes, and check the state of the WC.
         checkCommitRevision(thisTest,
@@ -1077,7 +1077,7 @@ public class BasicTests extends SVNTests
                                         "A/B").getPath(), Revision.WORKING,
                                     Revision.WORKING));
         client.copy(wcSource, thisTest.getUrl() + "/parent/A/B",
-                    true, true, false, false, null, null,
+                    true, true, false, false, false, null, null,
                     new ConstMsg("Copy WC to URL"), null);
 
         // update the WC to get new folder and confirm the copy
@@ -1123,7 +1123,7 @@ public class BasicTests extends SVNTests
         List<CopySource> sources = new ArrayList<CopySource>(1);
         sources.add(new CopySource(thisTest.getWCPath() + "/A/B", null, null));
         String target = thisTest.getWCPath() + "/A/Bcopy";
-        client.copy(sources, target, true, false, false,
+        client.copy(sources, target, true, false, false, false,
                     true,       // pinExternals
                     null,       // externalsToPin
                     null, null, null);
@@ -1151,7 +1151,7 @@ public class BasicTests extends SVNTests
         List<CopySource> sources = new ArrayList<CopySource>(1);
         sources.add(new CopySource(thisTest.getWCPath() + "/A/B", null, null));
         String target = thisTest.getUrl() + "/A/Bcopy";
-        client.copy(sources, target, true, false, false,
+        client.copy(sources, target, true, false, false, false,
                     true,       // pinExternals
                     null,       // externalsToPin
                     null, new ConstMsg("Copy WC to REPO"), null);
@@ -1179,7 +1179,7 @@ public class BasicTests extends SVNTests
         List<CopySource> sources = new ArrayList<CopySource>(1);
         sources.add(new CopySource(thisTest.getUrl() + "/A/B", null, null));
         String target = thisTest.getWCPath() + "/A/Bcopy";
-        client.copy(sources, target, true, false, false,
+        client.copy(sources, target, true, false, false, false,
                     true,       // pinExternals
                     null,       // externalsToPin
                     null, null, null);
@@ -1207,7 +1207,7 @@ public class BasicTests extends SVNTests
         List<CopySource> sources = new ArrayList<CopySource>(1);
         sources.add(new CopySource(thisTest.getUrl() + "/A/B", null, null));
         String target = thisTest.getUrl() + "/A/Bcopy";
-        client.copy(sources, target, true, false, false,
+        client.copy(sources, target, true, false, false, false,
                     true,       // pinExternals
                     null,       // externalsToPin
                     null, new ConstMsg("Copy WC to REPO"), null);
@@ -1242,7 +1242,7 @@ public class BasicTests extends SVNTests
         List<CopySource> sources = new ArrayList<CopySource>(1);
         sources.add(new CopySource(sourceUrl, null, null));
         String target = thisTest.getUrl() + "/A/Bcopy";
-        client.copy(sources, target, true, false, false,
+        client.copy(sources, target, true, false, false, false,
                     true,       // pinExternals
                     externalsToPin,
                     null, new ConstMsg("Copy WC to REPO"), null);
@@ -3175,7 +3175,7 @@ public class BasicTests extends SVNTests
         srcs.add(new CopySource(thisTest.getUrl() + "/A", Revision.HEAD,
                                 Revision.HEAD));
         client.copy(srcs, thisTest.getUrl() + "/branches/A",
-                    true, false, false, false, null, null,
+                    true, false, false, false, false, null, null,
                     new ConstMsg("create A branch"), null);
 
         // update the WC (to r3) so that it has the branches folder

Modified: subversion/trunk/subversion/include/svn_client.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_client.h?rev=1661451&r1=1661450&r2=1661451&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_client.h (original)
+++ subversion/trunk/subversion/include/svn_client.h Sun Feb 22 01:36:15 2015
@@ -4492,6 +4492,12 @@ typedef struct svn_client_copy_source_t
  * If @a ignore_externals is set, don't process externals definitions
  * as part of this operation.
  *
+ * If @a metadata_only is @c TRUE and copying a file in a working copy,
+ * everything in the metadata is updated as if the node is moved, but the
+ * actual disk copy operation is not performed. This feature is useful for
+ * clients that want to keep the working copy in sync while the actual working
+ * copy is updated by some other task.
+ *
  * If @a pin_externals is set, pin URLs in copied externals definitions
  * to their current revision unless they were already pinned to a
  * particular revision. A pinned external uses a URL which points at a
@@ -4547,6 +4553,7 @@ svn_client_copy7(const apr_array_header_
                  svn_boolean_t copy_as_child,
                  svn_boolean_t make_parents,
                  svn_boolean_t ignore_externals,
+                 svn_boolean_t metadata_only,
                  svn_boolean_t pin_externals,
                  const apr_hash_t *externals_to_pin,
                  const apr_hash_t *revprop_table,
@@ -4556,7 +4563,9 @@ svn_client_copy7(const apr_array_header_
                  apr_pool_t *pool);
 
 /**
- * Similar to svn_client_copy7(), but cannot pin externals.
+ * Similar to svn_client_copy7(), but doesn't support meta_data_only
+ * and cannot pin externals.
+ * 
  *
  * @since New in 1.7.
  * @deprecated Provided for backward compatibility with the 1.8 API.

Modified: subversion/trunk/subversion/libsvn_client/copy.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/copy.c?rev=1661451&r1=1661450&r2=1661451&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/copy.c (original)
+++ subversion/trunk/subversion/libsvn_client/copy.c Sun Feb 22 01:36:15 2015
@@ -3093,6 +3093,7 @@ svn_client_copy7(const apr_array_header_
                  svn_boolean_t copy_as_child,
                  svn_boolean_t make_parents,
                  svn_boolean_t ignore_externals,
+                 svn_boolean_t metadata_only,
                  svn_boolean_t pin_externals,
                  const apr_hash_t *externals_to_pin,
                  const apr_hash_t *revprop_table,
@@ -3113,7 +3114,7 @@ svn_client_copy7(const apr_array_header_
                  sources, dst_path,
                  FALSE /* is_move */,
                  TRUE /* allow_mixed_revisions */,
-                 FALSE /* metadata_only */,
+                 metadata_only,
                  make_parents,
                  ignore_externals,
                  pin_externals,
@@ -3149,7 +3150,7 @@ svn_client_copy7(const apr_array_header_
                      sources, dst_path,
                      FALSE /* is_move */,
                      TRUE /* allow_mixed_revisions */,
-                     FALSE /* metadata_only */,
+                     metadata_only,
                      make_parents,
                      ignore_externals,
                      pin_externals,

Modified: subversion/trunk/subversion/libsvn_client/deprecated.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/deprecated.c?rev=1661451&r1=1661450&r2=1661451&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/deprecated.c (original)
+++ subversion/trunk/subversion/libsvn_client/deprecated.c Sun Feb 22 01:36:15 
2015
@@ -640,7 +640,10 @@ svn_client_copy6(const apr_array_header_
 {
   return svn_error_trace(svn_client_copy7(sources, dst_path, copy_as_child,
                                           make_parents, ignore_externals,
-                                          FALSE, NULL, revprop_table,
+                                          FALSE /* metadata_only */,
+                                          FALSE /* pin_externals */,
+                                          NULL /* externals_to_pin */,
+                                          revprop_table,
                                           commit_callback, commit_baton,
                                           ctx, pool));
 }

Modified: subversion/trunk/subversion/svn/copy-cmd.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/copy-cmd.c?rev=1661451&r1=1661450&r2=1661451&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/copy-cmd.c (original)
+++ subversion/trunk/subversion/svn/copy-cmd.c Sun Feb 22 01:36:15 2015
@@ -169,6 +169,7 @@ svn_cl__copy(apr_getopt_t *os,
 
   err = svn_client_copy7(sources, dst_path, TRUE,
                          opt_state->parents, opt_state->ignore_externals,
+                         FALSE /* metadata_only */,
                          opt_state->pin_externals,
                          NULL, /* pin all externals */
                          opt_state->revprop_table,

Modified: subversion/trunk/subversion/tests/libsvn_client/client-test.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_client/client-test.c?rev=1661451&r1=1661450&r2=1661451&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_client/client-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_client/client-test.c Sun Feb 22 
01:36:15 2015
@@ -1157,7 +1157,7 @@ test_copy_pin_externals(const svn_test_o
   APR_ARRAY_PUSH(copy_sources, svn_client_copy_source_t *) = &copy_source;
   A_copy_url = apr_pstrcat(pool, repos_url, "/A_copy", SVN_VA_NULL);
   SVN_ERR(svn_client_copy7(copy_sources, A_copy_url, FALSE, FALSE,
-                           FALSE, TRUE, externals_to_pin,
+                           FALSE, FALSE, TRUE, externals_to_pin,
                            NULL, NULL, NULL, ctx, pool));
 
   /* Verify that externals were pinned as expected. */

Modified: subversion/trunk/subversion/tests/libsvn_wc/utils.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/utils.c?rev=1661451&r1=1661450&r2=1661451&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/utils.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/utils.c Sun Feb 22 01:36:15 2015
@@ -393,6 +393,7 @@ sbox_wc_copy_url(svn_test__sandbox_t *b,
                            FALSE /* copy_as_child */,
                            FALSE /* make_parents */,
                            FALSE /* ignore_externals */,
+                           FALSE /* metadata_only */,
                            FALSE, NULL /* pin_external */,
                            NULL /* revprops */,
                            NULL, NULL, /* commit_callback */


Reply via email to