subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1497793 - in /subversion/branches/javahl-1.8-extensions: ./ subversion/bindings/javahl/ subversion/bindings/javahl/native/ subversion/bindings/javahl/src/org/apache/subversion/javahl/ subversion/bindings/javahl/src/org/apache/subversion/ja...
Date Fri, 28 Jun 2013 14:36:53 GMT
Author: brane
Date: Fri Jun 28 14:36:53 2013
New Revision: 1497793

URL: http://svn.apache.org/r1497793
Log:
On the javahl-1.8-extensions branch: Sync JavaHL with trunk up to r1497790.

Added:
    subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/org_apache_subversion_javahl_ConfigImpl_Category.cpp
      - copied unchanged from r1497790, subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_ConfigImpl_Category.cpp
    subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/src/org/apache/subversion/javahl/ConfigImpl.java
      - copied unchanged from r1497790, subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ConfigImpl.java
    subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNConfig.java
      - copied unchanged from r1497790, subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNConfig.java
    subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/ConfigEvent.java
      - copied unchanged from r1497790, subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/ConfigEvent.java
Modified:
    subversion/branches/javahl-1.8-extensions/build.conf
    subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/   (props changed)
    subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/EnumMapper.cpp
    subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/EnumMapper.h
    subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/JNIStringHolder.h
    subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/OperationContext.cpp
    subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/OperationContext.h
    subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/RemoteSession.cpp
    subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/RemoteSession.h
    subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/RemoteSessionContext.cpp
    subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/RemoteSessionContext.h
    subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/SVNClient.cpp
    subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp
    subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/org_apache_subversion_javahl_remote_RemoteFactory.cpp
    subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/org_apache_subversion_javahl_remote_RemoteSession.cpp
    subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java
    subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNRemote.java
    subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java
    subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/src/org/apache/subversion/javahl/remote/RemoteFactory.java
    subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/src/org/apache/subversion/javahl/remote/RemoteSession.java
    subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java

Modified: subversion/branches/javahl-1.8-extensions/build.conf
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/build.conf?rev=1497793&r1=1497792&r2=1497793&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/build.conf (original)
+++ subversion/branches/javahl-1.8-extensions/build.conf Fri Jun 28 14:36:53 2013
@@ -67,6 +67,7 @@ private-built-includes =
         subversion/bindings/javahl/include/org_apache_subversion_javahl_remote_RemoteSession.h
         subversion/bindings/javahl/include/org_apache_subversion_javahl_remote_RemoteFactory.h
         subversion/bindings/javahl/include/org_apache_subversion_javahl_remote_CommitEditor.h
+        subversion/bindings/javahl/include/org_apache_subversion_javahl_ConfigImpl_Category.h
 
 test-scripts =
         subversion/tests/cmdline/*_tests.py

Propchange: subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/
------------------------------------------------------------------------------
  Merged /subversion/trunk/subversion/bindings/javahl:r1497366-1497790

Modified: subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/EnumMapper.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/EnumMapper.cpp?rev=1497793&r1=1497792&r2=1497793&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/EnumMapper.cpp
(original)
+++ subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/EnumMapper.cpp
Fri Jun 28 14:36:53 2013
@@ -203,6 +203,16 @@ svn_checksum_kind_t EnumMapper::toChecks
       getOrdinal(JAVA_PACKAGE"/types/Checksum$Kind", jChecksumKind));
 }
 
+svn_tristate_t EnumMapper::toTristate(jobject jTristate)
+{
+  switch (getOrdinal(JAVA_PACKAGE"/types/Tristate", jTristate))
+    {
+    case 1: return svn_tristate_false;
+    case 2: return svn_tristate_true;
+    default: return svn_tristate_unknown;
+    }
+}
+
 svn_depth_t EnumMapper::toDepth(jobject jdepth)
 {
   // The offset for depths is -2

Modified: subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/EnumMapper.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/EnumMapper.h?rev=1497793&r1=1497792&r2=1497793&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/EnumMapper.h
(original)
+++ subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/EnumMapper.h
Fri Jun 28 14:36:53 2013
@@ -50,6 +50,7 @@ class EnumMapper
   static int toLogLevel(jobject jLogLevel);
   static svn_node_kind_t toNodeKind(jobject jNodeKind);
   static svn_checksum_kind_t toChecksumKind(jobject jChecksumKind);
+  static svn_tristate_t toTristate(jobject jTristate);
 
   /* Converting from C enum's */
   static jint mapCommitMessageStateFlags(apr_byte_t flags);

