Author: hwright
Date: Thu Apr 21 21:37:54 2011
New Revision: 1095825

URL: http://svn.apache.org/viewvc?rev=1095825&view=rev
Log:
Fix the JavaHL build as a result of r1095802.

(I have to run just now, but will follow this up with a proper message
within in the day.  I just want to get the buildbots going again.)

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/src/org/tigris/subversion/javahl/SVNClient.java
    
subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java

Modified: subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp?rev=1095825&r1=1095824&r2=1095825&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp Thu Apr 21 
21:37:54 2011
@@ -873,10 +873,9 @@ void SVNClient::properties(const char *p
     return;
 }
 
-void SVNClient::propertySet(Targets &targets, const char *name,
-                            JNIByteArray &value, svn_depth_t depth,
-                            StringArray &changelists, bool force,
-                            RevpropTable &revprops, CommitCallback *callback)
+void SVNClient::propertySetLocal(Targets &targets, const char *name,
+                                 JNIByteArray &value, svn_depth_t depth,
+                                 StringArray &changelists, bool force)
 {
     SVN::Pool requestPool;
     SVN_JNI_NULL_PTR_EX(name, "name", );
@@ -893,12 +892,39 @@ void SVNClient::propertySet(Targets &tar
         return;
 
     const apr_array_header_t *targetsApr = targets.array(requestPool);
-    SVN_JNI_ERR(svn_client_propset4(name, val, targetsApr,
-                                    depth, force, SVN_INVALID_REVNUM,
-                                    changelists.array(requestPool),
-                                    revprops.hash(requestPool),
-                                    CommitCallback::callback, callback,
-                                    ctx, requestPool.pool()), );
+    SVN_JNI_ERR(svn_client_propset_local(name, val, targetsApr,
+                                         depth, force,
+                                         changelists.array(requestPool),
+                                         ctx, requestPool.pool()), );
+}
+
+void SVNClient::propertySetRemote(const char *path, const char *name,
+                                  JNIByteArray &value, bool force,
+                                  RevpropTable &revprops,
+                                  CommitCallback *callback)
+{
+    SVN::Pool requestPool;
+    SVN_JNI_NULL_PTR_EX(name, "name", );
+
+    svn_string_t *val;
+    if (value.isNull())
+      val = NULL;
+    else
+      val = svn_string_ncreate((const char *)value.getBytes(), 
value.getLength(),
+                               requestPool.pool());
+
+    Path intPath(path);
+    SVN_JNI_ERR(intPath.error_occured(), );
+
+    svn_client_ctx_t *ctx = context.getContext(NULL);
+    if (ctx == NULL)
+        return;
+
+    SVN_JNI_ERR(svn_client_propset_remote(name, val, intPath.c_str(),
+                                          force, SVN_INVALID_REVNUM,
+                                          revprops.hash(requestPool),
+                                          CommitCallback::callback, callback,
+                                          ctx, requestPool.pool()), );
 }
 
 void SVNClient::diff(const char *target1, Revision &revision1,

Modified: subversion/trunk/subversion/bindings/javahl/native/SVNClient.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/SVNClient.h?rev=1095825&r1=1095824&r2=1095825&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/SVNClient.h (original)
+++ subversion/trunk/subversion/bindings/javahl/native/SVNClient.h Thu Apr 21 
21:37:54 2011
@@ -78,9 +78,12 @@ class SVNClient :public SVNBase
                 bool ignoreExternals);
   void streamFileContent(const char *path, Revision &revision,
                          Revision &pegRevision, OutputStream &outputStream);
-  void propertySet(Targets &targets, const char *name, JNIByteArray &value,
-                   svn_depth_t depth, StringArray &changelists, bool force,
-                   RevpropTable &revprops, CommitCallback *callback);
+  void propertySetLocal(Targets &targets, const char *name, JNIByteArray 
&value,
+                        svn_depth_t depth, StringArray &changelists,
+                        bool force);
+  void propertySetRemote(const char *path, const char *name,
+                         JNIByteArray &value, bool force,
+                         RevpropTable &revprops, CommitCallback *callback);
   void properties(const char *path, Revision &revision,
                   Revision &pegRevision, svn_depth_t depth,
                   StringArray &changelists, ProplistCallback *callback);

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=1095825&r1=1095824&r2=1095825&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
 Thu Apr 21 21:37:54 2011
@@ -916,10 +916,9 @@ Java_org_apache_subversion_javahl_SVNCli
 }
 
 JNIEXPORT void JNICALL
