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 2012/10/17 03:19:22 UTC

svn commit: r1399064 - in /subversion/trunk/subversion/bindings/javahl: native/ src/org/apache/subversion/javahl/

Author: hwright
Date: Wed Oct 17 01:19:21 2012
New Revision: 1399064

URL: http://svn.apache.org/viewvc?rev=1399064&view=rev
Log:
JavaHL: Punch additional changelist parameter for property fetching to
the Java layer.

[ in subversion/bindings/javahl/ ]
* native/SVNClient.cpp,
  native/SVNClient.h
  (SVNClient::propertyGet): Add changelists param.

* native/org_apache_subversion_javahl_SVNClient.cpp
  (Java_org_apache_subversion_javahl_SVNClient_propertyGet):
    Add changelists param, pass to C++ layer.

* src/org/apache/subversion/javahl/ISVNClient.java,
  src/org/apache/subversion/javahl/SVNClient.java
  (propertyGet): Add overload to accept changelists param.

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

Modified: subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp?rev=1399064&r1=1399063&r2=1399064&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp Wed Oct 17 01:19:21 2012
@@ -816,7 +816,8 @@ void SVNClient::getMergeinfoLog(int type
  * Get a property.
  */
 jbyteArray SVNClient::propertyGet(const char *path, const char *name,
-                                  Revision &revision, Revision &pegRevision)
+                                  Revision &revision, Revision &pegRevision,
+                                  StringArray &changelists)
 {
     SVN::Pool subPool(pool);
     SVN_JNI_NULL_PTR_EX(path, "path", NULL);
@@ -829,11 +830,11 @@ jbyteArray SVNClient::propertyGet(const 
         return NULL;
 
     apr_hash_t *props;
-    SVN_JNI_ERR(svn_client_propget4(&props, name,
+    SVN_JNI_ERR(svn_client_propget5(&props, NULL, name,
                                     intPath.c_str(), pegRevision.revision(),
                                     revision.revision(), NULL, svn_depth_empty,
-                                    NULL, ctx, subPool.getPool(),
-                                    subPool.getPool()),
+                                    changelists.array(subPool), ctx,
+                                    subPool.getPool(), subPool.getPool()),
                 NULL);
 
     apr_hash_index_t *hi;

Modified: subversion/trunk/subversion/bindings/javahl/native/SVNClient.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/SVNClient.h?rev=1399064&r1=1399063&r2=1399064&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/SVNClient.h (original)
+++ subversion/trunk/subversion/bindings/javahl/native/SVNClient.h Wed Oct 17 01:19:21 2012
@@ -171,7 +171,8 @@ class SVNClient :public SVNBase
                          bool lastChanged);
   void upgrade(const char *path);
   jbyteArray propertyGet(const char *path, const char *name,
-                         Revision &revision, Revision &pegRevision);
+                         Revision &revision, Revision &pegRevision,
+                         StringArray &changelists);
   void diff(const char *target1, Revision &revision1,
             const char *target2, Revision &revision2,
             const char *relativeToDir, OutputStream &outputStream,

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=1399064&r1=1399063&r2=1399064&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 Wed Oct 17 01:19:21 2012
@@ -1080,7 +1080,7 @@ Java_org_apache_subversion_javahl_SVNCli
 JNIEXPORT jbyteArray JNICALL
 Java_org_apache_subversion_javahl_SVNClient_propertyGet
 (JNIEnv *env, jobject jthis, jstring jpath, jstring jname, jobject jrevision,
- jobject jpegRevision)
+ jobject jpegRevision, jobject jchangelists)
 {
   JNIEntry(SVNClient, propertyGet);
   SVNClient *cl = SVNClient::getCppObject(jthis);
@@ -1105,7 +1105,11 @@ Java_org_apache_subversion_javahl_SVNCli
   if (JNIUtil::isExceptionThrown())
     return NULL;
 
-  return cl->propertyGet(path, name, revision, pegRevision);
+  StringArray changelists(jchangelists);
+  if (JNIUtil::isExceptionThrown())
+    return NULL;
+
+  return cl->propertyGet(path, name, revision, pegRevision, changelists);
 }
 
 JNIEXPORT jobject 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=1399064&r1=1399063&r2=1399064&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 Oct 17 01:19:21 2012
@@ -719,6 +719,10 @@ public interface ISVNClient
      * @throws ClientException
      */
     byte[] propertyGet(String path, String name, Revision revision,
+                       Revision pegRevision, Collection<String> changelists)
+            throws ClientException;
+
+    byte[] propertyGet(String path, String name, Revision revision,
                        Revision pegRevision)
             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=1399064&r1=1399063&r2=1399064&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 Oct 17 01:19:21 2012
@@ -366,8 +366,16 @@ public class SVNClient implements ISVNCl
                                       boolean force)
             throws ClientException;
 