Modified: subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/JNIStringHolder.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/JNIStringHolder.h?rev=1497793&r1=1497792&r2=1497793&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/JNIStringHolder.h
(original)
+++ subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/JNIStringHolder.h
Fri Jun 28 14:36:53 2013
@@ -36,6 +36,7 @@ class JNIStringHolder
   JNIStringHolder(jstring jtext);
   ~JNIStringHolder();
   operator const char *() { return m_str; }
+  const char* c_str() const { return m_str; }
   const char *pstrdup(apr_pool_t *pool);
 
  protected:

Modified: subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/OperationContext.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/OperationContext.cpp?rev=1497793&r1=1497792&r2=1497793&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/OperationContext.cpp
(original)
+++ subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/OperationContext.cpp
Fri Jun 28 14:36:53 2013
@@ -42,7 +42,8 @@ OperationContext::OperationContext(SVN::
     m_prompter(NULL),
     m_cancelOperation(0),
     m_pool(&pool),
-    m_jctx(NULL)
+    m_jctx(NULL),
+    m_jcfgcb(NULL)
 {}
 
 void
@@ -84,6 +85,8 @@ OperationContext::~OperationContext()
 
   JNIEnv *env = JNIUtil::getEnv();
   env->DeleteGlobalRef(m_jctx);
+  if (m_jcfgcb)
+    env->DeleteGlobalRef(m_jcfgcb);
 }
 
 apr_hash_t *
@@ -101,6 +104,7 @@ OperationContext::getConfigData()
         configDir = NULL;
       SVN_JNI_ERR(
           svn_config_get_config(&m_config, configDir, m_pool->getPool()), NULL);
+      notifyConfigLoad();
     }
 
   return m_config;
@@ -250,12 +254,34 @@ OperationContext::setConfigDirectory(con
   m_config = NULL;
 }
 
+void
+OperationContext::setConfigCallback(jobject configCallback)
+{
+  JNIEnv* env = JNIUtil::getEnv();
+
+  if (m_jcfgcb)
+    {
+      env->DeleteGlobalRef(m_jcfgcb);
+      m_jcfgcb = NULL;
+    }
+  if (configCallback)
+    {
+      m_jcfgcb = env->NewGlobalRef(configCallback);
+      env->DeleteLocalRef(configCallback);
+    }
+}
+
 const char *
 OperationContext::getConfigDirectory() const
 {
   return (m_configDir.empty() ? NULL : m_configDir.c_str());
 }
 