-Java_org_apache_subversion_javahl_SVNClient_propertySet
-(JNIEnv *env, jobject jthis, jobject jtargets, jstring jname, jbyteArray 
jvalue,
- jobject jdepth, jobject jchangelists, jboolean jforce, jobject jrevpropTable,
- jobject jcallback)
+Java_org_apache_subversion_javahl_SVNClient_propertySetRemote
+(JNIEnv *env, jobject jthis, jstring jpath, jstring jname,
+ jbyteArray jvalue, jboolean jforce, jobject jrevpropTable, jobject jcallback)
 {
   JNIEntry(SVNClient, propertySet);
   SVNClient *cl = SVNClient::getCppObject(jthis);
@@ -928,8 +927,7 @@ Java_org_apache_subversion_javahl_SVNCli
       JNIUtil::throwError(_("bad C++ this"));
       return;
     }
-  StringArray targetsArr(jtargets);
-  Targets targets(targetsArr);
+  JNIStringHolder path(jpath);
   if (JNIUtil::isExceptionThrown())
     return;
 
@@ -941,18 +939,46 @@ Java_org_apache_subversion_javahl_SVNCli
   if (JNIUtil::isExceptionThrown())
     return;
 
-  StringArray changelists(jchangelists);
+  RevpropTable revprops(jrevpropTable);
   if (JNIUtil::isExceptionThrown())
     return;
 
-  RevpropTable revprops(jrevpropTable);
+  CommitCallback callback(jcallback);
+  cl->propertySetRemote(path, name, value, jforce ? true:false, revprops,
+                        jcallback ? &callback : NULL);
+}
+
+JNIEXPORT void JNICALL
+Java_org_apache_subversion_javahl_SVNClient_propertySetLocal
+(JNIEnv *env, jobject jthis, jobject jtargets, jstring jname,
+ jbyteArray jvalue, jobject jdepth, jobject jchangelists, jboolean jforce)
+{
+  JNIEntry(SVNClient, propertySet);
+  SVNClient *cl = SVNClient::getCppObject(jthis);
+  if (cl == NULL)
+    {
+      JNIUtil::throwError(_("bad C++ this"));
+      return;
+    }
+  StringArray targetsArr(jtargets);
+  Targets targets(targetsArr);
   if (JNIUtil::isExceptionThrown())
     return;
 
-  CommitCallback callback(jcallback);
-  cl->propertySet(targets, name, value, EnumMapper::toDepth(jdepth),
-                  changelists,
-                  jforce ? true:false, revprops, jcallback ? &callback : NULL);
+  JNIStringHolder name(jname);
+  if (JNIUtil::isExceptionThrown())
+    return;
+
+  JNIByteArray value(jvalue);
+  if (JNIUtil::isExceptionThrown())
+    return;
+
+  StringArray changelists(jchangelists);
+  if (JNIUtil::isExceptionThrown())
+    return;
+
+  cl->propertySetLocal(targets, name, value, EnumMapper::toDepth(jdepth),
+                       changelists, jforce ? true:false);
 }
 
 JNIEXPORT jbyteArray JNICALL

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=1095825&r1=1095824&r2=1095825&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
 Thu Apr 21 21:37:54 2011
@@ -644,9 +644,14 @@ public interface ISVNClient
      *                     results in a commit.
      * @throws ClientException
      */
