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 2011/04/19 23:08:49 UTC
svn commit: r1095215 - in /subversion/trunk/subversion/bindings/javahl:
native/ src/org/apache/subversion/javahl/ src/org/tigris/subversion/javahl/
tests/org/apache/subversion/javahl/
Author: hwright
Date: Tue Apr 19 21:08:49 2011
New Revision: 1095215
URL: http://svn.apache.org/viewvc?rev=1095215&view=rev
Log:
Fix the JavaHL bindings after r1095195.
[ in subversion/bindings/javahl/ ]
* tests/org/apache/subversion/javahl/BasicTests.java:
Update callers.
* native/SVNClient.h
(propertySet): Change the single path argument to a Targets reference.
* native/SVNClient.cpp
(propertySet): Accept a Targets reference, and use that to call the
underlying C API.
* native/org_apache_subversion_javahl_SVNClient.cpp
(Java_org_apache_subversion_javahl_SVNClient_propertySet): Adjust signature,
and create the Targets object for use down the stack.
* src/org/apache/subversion/javahl/SVNClient.java
(propertySet): Accept a Set of Strings for the paths.
* src/org/apache/subversion/javahl/ISVNClient.java
(propertySet): Same.
* src/org/tigris/subversion/javahl/SVNClient.java
(propertySet): Update wrapper.
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=1095215&r1=1095214&r2=1095215&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp Tue Apr 19 21:08:49 2011
@@ -873,13 +873,12 @@ void SVNClient::properties(const char *p
return;
}
-void SVNClient::propertySet(const char *path, const char *name,
+void SVNClient::propertySet(Targets &targets, const char *name,
JNIByteArray &value, svn_depth_t depth,
StringArray &changelists, bool force,
RevpropTable &revprops, CommitCallback *callback)
{
SVN::Pool requestPool;
- SVN_JNI_NULL_PTR_EX(path, "path", );
SVN_JNI_NULL_PTR_EX(name, "name", );
svn_string_t *val;
@@ -889,14 +888,12 @@ void SVNClient::propertySet(const char *
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_propset4(name, val, intPath.c_str(),
+ 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),
Modified: subversion/trunk/subversion/bindings/javahl/native/SVNClient.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/SVNClient.h?rev=1095215&r1=1095214&r2=1095215&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/SVNClient.h (original)
+++ subversion/trunk/subversion/bindings/javahl/native/SVNClient.h Tue Apr 19 21:08:49 2011
@@ -78,7 +78,7 @@ class SVNClient :public SVNBase
bool ignoreExternals);
void streamFileContent(const char *path, Revision &revision,
Revision &pegRevision, OutputStream &outputStream);
- void propertySet(const char *path, const char *name, JNIByteArray &value,
+ void propertySet(Targets &targets, const char *name, JNIByteArray &value,
svn_depth_t depth, StringArray &changelists, bool force,
RevpropTable &revprops, CommitCallback *callback);
void properties(const char *path, Revision &revision,
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=1095215&r1=1095214&r2=1095215&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 Tue Apr 19 21:08:49 2011
@@ -917,7 +917,7 @@ Java_org_apache_subversion_javahl_SVNCli
JNIEXPORT void JNICALL
Java_org_apache_subversion_javahl_SVNClient_propertySet
-(JNIEnv *env, jobject jthis, jstring jpath, jstring jname, jbyteArray jvalue,
+(JNIEnv *env, jobject jthis, jobject jtargets, jstring jname, jbyteArray jvalue,
jobject jdepth, jobject jchangelists, jboolean jforce, jobject jrevpropTable,
jobject jcallback)
{
@@ -928,7 +928,8 @@ Java_org_apache_subversion_javahl_SVNCli
JNIUtil::throwError(_("bad C++ this"));
return;
}
- JNIStringHolder path(jpath);
+ StringArray targetsArr(jtargets);
+ Targets targets(targetsArr);
if (JNIUtil::isExceptionThrown())
return;
@@ -949,7 +950,8 @@ Java_org_apache_subversion_javahl_SVNCli
return;
CommitCallback callback(jcallback);
- cl->propertySet(path, name, value, EnumMapper::toDepth(jdepth), changelists,
+ cl->propertySet(targets, name, value, EnumMapper::toDepth(jdepth),
+ changelists,
jforce ? true:false, 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=1095215&r1=1095214&r2=1095215&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 Tue Apr 19 21:08:49 2011
@@ -666,7 +666,7 @@ public interface ISVNClient
/**
* Sets one property of an item with a String value
*
- * @param path path of the item
+ * @param paths paths of the items
* @param name name of the property
* @param value new value of the property
* @param depth the depth to recurse into subdirectories
@@ -678,7 +678,7 @@ public interface ISVNClient
* @throws ClientException
* @since 1.5
*/
- void propertySet(String path, String name, byte[] value, Depth depth,
+ void propertySet(Set<String> paths, String name, byte[] value, Depth depth,
Collection<String> changelists, 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=1095215&r1=1095214&r2=1095215&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 Tue Apr 19 21:08:49 2011
@@ -416,7 +416,7 @@ public class SVNClient implements ISVNCl
/**
* @since 1.5
*/
- public native void propertySet(String path, String name, byte[] value,
+ public native void propertySet(Set<String> paths, String name, byte[] value,
Depth depth, Collection<String> changelists,
boolean force,
Map<String, String> revpropTable,
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=1095215&r1=1095214&r2=1095215&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 Tue Apr 19 21:08:49 2011
@@ -1870,7 +1870,10 @@ public class SVNClient implements SVNCli
{
try
{
- aSVNClient.propertySet(path, name,
+ Set<String> paths = new HashSet<String>();
+ paths.add(path);
+
+ aSVNClient.propertySet(paths, name,
value == null ? null : value.getBytes(),
Depth.toADepth(depth),
changelists == null ? null
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=1095215&r1=1095214&r2=1095215&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 Tue Apr 19 21:08:49 2011
@@ -1374,8 +1374,9 @@ public class BasicTests extends SVNTests
thisTest.getWc().setItemTextStatus("A/D/H/chi", Status.Kind.modified);
// set a property on A/D/G/rho file
- client.propertySet(thisTest.getWCPath()+"/A/D/G/rho", "abc",
- (new String("def")).getBytes(),
+ pathSet.clear();
+ pathSet.add(thisTest.getWCPath()+"/A/D/G/rho");
+ client.propertySet(pathSet, "abc", (new String("def")).getBytes(),
Depth.infinity, null, false, null, null);
thisTest.getWc().setItemPropStatus("A/D/G/rho", Status.Kind.modified);
@@ -3944,14 +3945,20 @@ public class BasicTests extends SVNTests
private void setprop(String path, String name, String value)
throws ClientException
{
- client.propertySet(path, name, value != null ? value.getBytes() : null,
+ Set<String> paths = new HashSet<String>();
+ paths.add(path);
+
+ client.propertySet(paths, name, value != null ? value.getBytes() : null,
Depth.empty, null, false, null, null);
}
private void setprop(String path, String name, byte[] value)
throws ClientException
{
- client.propertySet(path, name, value, Depth.empty,
+ Set<String> paths = new HashSet<String>();
+ paths.add(path);
+
+ client.propertySet(paths, name, value, Depth.empty,
null, false, null, null);
}