+jobject OperationContext::getConfigCallback() const
+{
+  return m_jcfgcb;
+}
+
 const char *
 OperationContext::getUsername() const
 {
@@ -364,3 +390,54 @@ OperationContext::clientName(void *baton
 
   return SVN_NO_ERROR;
 }
+
+void
+OperationContext::notifyConfigLoad()
+{
+  if (!m_jcfgcb)
+    return;
+
+  JNIEnv *env = JNIUtil::getEnv();
+
+  static jmethodID onload_mid = 0;
+  if (0 == onload_mid)
+    {
+      jclass cls = env->FindClass(JAVA_PACKAGE"/callback/ConfigEvent");
+      if (JNIUtil::isJavaExceptionThrown())
+        return;
+      onload_mid = env->GetMethodID(cls, "onLoad",
+                                    "(L"JAVA_PACKAGE"/ISVNConfig;)V");
+      if (JNIUtil::isJavaExceptionThrown())
+        return;
+    }
+
+  jclass cfg_cls = env->FindClass(JAVA_PACKAGE"/ConfigImpl");
+  if (JNIUtil::isJavaExceptionThrown())
+    return;
+
+  static jmethodID ctor_mid = 0;
+  if (0 == ctor_mid)
+    {
+      ctor_mid = env->GetMethodID(cfg_cls, "<init>", "(J)V");
+      if (JNIUtil::isJavaExceptionThrown())
+        return;
+    }
+
+  static jmethodID dispose_mid = 0;
+  if (0 == dispose_mid)
+    {
+      dispose_mid = env->GetMethodID(cfg_cls, "dispose", "()V");
+      if (JNIUtil::isJavaExceptionThrown())
+        return;
+    }
+
+  jobject jcbimpl = env->NewObject(cfg_cls, ctor_mid,
+                                   reinterpret_cast<jlong>(this));
+  if (JNIUtil::isJavaExceptionThrown())
+    return;
+  env->CallVoidMethod(m_jcfgcb, onload_mid, jcbimpl);
+  if (JNIUtil::isJavaExceptionThrown())
+    return;
+  env->CallVoidMethod(jcbimpl, dispose_mid);
+  env->DeleteLocalRef(jcbimpl);
+}

Modified: subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/OperationContext.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/OperationContext.h?rev=1497793&r1=1497792&r2=1497793&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/OperationContext.h
(original)
+++ subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/OperationContext.h
Fri Jun 28 14:36:53 2013
@@ -58,8 +58,10 @@ class OperationContext
   SVN::Pool *m_pool;
 
   jobject m_jctx;
+  jobject m_jcfgcb;
   static void progress(apr_off_t progressVal, apr_off_t total,
                        void *baton, apr_pool_t *pool);
+  void notifyConfigLoad();
  public:
   OperationContext(SVN::Pool &pool);
   void attachJavaObject(jobject contextHolder, const char *contextClassType, const char *contextFieldName,
jfieldID * ctxFieldID);
@@ -77,6 +79,7 @@ class OperationContext
   virtual bool isCancelledOperation();
   jobject getSelf() const;
   const char *getConfigDirectory() const;
+  jobject getConfigCallback() const;
   const char *getUsername() const;
   const char *getPassword() const;
   const Prompter& getPrompter() const;
@@ -89,6 +92,12 @@ class OperationContext
   void setConfigDirectory(const char *configDir);
 
   /**
+   * Set the config ConfigCallback instance to call when configuration
+   * is loaded..
+   */
+  void setConfigCallback(jobject configCallback);
+
+  /**
    * Return configuration data for the context.
    * Read it from config directory if necessary
    */

Modified: subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/RemoteSession.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/RemoteSession.cpp?rev=1497793&r1=1497792&r2=1497793&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/RemoteSession.cpp
(original)
+++ subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/RemoteSession.cpp
Fri Jun 28 14:36:53 2013
@@ -63,6 +63,7 @@ jobject
 RemoteSession::open(jint jretryAttempts,
                     jstring jurl, jstring juuid,
                     jstring jconfigDirectory,
+                    jobject jconfigHandler,
                     jstring jusername, jstring jpassword,
                     jobject jprompter, jobject jprogress)
 {
@@ -80,9 +81,10 @@ RemoteSession::open(jint jretryAttempts,
     return NULL;
   env->DeleteLocalRef(juuid);
 
-  JNIStringHolder configDirectory(jconfigDirectory);
+  Path configDirectory(jconfigDirectory, requestPool);
   if (JNIUtil::isExceptionThrown())
     return NULL;
+  SVN_JNI_ERR(configDirectory.error_occurred(), NULL);
   env->DeleteLocalRef(jconfigDirectory);
 
   JNIStringHolder usernameStr(jusername);
@@ -104,7 +106,8 @@ RemoteSession::open(jint jretryAttempts,
     }
 
   jobject jremoteSession = open(
-      jretryAttempts, url.c_str(), uuid, configDirectory,
+      jretryAttempts, url.c_str(), uuid,
+      configDirectory.c_str(), jconfigHandler,
       usernameStr, passwordStr, prompter, jprogress);
   if (JNIUtil::isExceptionThrown() || !jremoteSession)
     {
@@ -117,7 +120,7 @@ RemoteSession::open(jint jretryAttempts,
 jobject
 RemoteSession::open(jint jretryAttempts,
                     const char* url, const char* uuid,
-                    const char* configDirectory,
+                    const char* configDirectory, jobject jconfigHandler,
                     const char*  usernameStr, const char*  passwordStr,
                     Prompter* prompter, jobject jprogress)
 {
@@ -133,7 +136,8 @@ RemoteSession::open(jint jretryAttempts,
 
   jobject jthis_out = NULL;
   RemoteSession* session = new RemoteSession(
-      &jthis_out, jretryAttempts, url, uuid, configDirectory,
+      &jthis_out, jretryAttempts, url, uuid,
+      configDirectory, jconfigHandler,
       usernameStr, passwordStr, prompter, jprogress);
   if (JNIUtil::isJavaExceptionThrown() || !session)
     {
@@ -159,6 +163,7 @@ namespace{
 RemoteSession::RemoteSession(jobject* jthis_out, int retryAttempts,
                              const char* url, const char* uuid,
                              const char* configDirectory,
+                             jobject jconfigHandler,
                              const char*  username, const char*  password,
                              Prompter* prompter, jobject jprogress)
   : m_session(NULL), m_context(NULL)
@@ -185,7 +190,7 @@ RemoteSession::RemoteSession(jobject* jt
     return;
 
   m_context = new RemoteSessionContext(
-      jremoteSession, pool, configDirectory,
+      jremoteSession, pool, configDirectory, jconfigHandler,
       username, password, prompter, jprogress);
   if (JNIUtil::isJavaExceptionThrown())
     return;
@@ -680,7 +685,8 @@ build_string_array(const Iterator& iter,
 void
 RemoteSession::getLog(jobject jpaths,
                       jlong jstartrev, jlong jendrev, jint jlimit,
-                      jboolean jstop_on_copy, jboolean jdiscover_changed_paths,
+                      jboolean jstrict_node_history,
+                      jboolean jdiscover_changed_paths,
                       jboolean jinclude_merged_revisions,
                       jobject jrevprops, jobject jlog_callback)
 {
@@ -706,7 +712,7 @@ RemoteSession::getLog(jobject jpaths,
                               svn_revnum_t(jstartrev), svn_revnum_t(jendrev),
                               int(jlimit),
                               bool(jdiscover_changed_paths),
-                              bool(jstop_on_copy),
+                              bool(jstrict_node_history),
                               bool(jinclude_merged_revisions),
                               revprops,
                               receiver.callback, &receiver,

Modified: subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/RemoteSession.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/RemoteSession.h?rev=1497793&r1=1497792&r2=1497793&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/RemoteSession.h
(original)
+++ subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/RemoteSession.h
Fri Jun 28 14:36:53 2013
@@ -47,11 +47,13 @@ class RemoteSession : public SVNBase
     static jobject open(jint jretryAttempts,
                         jstring jurl, jstring juuid,
                         jstring jconfigDirectory,
+                        jobject jconfigHandler,
                         jstring jusername, jstring jpassword,
                         jobject jprompter, jobject jprogress);
     static jobject open(jint jretryAttempts,
                         const char* url, const char* uuid,
                         const char* configDirectory,
+                        jobject jconfigHandler,
                         const char* username, const char* password,
                         Prompter* prompter, jobject jprogress);
     ~RemoteSession();
@@ -85,7 +87,7 @@ class RemoteSession : public SVNBase
                    jobject jstatus_editor);
     // TODO: diff
     void getLog(jobject jpaths, jlong jstartrev, jlong jendrev, jint jlimit,
-                jboolean jstop_on_copy, jboolean jdiscover_changed_paths,
+                jboolean jstrict_node_history, jboolean jdiscover_changed_paths,
                 jboolean jinclude_merged_revisions,
                 jobject jrevprops, jobject jlog_callback);
     jobject checkPath(jstring jpath, jlong jrevision);
@@ -108,6 +110,7 @@ class RemoteSession : public SVNBase
     RemoteSession(jobject*, int retryAttempts,
                   const char* url, const char* uuid,
                   const char* configDirectory,
+                  jobject jconfigHandler,
                   const char* username, const char* password,
                   Prompter* prompter, jobject jprogress);
 

Modified: subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/RemoteSessionContext.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/RemoteSessionContext.cpp?rev=1497793&r1=1497792&r2=1497793&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/RemoteSessionContext.cpp
(original)
+++ subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/RemoteSessionContext.cpp
Fri Jun 28 14:36:53 2013
@@ -32,12 +32,14 @@
 #define STRING_RETURN_SIGNATURE "()Ljava/lang/String;"
 
 RemoteSessionContext::RemoteSessionContext(
-    jobject contextHolder, SVN::Pool &pool, const char* configDirectory,
+    jobject contextHolder, SVN::Pool &pool,
+    const char* configDirectory, jobject jconfigHandler,
     const char*  usernameStr, const char*  passwordStr,
     Prompter* prompter, jobject jprogress)
   : OperationContext(pool), m_raCallbacks(NULL)
 {
   setConfigDirectory(configDirectory);
+  setConfigCallback(jconfigHandler);
   if (usernameStr != NULL)
     username(usernameStr);
 

Modified: subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/RemoteSessionContext.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/RemoteSessionContext.h?rev=1497793&r1=1497792&r2=1497793&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/RemoteSessionContext.h
(original)
+++ subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/RemoteSessionContext.h
Fri Jun 28 14:36:53 2013
@@ -36,6 +36,7 @@ class RemoteSessionContext : public Oper
   public:
     RemoteSessionContext(jobject contextHolder, SVN::Pool &pool,
                          const char* jconfigDirectory,
+                         jobject jconfigHandler,
                          const char* jusername, const char* jpassword,
                          Prompter* prompter, jobject jprogress);
     virtual ~RemoteSessionContext();

Modified: subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/SVNClient.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/SVNClient.cpp?rev=1497793&r1=1497792&r2=1497793&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/SVNClient.cpp
(original)
+++ subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/SVNClient.cpp
Fri Jun 28 14:36:53 2013
@@ -1581,6 +1581,7 @@ SVNClient::openRemoteSession(const char*
     jobject jremoteSession = RemoteSession::open(
         retryAttempts, path_info.url.c_str(), path_info.uuid.c_str(),
         context.getConfigDirectory(),
+        context.getConfigCallback(),
         context.getUsername(), context.getPassword(),
         prompter, jctx);
     if (JNIUtil::isJavaExceptionThrown())

Modified: subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp?rev=1497793&r1=1497792&r2=1497793&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp
(original)
+++ subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp
Fri Jun 28 14:36:53 2013
@@ -1634,6 +1634,21 @@ Java_org_apache_subversion_javahl_SVNCli
   cl->getClientContext().setConfigDirectory(configDir);
 }
 
+JNIEXPORT void JNICALL
+Java_org_apache_subversion_javahl_SVNClient_setConfigEventHandler
+(JNIEnv *env, jobject jthis, jobject jconfigHandler)
+{
+  JNIEntry(SVNClient, setConfigDirectory);
+  SVNClient *cl = SVNClient::getCppObject(jthis);
+  if (cl == NULL)
+    {
+      JNIUtil::throwError(_("bad C++ this"));
+      return;
+    }
+
+  cl->getClientContext().setConfigCallback(jconfigHandler);
+}
+
 JNIEXPORT jstring JNICALL
 Java_org_apache_subversion_javahl_SVNClient_getConfigDirectory
 (JNIEnv *env, jobject jthis)

Modified: subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/org_apache_subversion_javahl_remote_RemoteFactory.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/org_apache_subversion_javahl_remote_RemoteFactory.cpp?rev=1497793&r1=1497792&r2=1497793&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/org_apache_subversion_javahl_remote_RemoteFactory.cpp
(original)
+++ subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/org_apache_subversion_javahl_remote_RemoteFactory.cpp
Fri Jun 28 14:36:53 2013
@@ -38,7 +38,8 @@ JNIEXPORT jobject JNICALL
 Java_org_apache_subversion_javahl_remote_RemoteFactory_open(
     JNIEnv *env, jclass jclass, jint jretryAttempts,
     jstring jurl, jstring juuid,
-    jstring jconfigDirectory, jstring jusername, jstring jpassword,
+    jstring jconfigDirectory, jobject jconfigHandler,
+    jstring jusername, jstring jpassword,
     jobject jprompter, jobject jprogress)
 {
   //JNI macros need jthis but this is a static call
@@ -49,7 +50,8 @@ Java_org_apache_subversion_javahl_remote
    * Create RemoteSession C++ object and return its java wrapper to the caller
    */
   jobject jremoteSession = RemoteSession::open(
-      jretryAttempts, jurl, juuid, jconfigDirectory,
+      jretryAttempts, jurl, juuid,
+      jconfigDirectory, jconfigHandler,
       jusername, jpassword, jprompter, jprogress);
   if (JNIUtil::isJavaExceptionThrown())
     return NULL;

Modified: subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/org_apache_subversion_javahl_remote_RemoteSession.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/org_apache_subversion_javahl_remote_RemoteSession.cpp?rev=1497793&r1=1497792&r2=1497793&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/org_apache_subversion_javahl_remote_RemoteSession.cpp
(original)
+++ subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/native/org_apache_subversion_javahl_remote_RemoteSession.cpp
Fri Jun 28 14:36:53 2013
@@ -235,7 +235,7 @@ JNIEXPORT void JNICALL
 Java_org_apache_subversion_javahl_remote_RemoteSession_getLog(
     JNIEnv *env, jobject jthis, jobject jpaths,
     jlong jstartrev, jlong jendrev, jint jlimit,
-    jboolean jstop_on_copy, jboolean jdiscover_changed_paths,
+    jboolean jstrict_node_history, jboolean jdiscover_changed_paths,
     jboolean jinclude_merged_revisions,
     jobject jrevprops, jobject jlog_callback)
 {
@@ -244,7 +244,7 @@ Java_org_apache_subversion_javahl_remote
   CPPADDR_NULL_PTR(ras,);
 
   ras->getLog(jpaths, jstartrev, jendrev, jlimit,
-              jstop_on_copy, jdiscover_changed_paths,
+              jstrict_node_history, jdiscover_changed_paths,
               jinclude_merged_revisions,
               jrevprops, jlog_callback);
 }

Modified: subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java?rev=1497793&r1=1497792&r2=1497793&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java
(original)
+++ subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java
Fri Jun 28 14:36:53 2013
@@ -1069,6 +1069,12 @@ public interface ISVNClient
     void setConfigDirectory(String configDir) throws ClientException;
 
     /**
+     * Set an event handler that will be called every time the
+     * configuration is loaded.
+     */
+    void setConfigEventHandler(ConfigEvent configHandler);
+
+    /**
      * Get the configuration directory
      * @return  the directory
      * @throws ClientException

Modified: subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNRemote.java
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNRemote.java?rev=1497793&r1=1497792&r2=1497793&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNRemote.java
(original)
+++ subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNRemote.java
Fri Jun 28 14:36:53 2013
@@ -361,7 +361,7 @@ public interface ISVNRemote
      * <code>callback</code> the list of changed paths in that
      * revision.
      * <p>
-     * If <code>stopOnCopy</code> is set, copy history will not be
+     * If <code>strictNodeHistory</code> is set, copy history will not be
      * traversed (if any exists) when harvesting the revision logs for
      * each path.
      * <p>
@@ -395,7 +395,7 @@ public interface ISVNRemote
      */
     void getLog(Iterable<String> paths,
                 long startRevision, long endRevision, int limit,
-                boolean stopOnCopy, boolean discoverPath,
+                boolean strictNodeHistory, boolean discoverPath,
                 boolean includeMergedRevisions,
                 Iterable<String> revisionProperties,
                 LogMessageCallback callback)

Modified: subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java?rev=1497793&r1=1497792&r2=1497793&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java
(original)
+++ subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java
Fri Jun 28 14:36:53 2013
@@ -573,6 +573,8 @@ public class SVNClient implements ISVNCl
     public native void setConfigDirectory(String configDir)
             throws ClientException;
 
+    public native void setConfigEventHandler(ConfigEvent configHandler);
+
     public native String getConfigDirectory()
             throws ClientException;
 

Modified: subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/src/org/apache/subversion/javahl/remote/RemoteFactory.java
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/src/org/apache/subversion/javahl/remote/RemoteFactory.java?rev=1497793&r1=1497792&r2=1497793&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/src/org/apache/subversion/javahl/remote/RemoteFactory.java
(original)
+++ subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/src/org/apache/subversion/javahl/remote/RemoteFactory.java
Fri Jun 28 14:36:53 2013
@@ -49,11 +49,13 @@ public class RemoteFactory
      * Initializing constructor. Any or all of its arguments may be null.
      */
     public RemoteFactory(String configDirectory,
+                         ConfigEvent configHandler,
                          String username, String password,
                          UserPasswordCallback prompt,
                          ProgressCallback progress)
     {
         setConfigDirectory(configDirectory);
+        setConfigEventHandler(configHandler);
         setUsername(username);
         setPassword(password);
         setPrompt(prompt);
@@ -116,6 +118,15 @@ public class RemoteFactory
         this.configDirectory = configDirectory;
     }
 
+    /**
+     * Set an event handler that will be called every time the
+     * configuration is loaded.
+     */
+    public void setConfigEventHandler(ConfigEvent configHandler)
+    {
+        this.configHandler = configHandler;
+    }
+
 
     /**
      * Open a persistent session to a repository.
@@ -134,7 +145,8 @@ public class RemoteFactory
             throws ClientException, SubversionException
     {
         return open(1, url, null,
-                    configDirectory, username, password, prompt, progress);
+                    configDirectory, configHandler,
+                    username, password, prompt, progress);
     }
 
     /**
@@ -161,7 +173,8 @@ public class RemoteFactory
             throw new IllegalArgumentException(
                 "retryAttempts must be positive");
         return open(retryAttempts, url, null,
-                    configDirectory, username, password, prompt, progress);
+                    configDirectory, configHandler,
+                    username, password, prompt, progress);
     }
 
     /**
@@ -188,7 +201,8 @@ public class RemoteFactory
         if (reposUUID == null)
             throw new IllegalArgumentException("reposUUID may not be null");
         return open(1, url, reposUUID,
-                    configDirectory, username, password, prompt, progress);
+                    configDirectory, configHandler,
+                    username, password, prompt, progress);
     }
 
     /**
@@ -222,10 +236,12 @@ public class RemoteFactory
             throw new IllegalArgumentException(
                 "retryAttempts must be positive");
         return open(retryAttempts, url, reposUUID,
-                    configDirectory, username, password, prompt, progress);
+                    configDirectory, configHandler,
+                    username, password, prompt, progress);
     }
 
     private String configDirectory;
+    private ConfigEvent configHandler;
     private String username;
     private String password;
     private UserPasswordCallback prompt;
@@ -235,6 +251,7 @@ public class RemoteFactory
     private static native ISVNRemote open(int retryAttempts,
                                           String url, String reposUUID,
                                           String configDirectory,
+                                          ConfigEvent configHandler,
                                           String username, String password,
                                           UserPasswordCallback prompt,
                                           ProgressCallback progress)

Modified: subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/src/org/apache/subversion/javahl/remote/RemoteSession.java
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/src/org/apache/subversion/javahl/remote/RemoteSession.java?rev=1497793&r1=1497792&r2=1497793&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/src/org/apache/subversion/javahl/remote/RemoteSession.java
(original)
+++ subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/src/org/apache/subversion/javahl/remote/RemoteSession.java
Fri Jun 28 14:36:53 2013
@@ -164,7 +164,7 @@ public class RemoteSession extends JNIOb
 
     public native void getLog(Iterable<String> paths,
                               long startRevision, long endRevision, int limit,
-                              boolean stopOnCopy, boolean discoverPath,
+                              boolean strictNodeHistory, boolean discoverPath,
                               boolean includeMergedRevisions,
                               Iterable<String> revisionProperties,
                               LogMessageCallback callback)

Modified: subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java?rev=1497793&r1=1497792&r2=1497793&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java
(original)
+++ subversion/branches/javahl-1.8-extensions/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java
Fri Jun 28 14:36:53 2013
@@ -66,12 +66,14 @@ public class SVNRemoteTests extends SVNT
         thisTest = new OneTest();
     }
 
-    public static ISVNRemote getSession(String url, String configDirectory)
+    public static ISVNRemote getSession(String url, String configDirectory,
+                                        ConfigEvent configHandler)
     {
         try
         {
             RemoteFactory factory = new RemoteFactory();
             factory.setConfigDirectory(configDirectory);
+            factory.setConfigEventHandler(configHandler);
             factory.setUsername(USERNAME);
             factory.setPassword(PASSWORD);
             factory.setPrompt(new DefaultPromptUserPassword());
@@ -88,7 +90,7 @@ public class SVNRemoteTests extends SVNT
 
     private ISVNRemote getSession()
     {
-        return getSession(getTestRepoUrl(), super.conf.getAbsolutePath());
+        return getSession(getTestRepoUrl(), super.conf.getAbsolutePath(), null);
     }
 
     /**
@@ -107,7 +109,7 @@ public class SVNRemoteTests extends SVNT
         try
         {
             session = new RemoteFactory(
-                super.conf.getAbsolutePath(),
+                super.conf.getAbsolutePath(), null,
                 USERNAME, PASSWORD,
                 new DefaultPromptUserPassword(), null)
                 .openRemoteSession(getTestRepoUrl());
@@ -746,4 +748,39 @@ public class SVNRemoteTests extends SVNT
         assertEquals(0, receiver.logs.size());
         assertTrue(exception);
     }
+
+    public void testConfigHandler() throws Exception
+    {
+        ConfigEvent handler = new ConfigEvent()
+            {
+                public void onLoad(ISVNConfig cfg)
+                {
+                    //System.out.println("config:");
+                    onecat(cfg.config());
+                    //System.out.println("servers:");
+                    onecat(cfg.servers());
+                }
+
+                private void onecat(ISVNConfig.Category cat)
+                {
+                    for (String sec : cat.sections()) {
+                        //System.out.println("  [" + sec + "]");
+                        ISVNConfig.Enumerator en = new ISVNConfig.Enumerator()
+                            {
+                                public void option(String name, String value)
+                                {
+                                    //System.out.println("    " + name
+                                    //                   + " = " + value);
+                                }
+                            };
+                        cat.enumerate(sec, en);
+                    }
+                }
+            };
+
+        ISVNRemote session = getSession(getTestRepoUrl(),
+                                        super.conf.getAbsolutePath(),
+                                        handler);
+        session.getLatestRevision(); // Make sure the configuration gets loaded
+    }
 }



Mime
View raw message