-    void propertySet(Set<String> paths, String name, byte[] value, Depth depth,
-                     Collection<String> changelists, boolean force,
-                     Map<String, String> revpropTable, CommitCallback callback)
+    void propertySetLocal(Set<String> paths, String name, byte[] value,
+                          Depth depth, Collection<String> changelists,
+                          boolean force)
+            throws ClientException;
+
+    void propertySetRemote(String path, String name, byte[] value,
+                           boolean force, Map<String, String> revpropTable,
+                           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=1095825&r1=1095824&r2=1095825&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
 Thu Apr 21 21:37:54 2011
@@ -301,11 +301,16 @@ public class SVNClient implements ISVNCl
                                   ProplistCallback callback)
             throws ClientException;
 
-    public native void propertySet(Set<String> paths, String name, byte[] 
value,
-                                   Depth depth, Collection<String> changelists,
-                                   boolean force,
-                                   Map<String, String> revpropTable,
-                                   CommitCallback callback)
+    public native void propertySetLocal(Set<String> paths, String name,
+                                        byte[] value, Depth depth,
+                                        Collection<String> changelists,
+                                        boolean force)
+            throws ClientException;
+
+    public native void propertySetRemote(String path, String name, byte[] 
value,
+                                         boolean force,
+                                         Map<String, String> revpropTable,
+                                         CommitCallback callback)
             throws ClientException;
 
     public native byte[] revProperty(String path, String name, Revision rev)

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=1095825&r1=1095824&r2=1095825&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
 Thu Apr 21 21:37:54 2011
@@ -1870,15 +1870,23 @@ public class SVNClient implements SVNCli
     {
         try
         {
-            Set<String> paths = new HashSet<String>();
-            paths.add(path);
+            if (Path.isURL(path))
+            {
+                aSVNClient.propertySetRemote(path, name,
+                                       value == null ? null : value.getBytes(),
+                                       force, revpropTable, null);
+            }
+            else
+            {
+                Set<String> paths = new HashSet<String>();
+                paths.add(path);
 
-            aSVNClient.propertySet(paths, name,
+                aSVNClient.propertySetLocal(paths, name,
                                    value == null ? null : value.getBytes(),
                                    Depth.toADepth(depth),
                                    changelists == null ? null
-                                    : Arrays.asList(changelists),
-                                   force, revpropTable, null);
+                                    : Arrays.asList(changelists), force);
+            }
         }
         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=1095825&r1=1095824&r2=1095825&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
 Thu Apr 21 21:37:54 2011
@@ -1376,8 +1376,8 @@ public class BasicTests extends SVNTests
         // set a property on A/D/G/rho file
         pathSet.clear();
         pathSet.add(thisTest.getWCPath()+"/A/D/G/rho");
-        client.propertySet(pathSet, "abc", (new String("def")).getBytes(),
-                           Depth.infinity, null, false, null, null);
+        client.propertySetLocal(pathSet, "abc", (new String("def")).getBytes(),
+                                Depth.infinity, null, false);
         thisTest.getWc().setItemPropStatus("A/D/G/rho", Status.Kind.modified);
 
         // set a property on A/B/F directory
@@ -3948,8 +3948,9 @@ public class BasicTests extends SVNTests
         Set<String> paths = new HashSet<String>();
         paths.add(path);
 
-        client.propertySet(paths, name, value != null ? value.getBytes() : 
null,
-                           Depth.empty, null, false, null, null);
+        client.propertySetLocal(paths, name,
+                                value != null ? value.getBytes() : null,
+                                Depth.empty, null, false);
     }
 
     private void setprop(String path, String name, byte[] value)
@@ -3958,8 +3959,8 @@ public class BasicTests extends SVNTests
         Set<String> paths = new HashSet<String>();
         paths.add(path);
 
-        client.propertySet(paths, name, value, Depth.empty,
-                           null, false, null, null);
+        client.propertySetLocal(paths, name, value, Depth.empty,
+                                null, false);
     }
 
     private long commit(OneTest thisTest, String msg)


Reply via email to