subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1603352 - in /subversion/trunk/subversion/bindings/javahl: native/SVNRepos.cpp native/SVNRepos.h native/org_apache_subversion_javahl_SVNRepos.cpp src/org/apache/subversion/javahl/ISVNRepos.java src/org/apache/subversion/javahl/SVNRepos.java
Date Wed, 18 Jun 2014 03:51:00 GMT
Author: brane
Date: Wed Jun 18 03:51:00 2014
New Revision: 1603352

URL: http://svn.apache.org/r1603352
Log:
Remove the use of some deprecated APIs from JavaHL.

[in subversion/bindings/javahl]
* src/org/apache/subversion/javahl/ISVNRepos.java,
  src/org/apache/subversion/javahl/SVNRepos.java
  (ISVNRepos.load): Add an overload that exposes the functionality
   of svn_repos_load_fs5.
  (ISVNRepos.verify): Likewise for svn_repos_verify_fs3

* native/SVNRepos.hpp
  (SVNRepos::verify, SVNRepos::load): Update prototypes.
* native/SVNRepos.cpp
  (SVNRepos::load): Update signature and use svn_repos_load_fs5 instead
   of svn_repos_load_fs4; and also use svn_repos_open3 instead of
   svn_repos_open2.
  (SVNRepos::verify): Update signature and use svn_repos_verify_fs3 instead
   of svn_repos_verify_fs2; and also use svn_repos_open3 instead of
   svn_repos_open2.
  (SVNRepos::deltify, SVNRepos::dump, SVNRepos::lstxns,
   SVNRepos::recover, SVNRepos::rmtxns, SVNRepos::setRevProp,
   SVNRepos::getRevnum, SVNRepos::pack, SVNRepos::lslocks,
   SVNRepos::rmlocks): Use svn_repos_open3 instea dof svn_repos_open2.

* native/org_apache_subversion_javahl_SVNRepos.cpp
  (Java_org_apache_subversion_javahl_SVNRepos_load,
   Java_org_apache_subversion_javahl_SVNRepos_verify): Update signatures
   and calls to the equivalent SVNRepos methods.

Modified:
    subversion/trunk/subversion/bindings/javahl/native/SVNRepos.cpp
    subversion/trunk/subversion/bindings/javahl/native/SVNRepos.h
    subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNRepos.cpp
    subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNRepos.java
    subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNRepos.java

Modified: subversion/trunk/subversion/bindings/javahl/native/SVNRepos.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/SVNRepos.cpp?rev=1603352&r1=1603351&r2=1603352&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/SVNRepos.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/SVNRepos.cpp Wed Jun 18 03:51:00 2014
@@ -124,8 +124,10 @@ void SVNRepos::deltify(File &path, Revis
       return;
     }
 
-  SVN_JNI_ERR(svn_repos_open2(&repos, path.getInternalStyle(requestPool),
-                              NULL, requestPool.getPool()), );
+  SVN_JNI_ERR(svn_repos_open3(&repos,
+                              path.getInternalStyle(requestPool), NULL,
+                              requestPool.getPool(),
+                              requestPool.getPool()), );
   fs = svn_repos_fs(repos);
   SVN_JNI_ERR(svn_fs_youngest_rev(&youngest, fs, requestPool.getPool()), );
 
@@ -193,8 +195,9 @@ void SVNRepos::dump(File &path, OutputSt
       return;
     }
 
-  SVN_JNI_ERR(svn_repos_open2(&repos, path.getInternalStyle(requestPool),
-                              NULL, requestPool.getPool()), );
+  SVN_JNI_ERR(svn_repos_open3(&repos,
+                              path.getInternalStyle(requestPool), NULL,
+                              requestPool.getPool(), requestPool.getPool()), );
   fs = svn_repos_fs(repos);
   SVN_JNI_ERR(svn_fs_youngest_rev(&youngest, fs, requestPool.getPool()), );
 
@@ -321,6 +324,8 @@ void SVNRepos::load(File &path,
                     bool forceUUID,
                     bool usePreCommitHook,
                     bool usePostCommitHook,
+                    bool validateProps,
+                    bool ignoreDates,
                     const char *relativePath,
                     ReposNotifyCallback *notifyCallback)
 {
@@ -353,13 +358,14 @@ void SVNRepos::load(File &path,
                    _("First revision cannot be higher than second")), );
     }
 