+    public byte[] propertyGet(String path, String name,
+                              Revision revision, Revision pegRevision)
+            throws ClientException
+    {
+        return propertyGet(path, name, revision, pegRevision, null);
+    }
+
     public native byte[] propertyGet(String path, String name,
-                                     Revision revision, Revision pegRevision)
+                                     Revision revision, Revision pegRevision,
+                                     Collection<String> changelists)
             throws ClientException;
 
     public byte[] fileContent(String path, Revision revision,



Re: svn commit: r1399064 - in /subversion/trunk/subversion/bindings/javahl: native/ src/org/apache/subversion/javahl/

Posted by Mark Phippard <ma...@gmail.com>.
On Tue, Oct 16, 2012 at 9:44 PM, Hyrum K Wright <hy...@hyrumwright.org> wrote:

> Well, we have to return both the existing property *and* the inherited
> props.  I don't think a Map will meet those criteria.

I thought the API just returns all the props and it is up to the
caller to decide what to do with the info, such as using the closest
value, merging them etc.  So why couldn't you return a Map where the
key is the path where the property was found, and the value is the
property value or even the Property object if we want to return the
key and value?

In Subclipse, I would probably use this for the bugtraq properties.
Currently, we walk the tree in the WC looking for the property.  I
would expect to be able to just call the API for a path in the WC.  I
will then get back anywhere on that path or any of its parents where
this property is set.  In my case, I would use the closest value to
the path I specified when I called the API.

-- 
Thanks

Mark Phippard
http://markphip.blogspot.com/

Re: svn commit: r1399064 - in /subversion/trunk/subversion/bindings/javahl: native/ src/org/apache/subversion/javahl/

Posted by Hyrum K Wright <hy...@hyrumwright.org>.
On Tue, Oct 16, 2012 at 9:36 PM, Mark Phippard <ma...@gmail.com> wrote:
>>
>> On Oct 16, 2012, at 9:25 PM, "Hyrum Wright" <hw...@apache.org> wrote:
>>
>>> On Tue, Oct 16, 2012 at 9:19 PM,  <hw...@apache.org> wrote:
>>>> Author: hwright
>>>> Date: Wed Oct 17 01:19:21 2012
>>>> New Revision: 1399064
>>>>
>>>> URL: http://svn.apache.org/viewvc?rev=1399064&view=rev
>>>> Log:
>>>> JavaHL: Punch additional changelist parameter for property fetching to
>>>> the Java layer.
>>>>
>>>> [ in subversion/bindings/javahl/ ]
>>>> * native/SVNClient.cpp,
>>>>  native/SVNClient.h
>>>>  (SVNClient::propertyGet): Add changelists param.
>>>>
>>>> * native/org_apache_subversion_javahl_SVNClient.cpp
>>>>  (Java_org_apache_subversion_javahl_SVNClient_propertyGet):
>>>>    Add changelists param, pass to C++ layer.
>>>>
>>>> * src/org/apache/subversion/javahl/ISVNClient.java,
>>>>  src/org/apache/subversion/javahl/SVNClient.java
>>>>  (propertyGet): Add overload to accept changelists param.
>>>
>>> Mark,
>>> This revision doesn't provide a way to return the inherited props,
>>> which the underlying API does.  Right now the obvious method is a new
>>> return object which contains both the property and any inherited
>>> props, but I'd hate to create an object with just two fields.  Any
>>> other suggestions?
>
>
> How about returning a Map where the path is key?

Well, we have to return both the existing property *and* the inherited
props.  I don't think a Map will meet those criteria.

-Hyrum

Re: svn commit: r1399064 - in /subversion/trunk/subversion/bindings/javahl: native/ src/org/apache/subversion/javahl/

Posted by Mark Phippard <ma...@gmail.com>.
> 
> On Oct 16, 2012, at 9:25 PM, "Hyrum Wright" <hw...@apache.org> wrote:
> 
>> On Tue, Oct 16, 2012 at 9:19 PM,  <hw...@apache.org> wrote:
>>> Author: hwright
>>> Date: Wed Oct 17 01:19:21 2012
>>> New Revision: 1399064
>>> 
>>> URL: http://svn.apache.org/viewvc?rev=1399064&view=rev
>>> Log:
>>> JavaHL: Punch additional changelist parameter for property fetching to
>>> the Java layer.
>>> 
>>> [ in subversion/bindings/javahl/ ]
>>> * native/SVNClient.cpp,
>>>  native/SVNClient.h
>>>  (SVNClient::propertyGet): Add changelists param.
>>> 
>>> * native/org_apache_subversion_javahl_SVNClient.cpp
>>>  (Java_org_apache_subversion_javahl_SVNClient_propertyGet):
>>>    Add changelists param, pass to C++ layer.
>>> 
>>> * src/org/apache/subversion/javahl/ISVNClient.java,
>>>  src/org/apache/subversion/javahl/SVNClient.java
>>>  (propertyGet): Add overload to accept changelists param.
>> 
>> Mark,
>> This revision doesn't provide a way to return the inherited props,
>> which the underlying API does.  Right now the obvious method is a new
>> return object which contains both the property and any inherited
>> props, but I'd hate to create an object with just two fields.  Any
>> other suggestions?


How about returning a Map where the path is key?

Mark

Re: svn commit: r1399064 - in /subversion/trunk/subversion/bindings/javahl: native/ src/org/apache/subversion/javahl/

Posted by Hyrum Wright <hw...@apache.org>.
On Tue, Oct 16, 2012 at 9:19 PM,  <hw...@apache.org> wrote:
> Author: hwright
> Date: Wed Oct 17 01:19:21 2012
> New Revision: 1399064
>
> URL: http://svn.apache.org/viewvc?rev=1399064&view=rev
> Log:
> JavaHL: Punch additional changelist parameter for property fetching to
> the Java layer.
>
> [ in subversion/bindings/javahl/ ]
> * native/SVNClient.cpp,
>   native/SVNClient.h
>   (SVNClient::propertyGet): Add changelists param.
>
> * native/org_apache_subversion_javahl_SVNClient.cpp
>   (Java_org_apache_subversion_javahl_SVNClient_propertyGet):
>     Add changelists param, pass to C++ layer.
>
> * src/org/apache/subversion/javahl/ISVNClient.java,
>   src/org/apache/subversion/javahl/SVNClient.java
>   (propertyGet): Add overload to accept changelists param.

Mark,
This revision doesn't provide a way to return the inherited props,
which the underlying API does.  Right now the obvious method is a new
return object which contains both the property and any inherited
props, but I'd hate to create an object with just two fields.  Any
other suggestions?

-Hyrum