subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1655279 - in /subversion/trunk/subversion/bindings/javahl: native/ src/org/apache/subversion/javahl/
Date Wed, 28 Jan 2015 12:30:49 GMT
Author: rhuijben
Date: Wed Jan 28 12:30:49 2015
New Revision: 1655279

URL: http://svn.apache.org/r1655279
Log:
Resolve issue #4475 "expose whitespace diff parameters for the javahl blame
method"

I would welcome a testcase for the new features :-)

* subversion/bindings/javahl/native/DiffOptions.cpp
  (DiffOptions::optionsArray): Add comment.
  (DiffOptions::fileOptions): New function.

* subversion/bindings/javahl/native/DiffOptions.h
  (includes): Add svn_diff.h.
  (DiffOptions::fileOptions): New function.

* subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp
  (Java_org_apache_subversion_javahl_SVNClient_blame): Add argument.

* subversion/bindings/javahl/native/SVNClient.cpp
  (SVNClient::blame): Add argument.

* subversion/bindings/javahl/native/SVNClient.h
  (SVNClient::blame): Add argument.

* subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java
* subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java
  (blame): Rev function (the java way) by adding override with more arguments
    and deprecating the old function.

Modified:
    subversion/trunk/subversion/bindings/javahl/native/DiffOptions.cpp
    subversion/trunk/subversion/bindings/javahl/native/DiffOptions.h
    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/DiffOptions.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/DiffOptions.cpp?rev=1655279&r1=1655278&r2=1655279&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/DiffOptions.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/DiffOptions.cpp Wed Jan 28 12:30:49
2015
@@ -71,5 +71,26 @@ apr_array_header_t *DiffOptions::options
   if (flags & SHOW_C_FUNCTION)
     APR_ARRAY_PUSH(opt, const char*) = "--show-c-function";
 
+  /* TODO: Support -U (context size) */
+
+  return opt;
+}
+
+svn_diff_file_options_t *DiffOptions::fileOptions(SVN::Pool &resultPool) const
+{
+  svn_diff_file_options_t *opt;
+
+  opt = svn_diff_file_options_create(resultPool.getPool());
+
+  if (flags & IGNORE_ALL_SPACE)
+    opt->ignore_space = svn_diff_file_ignore_space_all;
+  else if (flags & IGNORE_SPACE_CHANGE)
+    opt->ignore_eol_style = svn_diff_file_ignore_space_change;
+
+  if (flags & IGNORE_EOL_STYLE)
+    opt->ignore_eol_style = TRUE;
+
+  /* TODO: Support context size */
+
   return opt;
 }

Modified: subversion/trunk/subversion/bindings/javahl/native/DiffOptions.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/DiffOptions.h?rev=1655279&r1=1655278&r2=1655279&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/DiffOptions.h (original)
+++ subversion/trunk/subversion/bindings/javahl/native/DiffOptions.h Wed Jan 28 12:30:49 2015
@@ -29,6 +29,7 @@
 
 #include <apr_tables.h>
 #include "svn_types.h"
+#include "svn_diff.h"
 #include "Pool.h"
 #include "JNIUtil.h"
 
@@ -38,6 +39,7 @@ class DiffOptions
   DiffOptions(jobject joptions);
 
   apr_array_header_t *optionsArray(SVN::Pool &resultPool) const;