-  SVN_JNI_ERR(svn_repos_open2(&repos, path.getInternalStyle(requestPool),
-                              NULL, requestPool.getPool()), );
+  SVN_JNI_ERR(svn_repos_open3(&repos,
+                              path.getInternalStyle(requestPool), NULL,
+                              requestPool.getPool(), requestPool.getPool()), );
 
-  SVN_JNI_ERR(svn_repos_load_fs4(repos, dataIn.getStream(requestPool),
+  SVN_JNI_ERR(svn_repos_load_fs5(repos, dataIn.getStream(requestPool),
                                  lower, upper, uuid_action, relativePath,
                                  usePreCommitHook, usePostCommitHook,
-                                 FALSE,
+                                 validateProps, ignoreDates,
                                  notifyCallback != NULL
                                     ? ReposNotifyCallback::notify
                                     : NULL,
@@ -380,8 +386,9 @@ void SVNRepos::lstxns(File &path, Messag
       return;
     }
 
-  SVN_JNI_ERR(svn_repos_open2(&repos, path.getInternalStyle(requestPool),
-                              NULL, requestPool.getPool()), );
+  SVN_JNI_ERR(svn_repos_open3(&repos,
+                              path.getInternalStyle(requestPool), NULL,
+                              requestPool.getPool(), requestPool.getPool()), );
   fs = svn_repos_fs(repos);
   SVN_JNI_ERR(svn_fs_list_transactions(&txns, fs, requestPool.getPool()), );
 
@@ -417,8 +424,9 @@ jlong SVNRepos::recover(File &path, Repo
   /* Since db transactions may have been replayed, it's nice to tell
    * people what the latest revision is.  It also proves that the
    * recovery actually worked. */
-  SVN_JNI_ERR(svn_repos_open2(&repos, path.getInternalStyle(requestPool),
-                              NULL, requestPool.getPool()), -1);
+  SVN_JNI_ERR(svn_repos_open3(&repos,
+                              path.getInternalStyle(requestPool), NULL,
+                              requestPool.getPool(), requestPool.getPool()), -1);
   SVN_JNI_ERR(svn_fs_youngest_rev(&youngest_rev, svn_repos_fs(repos),
                                   requestPool.getPool()),
               -1);
@@ -463,8 +471,9 @@ void SVNRepos::rmtxns(File &path, String
       return;
     }
 
-  SVN_JNI_ERR(svn_repos_open2(&repos, path.getInternalStyle(requestPool),
-                              NULL, requestPool.getPool()), );
+  SVN_JNI_ERR(svn_repos_open3(&repos,
+                              path.getInternalStyle(requestPool), NULL,
+                              requestPool.getPool(), requestPool.getPool()), );
   fs = svn_repos_fs(repos);
 
   args = transactions.array(requestPool);
@@ -520,8 +529,9 @@ void SVNRepos::setRevProp(File &path, Re
 
   /* Open the filesystem. */
   svn_repos_t *repos;
-  SVN_JNI_ERR(svn_repos_open2(&repos, path.getInternalStyle(requestPool),
-                              NULL, requestPool.getPool()), );
+  SVN_JNI_ERR(svn_repos_open3(&repos,
+                              path.getInternalStyle(requestPool), NULL,
+                              requestPool.getPool(), requestPool.getPool()), );
 
   /* If we are bypassing the hooks system, we just hit the filesystem
    * directly. */
@@ -579,6 +589,7 @@ SVNRepos::getRevnum(svn_revnum_t *revnum
 
 void
 SVNRepos::verify(File &path, Revision &revisionStart, Revision &revisionEnd,
+                 bool keepGoing, bool checkNormalization, bool metadataOnly,
                  ReposNotifyCallback *notifyCallback)
 {
   SVN::Pool requestPool;
@@ -594,8 +605,9 @@ SVNRepos::verify(File &path, Revision &r
 
   /* This whole process is basically just a dump of the repository
    * with no interest in the output. */
-  SVN_JNI_ERR(svn_repos_open2(&repos, path.getInternalStyle(requestPool),
-                              NULL, requestPool.getPool()), );
+  SVN_JNI_ERR(svn_repos_open3(&repos,
+                              path.getInternalStyle(requestPool), NULL,
+                              requestPool.getPool(), requestPool.getPool()), );
   SVN_JNI_ERR(svn_fs_youngest_rev(&youngest, svn_repos_fs(repos),
                                   requestPool.getPool()), );
 
@@ -621,7 +633,10 @@ SVNRepos::verify(File &path, Revision &r
       (SVN_ERR_INCORRECT_PARAMS, NULL,
        _("Start revision cannot be higher than end revision")), );
 
-  SVN_JNI_ERR(svn_repos_verify_fs2(repos, lower, upper,
+  SVN_JNI_ERR(svn_repos_verify_fs3(repos, lower, upper,
+                                   keepGoing,
+                                   checkNormalization,
+                                   metadataOnly,
                                    notifyCallback != NULL
                                     ? ReposNotifyCallback::notify
                                     : NULL,
@@ -641,8 +656,9 @@ void SVNRepos::pack(File &path, ReposNot
       return;
     }
 
-  SVN_JNI_ERR(svn_repos_open2(&repos, path.getInternalStyle(requestPool),
-                              NULL, requestPool.getPool()), );
+  SVN_JNI_ERR(svn_repos_open3(&repos,
+                              path.getInternalStyle(requestPool), NULL,
+                              requestPool.getPool(), requestPool.getPool()), );
 
   SVN_JNI_ERR(svn_repos_fs_pack2(repos,
                                  notifyCallback != NULL
@@ -686,8 +702,9 @@ jobject SVNRepos::lslocks(File &path, sv
       return NULL;
     }
 
-  SVN_JNI_ERR(svn_repos_open2(&repos, path.getInternalStyle(requestPool),
-                              NULL, requestPool.getPool()), NULL);
+  SVN_JNI_ERR(svn_repos_open3(&repos,
+                              path.getInternalStyle(requestPool), NULL,
+                              requestPool.getPool(), requestPool.getPool()), NULL);
   /* Fetch all locks on or below the root directory. */
   SVN_JNI_ERR(svn_repos_fs_get_locks2(&locks, repos, "/", depth, NULL, NULL,
                                       requestPool.getPool()),
@@ -730,8 +747,9 @@ void SVNRepos::rmlocks(File &path, Strin
       return;
     }
 
-  SVN_JNI_ERR(svn_repos_open2(&repos, path.getInternalStyle(requestPool),
-                              NULL, requestPool.getPool()), );
+  SVN_JNI_ERR(svn_repos_open3(&repos,
+                              path.getInternalStyle(requestPool), NULL,
+                              requestPool.getPool(), requestPool.getPool()), );
   fs = svn_repos_fs(repos);
   const char *username = NULL;
 

Modified: subversion/trunk/subversion/bindings/javahl/native/SVNRepos.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/SVNRepos.h?rev=1603352&r1=1603351&r2=1603352&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/SVNRepos.h (original)
+++ subversion/trunk/subversion/bindings/javahl/native/SVNRepos.h Wed Jun 18 03:51:00 2014
@@ -45,6 +45,7 @@ class SVNRepos : public SVNBase
   void rmlocks(File &path, StringArray &locks);
   jobject lslocks(File &path, svn_depth_t depth);
   void verify(File &path, Revision &revisionStart, Revision &revisionEnd,
+              bool keepGoing, bool checkNormalization, bool metadataOnly,
               ReposNotifyCallback *notifyCallback);
   void setRevProp(File &path, Revision &revision,
                   const char *propName, const char *propValue,
@@ -58,6 +59,7 @@ class SVNRepos : public SVNBase
             Revision &revsionStart, Revision &revisionEnd,
             bool ignoreUUID, bool forceUUID,
             bool usePreCommitHook, bool usePostCommitHook,
+            bool validateProps, bool ignoreDates,
             const char *relativePath, ReposNotifyCallback *notifyCallback);
   void listUnusedDBLogs(File &path,
                         MessageReceiver &messageReceiver);

Modified: subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNRepos.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNRepos.cpp?rev=1603352&r1=1603351&r2=1603352&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNRepos.cpp
(original)
+++ subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNRepos.cpp
Wed Jun 18 03:51:00 2014
@@ -239,11 +239,13 @@ Java_org_apache_subversion_javahl_SVNRep
 }
 
 JNIEXPORT void JNICALL
-Java_org_apache_subversion_javahl_SVNRepos_load
-(JNIEnv *env, jobject jthis, jobject jpath, jobject jinputData,
- jobject jrevisionStart, jobject jrevisionEnd,
- jboolean jignoreUUID, jboolean jforceUUID, jboolean jusePreCommitHook,
- jboolean jusePostCommitHook, jstring jrelativePath, jobject jnotifyCallback)
+Java_org_apache_subversion_javahl_SVNRepos_load(
+    JNIEnv *env, jobject jthis, jobject jpath, jobject jinputData,
+    jobject jrevisionStart, jobject jrevisionEnd,
+    jboolean jignoreUUID, jboolean jforceUUID,
+    jboolean jusePreCommitHook, jboolean jusePostCommitHook,
+    jboolean jvalidateProps, jboolean jignoreDates,
+    jstring jrelativePath, jobject jnotifyCallback)
 {
   JNIEntry(SVNRepos, load);
   SVNRepos *cl = SVNRepos::getCppObject(jthis);
@@ -280,6 +282,8 @@ Java_org_apache_subversion_javahl_SVNRep
            jforceUUID ? true : false,
            jusePreCommitHook ? true : false,
            jusePostCommitHook ? true : false,
+           jvalidateProps ? true : false,
+           jignoreDates ? true : false,
            relativePath,
            (jnotifyCallback != NULL ? &notifyCallback : NULL));
 }
@@ -409,9 +413,11 @@ Java_org_apache_subversion_javahl_SVNRep
 }
 
 JNIEXPORT void JNICALL
-Java_org_apache_subversion_javahl_SVNRepos_verify
-(JNIEnv *env, jobject jthis, jobject jpath, jobject jrevisionStart,
- jobject jrevisionEnd, jobject jcallback)
+Java_org_apache_subversion_javahl_SVNRepos_verify(
+    JNIEnv *env, jobject jthis, jobject jpath,
+    jobject jrevisionStart, jobject jrevisionEnd,
+    jboolean jkeepGoing, jboolean jcheckNormalization, jboolean jmetadataOnly,
+    jobject jcallback)
 {
   JNIEntry(SVNRepos, verify);
   SVNRepos *cl = SVNRepos::getCppObject(jthis);
@@ -438,6 +444,7 @@ Java_org_apache_subversion_javahl_SVNRep
     return;
 
   cl->verify(path, revisionStart, revisionEnd,
+             jkeepGoing, jcheckNormalization, jmetadataOnly,
              jcallback != NULL ? &callback : NULL);
 }
 

Modified: subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNRepos.java
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNRepos.java?rev=1603352&r1=1603351&r2=1603352&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNRepos.java
(original)
+++ subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNRepos.java
Wed Jun 18 03:51:00 2014
@@ -149,6 +149,39 @@ public interface ISVNRepos {
 	 *                          stream
 	 * @param usePreCommitHook  use the pre-commit hook when processing commits
 	 * @param usePostCommitHook use the post-commit hook when processing commits
+         * @param validateProps     validate "svn:" revision and node properties
+         * @param ignoreDates       ignore revision datestamps in the dump stream
+	 * @param relativePath      the directory in the repository, where the data
+	 *                          in put optional.
+	 * @param callback          the target for processing messages
+	 * @throws ClientException  throw in case of problem
+         * @since 1.9
+	 */
+	public abstract void load(File path, InputStream dataInput,
+                                  Revision start, Revision end,
+                                  boolean ignoreUUID, boolean forceUUID,
+                                  boolean usePreCommitHook,
+                                  boolean usePostCommitHook,
+                                  boolean validateProps,
+                                  boolean ignoreDates,
+                                  String relativePath,
+                                  ReposNotifyCallback callback)
+        throws ClientException;
+
+	/**
+	 * Load the data of a dump into a repository.  Sets
+         * <code>validateProps</code> and <code>ignoreDates</code>
to
+         * <code>false</code>.
+         *
+	 * @param path              the path to the repository
+	 * @param dataInput         the data input source
+         * @param start             the first revision to load
+         * @param end               the last revision to load
+	 * @param ignoreUUID        ignore any UUID found in the input stream
+	 * @param forceUUID         set the repository UUID to any found in the
+	 *                          stream
+	 * @param usePreCommitHook  use the pre-commit hook when processing commits
+	 * @param usePostCommitHook use the post-commit hook when processing commits
 	 * @param relativePath      the directory in the repository, where the data
 	 *                          in put optional.
 	 * @param callback          the target for processing messages
@@ -258,7 +291,28 @@ public interface ISVNRepos {
 	 * @param path              the path to the repository
 	 * @param start             the first revision
 	 * @param end               the last revision
-     * @param callback          the callback to receive notifications
+         * @param keepGoing         continue verification even if a revision is bad
+         * @param checkNormalization report directory entry and mergeinfo name collisions
+         *                           caused by denormalized Unicode representations
+         * @param metadataOnly      check only metadata, not file contents
+         * @param callback          the callback to receive notifications
+	 * @throws ClientException If an error occurred.
+         * @since 1.9
+	 */
+	public abstract void verify(File path, Revision start, Revision end,
+                boolean keepGoing, boolean checkNormalization,
+                boolean metadataOnly,
+                ReposNotifyCallback callback)
+            throws ClientException;
+
+	/**
+	 * Verify the repository at <code>path</code> between revisions
+	 * <code>start</code> and <code>end</code>.
+	 *
+	 * @param path              the path to the repository
+	 * @param start             the first revision
+	 * @param end               the last revision
+         * @param callback          the callback to receive notifications
 	 * @throws ClientException If an error occurred.
 	 */
 	public abstract void verify(File path, Revision start, Revision end,

Modified: subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNRepos.java
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNRepos.java?rev=1603352&r1=1603351&r2=1603352&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNRepos.java
(original)
+++ subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNRepos.java
Wed Jun 18 03:51:00 2014
@@ -159,6 +159,18 @@ public class SVNRepos implements ISVNRep
             throws ClientException;
 
     public void load(File path, InputStream dataInput,
+                     Revision start, Revision end,
+                     boolean ignoreUUID, boolean forceUUID,
+                     boolean usePreCommitHook, boolean usePostCommitHook,
+                     String relativePath, ReposNotifyCallback callback)
+            throws ClientException
+    {
+        load(path, dataInput, start, end,
+             ignoreUUID, forceUUID, usePreCommitHook, usePostCommitHook,
+             false, false, relativePath, callback);
+    }
+
+    public void load(File path, InputStream dataInput,
                      boolean ignoreUUID, boolean forceUUID,
                      boolean usePreCommitHook, boolean usePostCommitHook,
                      String relativePath, ReposNotifyCallback callback)
@@ -166,13 +178,14 @@ public class SVNRepos implements ISVNRep
     {
         load(path, dataInput, Revision.START, Revision.HEAD,
              ignoreUUID, forceUUID, usePreCommitHook, usePostCommitHook,
-             relativePath, callback);
+             false, false, relativePath, callback);
     }
 
     public native void load(File path, InputStream dataInput,
                             Revision start, Revision end,
                             boolean ignoreUUID, boolean forceUUID,
                             boolean usePreCommitHook, boolean usePostCommitHook,
+                            boolean validateProps, boolean ignoreDates,
                             String relativePath, ReposNotifyCallback callback)
             throws ClientException;
 
@@ -221,7 +234,16 @@ public class SVNRepos implements ISVNRep
                                   boolean usePostRevPropChangeHook)
             throws SubversionException;
 
+    public void verify(File path, Revision start, Revision end,
+                       ReposNotifyCallback callback)
+            throws ClientException
+    {
+        verify(path, start, end, false, false, false, callback);
+    }
+
     public native void verify(File path, Revision start, Revision end,
+                              boolean keepGoing, boolean checkNormalization,
+                              boolean metadataOnly,
                               ReposNotifyCallback callback)
             throws ClientException;
 



Mime
View raw message