+  svn_diff_file_options_t *fileOptions(SVN::Pool &resultPool) const;
 
   svn_boolean_t useGitDiffFormat() const
   {

Modified: subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp?rev=1655279&r1=1655278&r2=1655279&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp Wed Jan 28 12:30:49 2015
@@ -1184,7 +1184,7 @@ void SVNClient::relocate(const char *fro
 void SVNClient::blame(const char *path, Revision &pegRevision,
                       Revision &revisionStart, Revision &revisionEnd,
                       bool ignoreMimeType, bool includeMergedRevisions,
-                      BlameCallback *callback)
+                      BlameCallback *callback, DiffOptions const& options)
 {
     SVN::Pool subPool(pool);
     SVN_JNI_NULL_PTR_EX(path, "path", );
@@ -1198,7 +1198,7 @@ void SVNClient::blame(const char *path,
     SVN_JNI_ERR(svn_client_blame5(
           intPath.c_str(), pegRevision.revision(), revisionStart.revision(),
           revisionEnd.revision(),
-          svn_diff_file_options_create(subPool.getPool()), ignoreMimeType,
+          options.fileOptions(subPool), ignoreMimeType,
           includeMergedRevisions, BlameCallback::callback, callback, ctx,
           subPool.getPool()),
         );

Modified: subversion/trunk/subversion/bindings/javahl/native/SVNClient.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/SVNClient.h?rev=1655279&r1=1655278&r2=1655279&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/SVNClient.h (original)
+++ subversion/trunk/subversion/bindings/javahl/native/SVNClient.h Wed Jan 28 12:30:49 2015
@@ -82,7 +82,7 @@ class SVNClient :public SVNBase
   void blame(const char *path, Revision &pegRevision,
              Revision &revisionStart, Revision &revisionEnd,
              bool ignoreMimeType, bool includeMergedRevisions,
-             BlameCallback *callback);
+             BlameCallback *callback, DiffOptions const& options);
   void relocate(const char *from, const char *to, const char *path,
                 bool ignoreExternals);
   apr_hash_t *streamFileContent(const char *path,

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=1655279&r1=1655278&r2=1655279&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 Jan 28 12:30:49 2015
@@ -1646,7 +1646,8 @@ JNIEXPORT void JNICALL
 Java_org_apache_subversion_javahl_SVNClient_blame
 (JNIEnv *env, jobject jthis, jstring jpath, jobject jpegRevision,
  jobject jrevisionStart, jobject jrevisionEnd, jboolean jignoreMimeType,
- jboolean jincludeMergedRevisions, jobject jblameCallback)
+ jboolean jincludeMergedRevisions, jobject jblameCallback,
+ jobject jdiffOptions)
 {
   JNIEntry(SVNClient, blame);
   SVNClient *cl = SVNClient::getCppObject(jthis);
@@ -1671,10 +1672,15 @@ Java_org_apache_subversion_javahl_SVNCli
   if (JNIUtil::isExceptionThrown())
     return;
 
+  DiffOptions options(jdiffOptions);
+  if (JNIUtil::isExceptionThrown())
+    return;
+
   BlameCallback callback(jblameCallback);
   cl->blame(path, pegRevision, revisionStart, revisionEnd,
             jignoreMimeType ? true : false,
-            jincludeMergedRevisions ? true : false, &callback);
+            jincludeMergedRevisions ? true : false, &callback,
+            options);
 }
 
 JNIEXPORT void 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=1655279&r1=1655278&r2=1655279&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 Jan 28 12:30:49 2015
@@ -1323,12 +1323,29 @@ public interface ISVNClient
      *                      information
      * @param callback      callback to receive the file content and the other
      *                      information
+     * @param options       additional options for controlling the output
      * @throws ClientException
+     * @since 1.9
      */
     void blame(String path, Revision pegRevision, Revision revisionStart,
                Revision revisionEnd, boolean ignoreMimeType,
                boolean includeMergedRevisions,
-               BlameCallback callback) throws ClientException;
+               BlameCallback callback, DiffOptions options)
+            throws ClientException;
+
+    /**
+     * Retrieve the content together with the author, the revision and the date
+     * of the last change of each line
+     * <p>
+     * Behaves like the 1.9 version with options set to their default values.
+     * @deprecated
+     */
+    @Deprecated
+    void blame(String path, Revision pegRevision, Revision revisionStart,
+               Revision revisionEnd, boolean ignoreMimeType,
+               boolean includeMergedRevisions,
+               BlameCallback callback)
+            throws ClientException;
 
     /**
      * Set directory for the configuration information, taking the

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=1655279&r1=1655278&r2=1655279&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 Jan 28 12:30:49 2015
@@ -651,11 +651,27 @@ public class SVNClient implements ISVNCl
                                 boolean ignoreExternals)
             throws ClientException;
 
+    /**
+      * @deprecated
+      */
+    @Deprecated
+    public void blame(String path, Revision pegRevision,
+                       Revision revisionStart,
+                       Revision revisionEnd, boolean ignoreMimeType,
+                       boolean includeMergedRevisions,
+                       BlameCallback callback)
+            throws ClientException
+    {
+        blame(path, pegRevision, revisionStart, revisionEnd, ignoreMimeType,
+              includeMergedRevisions, callback, null);
+    }
+
     public native void blame(String path, Revision pegRevision,
-                             Revision revisionStart,
-                             Revision revisionEnd, boolean ignoreMimeType,
-                             boolean includeMergedRevisions,
-                             BlameCallback callback)
+                               Revision revisionStart,
+                               Revision revisionEnd, boolean ignoreMimeType,
+                               boolean includeMergedRevisions,
+                               BlameCallback callback,
+                               DiffOptions options)
             throws ClientException;
 
     public native void setConfigDirectory(String configDir)



Mime
View raw message