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 2010/08/26 18:52:28 UTC
svn commit: r989819 - in
/subversion/trunk/subversion/bindings/javahl/native: ClientContext.cpp
ClientContext.h SVNClient.cpp SVNClient.h
org_apache_subversion_javahl_SVNClient.cpp
Author: hwright
Date: Thu Aug 26 16:52:27 2010
New Revision: 989819
URL: http://svn.apache.org/viewvc?rev=989819&view=rev
Log:
JavaHL: Factor the C++ client context information out of the main SVNClient class
and into a separate ClientContext class. This does not include any functional
changes, but does touch a number of files.
The end goal is to allow svn_client_ctx_t objects (and thus the svn_wc_context_t
caches) to persist across method invocation boundaries.
* subversion/bindings/javahl/native/SVNClient.h
(cancelOperation, commitMessageHAndler, getConfigDirectory, setConfigDirectory,
notification2, setConflictResolver, setProgressListener, setPrompt,
username, password, checkCancel, getContext, m_notify2, m_conflictResolver,
m_progressListener, m_prompter, m_cancelOperation, m_commitMessage,
getCommitMessage, getCommitMessageBaton, m_userName, m_passWord, m_configDir):
Remove.
(getClientContext, context): New.
[throughout]: Update references to getContext.
* subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp:
When setting parameters in the client context, use the ClientContext object
supplied by the SVNClient object.
* subversion/bindings/javahl/native/ClientContext.h,
subversion/bindings/javahl/native/ClientContext.cpp:
New.
Added:
subversion/trunk/subversion/bindings/javahl/native/ClientContext.cpp (with props)
subversion/trunk/subversion/bindings/javahl/native/ClientContext.h (with props)
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
Added: subversion/trunk/subversion/bindings/javahl/native/ClientContext.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/ClientContext.cpp?rev=989819&view=auto
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/ClientContext.cpp (added)
+++ subversion/trunk/subversion/bindings/javahl/native/ClientContext.cpp Thu Aug 26 16:52:27 2010
@@ -0,0 +1,317 @@
+/**
+ * @copyright
+ * ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * ====================================================================
+ * @endcopyright
+ *
+ * @file ClientContext.cpp
+ * @brief Implementation of the class ClientContext
+ */
+
+#include "svn_client.h"
+#include "svn_private_config.h"
+
+#include "ClientContext.h"
+#include "JNIUtil.h"
+
+#include "Prompter.h"
+#include "ClientNotifyCallback.h"
+#include "ProgressListener.h"
+#include "CommitMessage.h"
+#include "ConflictResolverCallback.h"
+
+
+struct log_msg_baton
+{
+ const char *message;
+ CommitMessage *messageHandler;
+};
+
+ClientContext::ClientContext()
+ : m_notify2(NULL),
+ m_progressListener(NULL),
+ m_prompter(NULL),
+ m_commitMessage(NULL),
+ m_conflictResolver(NULL)
+{
+}
+
+ClientContext::~ClientContext()
+{
+ delete m_notify2;
+ delete m_progressListener;
+ delete m_prompter;
+ delete m_commitMessage;
+ delete m_conflictResolver;
+}
+
+svn_client_ctx_t *
+ClientContext::getContext(const char *message)
+{
+ SVN::Pool *requestPool = JNIUtil::getRequestPool();
+ apr_pool_t *pool = requestPool->pool();
+ svn_auth_baton_t *ab;
+ svn_client_ctx_t *ctx;
+ SVN_JNI_ERR(svn_client_create_context(&ctx, pool), NULL);
+
+ const char *configDir = m_configDir.c_str();
+ if (m_configDir.length() == 0)
+ configDir = NULL;
+ SVN_JNI_ERR(svn_config_get_config(&(ctx->config), configDir, pool), NULL);
+ svn_config_t *config = (svn_config_t *) apr_hash_get(ctx->config,
+ SVN_CONFIG_CATEGORY_CONFIG,
+ APR_HASH_KEY_STRING);
+
+ /* The whole list of registered providers */
+ apr_array_header_t *providers;
+
+ /* Populate the registered providers with the platform-specific providers */
+ SVN_JNI_ERR(svn_auth_get_platform_specific_client_providers(&providers,
+ config,
+ pool),
+ NULL);
+
+ /* Use the prompter (if available) to prompt for password and cert
+ * caching. */
+ svn_auth_plaintext_prompt_func_t plaintext_prompt_func = NULL;
+ void *plaintext_prompt_baton = NULL;
+ svn_auth_plaintext_passphrase_prompt_func_t plaintext_passphrase_prompt_func;
+ void *plaintext_passphrase_prompt_baton = NULL;
+
+ if (m_prompter != NULL)
+ {
+ plaintext_prompt_func = Prompter::plaintext_prompt;
+ plaintext_prompt_baton = m_prompter;
+ plaintext_passphrase_prompt_func = Prompter::plaintext_passphrase_prompt;
+ plaintext_passphrase_prompt_baton = m_prompter;
+ }
+
+ /* The main disk-caching auth providers, for both
+ * 'username/password' creds and 'username' creds. */
+ svn_auth_provider_object_t *provider;
+
+ svn_auth_get_simple_provider2(&provider, plaintext_prompt_func,
+ plaintext_prompt_baton, pool);
+ APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
+
+ svn_auth_get_username_provider(&provider, pool);
+ APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
+
+ /* The server-cert, client-cert, and client-cert-password providers. */
+ SVN_JNI_ERR(svn_auth_get_platform_specific_provider(&provider,
+ "windows",
+ "ssl_server_trust",
+ pool),
+ NULL);
+
+ if (provider)
+ APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
+
+ svn_auth_get_ssl_server_trust_file_provider(&provider, pool);
+ APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
+ svn_auth_get_ssl_client_cert_file_provider(&provider, pool);
+ APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
+ svn_auth_get_ssl_client_cert_pw_file_provider2(&provider,
+ plaintext_passphrase_prompt_func,
+ plaintext_passphrase_prompt_baton, pool);
+ APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
+
+ if (m_prompter != NULL)
+ {
+ /* Two basic prompt providers: username/password, and just username.*/
+ provider = m_prompter->getProviderSimple();
+
+ APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
+
+ provider = m_prompter->getProviderUsername();
+ APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
+
+ /* Three ssl prompt providers, for server-certs, client-certs,
+ * and client-cert-passphrases. */
+ provider = m_prompter->getProviderServerSSLTrust();
+ APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
+
+ provider = m_prompter->getProviderClientSSL();
+ APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
+
+ provider = m_prompter->getProviderClientSSLPassword();
+ APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
+ }
+
+ /* Build an authentication baton to give to libsvn_client. */
+ svn_auth_open(&ab, providers, pool);
+
+ /* Place any default --username or --password credentials into the
+ * auth_baton's run-time parameter hash. ### Same with --no-auth-cache? */
+ if (!m_userName.empty())
+ svn_auth_set_parameter(ab, SVN_AUTH_PARAM_DEFAULT_USERNAME,
+ m_userName.c_str());
+ if (!m_passWord.empty())
+ svn_auth_set_parameter(ab, SVN_AUTH_PARAM_DEFAULT_PASSWORD,
+ m_passWord.c_str());
+
+ ctx->auth_baton = ab;
+ ctx->notify_func = NULL;
+ ctx->notify_baton = NULL;
+ ctx->log_msg_func3 = getCommitMessage;
+ ctx->log_msg_baton3 = getCommitMessageBaton(message);
+ ctx->cancel_func = checkCancel;
+ m_cancelOperation = false;
+ ctx->cancel_baton = this;
+ ctx->notify_func2= ClientNotifyCallback::notify;
+ ctx->notify_baton2 = m_notify2;
+
+ ctx->progress_func = ProgressListener::progress;
+ ctx->progress_baton = m_progressListener;
+
+ if (m_conflictResolver)
+ {
+ ctx->conflict_func = ConflictResolverCallback::resolveConflict;
+ ctx->conflict_baton = m_conflictResolver;
+ }
+
+ return ctx;
+}
+
+svn_error_t *
+ClientContext::getCommitMessage(const char **log_msg,
+ const char **tmp_file,
+ const apr_array_header_t *commit_items,
+ void *baton,
+ apr_pool_t *pool)
+{
+ *log_msg = NULL;
+ *tmp_file = NULL;
+ log_msg_baton *lmb = (log_msg_baton *) baton;
+
+ if (lmb && lmb->messageHandler)
+ {
+ jstring jmsg = lmb->messageHandler->getCommitMessage(commit_items);
+ if (jmsg != NULL)
+ {
+ JNIStringHolder msg(jmsg);
+ *log_msg = apr_pstrdup(pool, msg);
+ }
+ return SVN_NO_ERROR;
+ }
+ else if (lmb && lmb->message)
+ {
+ *log_msg = apr_pstrdup(pool, lmb->message);
+ return SVN_NO_ERROR;
+ }
+
+ return SVN_NO_ERROR;
+}
+
+void *
+ClientContext::getCommitMessageBaton(const char *message)
+{
+ if (message != NULL || m_commitMessage)
+ {
+ log_msg_baton *baton = (log_msg_baton *)
+ apr_palloc(JNIUtil::getRequestPool()->pool(), sizeof(*baton));
+
+ baton->message = message;
+ baton->messageHandler = m_commitMessage;
+
+ return baton;
+ }
+ return NULL;
+}
+
+void
+ClientContext::username(const char *pi_username)
+{
+ m_userName = (pi_username == NULL ? "" : pi_username);
+}
+
+void
+ClientContext::password(const char *pi_password)
+{
+ m_passWord = (pi_password == NULL ? "" : pi_password);
+}
+
+void
+ClientContext::setPrompt(Prompter *prompter)
+{
+ delete m_prompter;
+ m_prompter = prompter;
+}
+
+void
+ClientContext::notification2(ClientNotifyCallback *notify2)
+{
+ delete m_notify2;
+ m_notify2 = notify2;
+}
+
+void
+ClientContext::setConflictResolver(ConflictResolverCallback *conflictResolver)
+{
+ delete m_conflictResolver;
+ m_conflictResolver = conflictResolver;
+}
+
+void
+ClientContext::setProgressListener(ProgressListener *listener)
+{
+ delete m_progressListener;
+ m_progressListener = listener;
+}
+
+void
+ClientContext::setConfigDirectory(const char *configDir)
+{
+ // A change to the config directory may necessitate creation of
+ // the config templates.
+ SVN::Pool requestPool;
+ SVN_JNI_ERR(svn_config_ensure(configDir, requestPool.pool()), );
+
+ m_configDir = (configDir == NULL ? "" : configDir);
+}
+
+const char *
+ClientContext::getConfigDirectory()
+{
+ return m_configDir.c_str();
+}
+
+void
+ClientContext::commitMessageHandler(CommitMessage *commitMessage)
+{
+ delete m_commitMessage;
+ m_commitMessage = commitMessage;
+}
+
+void
+ClientContext::cancelOperation()
+{
+ m_cancelOperation = true;
+}
+
+svn_error_t *
+ClientContext::checkCancel(void *cancelBaton)
+{
+ ClientContext *that = (ClientContext *)cancelBaton;
+ if (that->m_cancelOperation)
+ return svn_error_create(SVN_ERR_CANCELLED, NULL,
+ _("Operation canceled"));
+ else
+ return SVN_NO_ERROR;
+}
Propchange: subversion/trunk/subversion/bindings/javahl/native/ClientContext.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: subversion/trunk/subversion/bindings/javahl/native/ClientContext.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/ClientContext.h?rev=989819&view=auto
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/ClientContext.h (added)
+++ subversion/trunk/subversion/bindings/javahl/native/ClientContext.h Thu Aug 26 16:52:27 2010
@@ -0,0 +1,103 @@
+/**
+ * @copyright
+ * ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * ====================================================================
+ * @endcopyright
+ *
+ * @file ClientContext.h
+ * @brief Interface of the class ClientContext
+ */
+
+#ifndef CLIENTCONTEXT_H
+#define CLIENTCONTEXT_H
+
+#include <string>
+
+#include "svn_types.h"
+#include "svn_client.h"
+
+#include <jni.h>
+#include "Pool.h"
+#include "JNIStringHolder.h"
+
+class Prompter;
+class ClientNotifyCallback;
+class ConflictResolverCallback;
+class ProgressListener;
+class CommitMessage;
+
+/**
+ * This class contains a Java objects implementing the interface ClientContext
+ * and implements the functions read & close of svn_stream_t.
+ */
+class ClientContext
+{
+ private:
+ std::string m_userName;
+ std::string m_passWord;
+ std::string m_configDir;
+
+ Prompter *m_prompter;
+ ClientNotifyCallback *m_notify2;
+ ConflictResolverCallback *m_conflictResolver;
+ ProgressListener *m_progressListener;
+ bool m_cancelOperation;
+
+ CommitMessage *m_commitMessage;
+
+ /**
+ * Implements the svn_client_get_commit_log3_t API.
+ */
+ static svn_error_t *getCommitMessage(const char **log_msg,
+ const char **tmp_file,
+ const apr_array_header_t *
+ commit_items,
+ void *baton,
+ apr_pool_t *pool);
+ /**
+ * Produce a baton for the getCommitMessage() callback.
+ */
+ void *getCommitMessageBaton(const char *message);
+ public:
+ ClientContext();
+ ~ClientContext();
+
+ static svn_error_t *checkCancel(void *cancelBaton);
+
+ svn_client_ctx_t *getContext(const char *message);
+
+ void username(const char *pi_username);
+ void password(const char *pi_password);
+ void setPrompt(Prompter *prompter);
+ void notification2(ClientNotifyCallback *notify2);
+ void setConflictResolver(ConflictResolverCallback *conflictResolver);
+ void setProgressListener(ProgressListener *listener);
+ void commitMessageHandler(CommitMessage *commitMessage);
+ void cancelOperation();
+ const char *getConfigDirectory();
+
+ /**
+ * Set the configuration directory, taking the usual steps to
+ * ensure that Subversion's config file templates exist in the
+ * specified location.
+ */
+ void setConfigDirectory(const char *configDir);
+};
+
+#endif // CLIENTCONTEXT_H
Propchange: subversion/trunk/subversion/bindings/javahl/native/ClientContext.h
------------------------------------------------------------------------------
svn:eol-style = native
Modified: subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp?rev=989819&r1=989818&r2=989819&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp Thu Aug 26 16:52:27 2010
@@ -30,6 +30,7 @@
#include "CopySources.h"
#include "DiffSummaryReceiver.h"
#include "ConflictResolverCallback.h"
+#include "ClientContext.h"
#include "ProgressListener.h"
#include "Prompter.h"
#include "Pool.h"
@@ -70,27 +71,13 @@
#include <sstream>
-struct log_msg_baton
-{
- const char *message;
- CommitMessage *messageHandler;
-};
-
SVNClient::SVNClient()
+ : context()
{
- m_notify2 = NULL;
- m_progressListener = NULL;
- m_prompter = NULL;
- m_commitMessage = NULL;
- m_conflictResolver = NULL;
}
SVNClient::~SVNClient()
{
- delete m_notify2;
- delete m_progressListener;
- delete m_prompter;
- delete m_conflictResolver;
}
SVNClient *SVNClient::getCppObject(jobject jthis)
@@ -138,7 +125,7 @@ void SVNClient::list(const char *url, Re
ListCallback *callback)
{
SVN::Pool requestPool;
- svn_client_ctx_t *ctx = getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL);
if (ctx == NULL)
return;
@@ -170,7 +157,7 @@ SVNClient::status(const char *path, svn_
SVN_JNI_NULL_PTR_EX(path, "path", );
- svn_client_ctx_t *ctx = getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL);
if (ctx == NULL)
return;
callback->setWcCtx(ctx->wc_ctx);
@@ -190,22 +177,6 @@ SVNClient::status(const char *path, svn_
requestPool.pool()), );
}
-void SVNClient::username(const char *pi_username)
-{
- m_userName = (pi_username == NULL ? "" : pi_username);
-}
-
-void SVNClient::password(const char *pi_password)
-{
- m_passWord = (pi_password == NULL ? "" : pi_password);
-}
-
-void SVNClient::setPrompt(Prompter *prompter)
-{
- delete m_prompter;
- m_prompter = prompter;
-}
-
void SVNClient::logMessages(const char *path, Revision &pegRevision,
std::vector<RevisionRange> &logRanges,
bool stopOnCopy, bool discoverPaths,
@@ -216,7 +187,7 @@ void SVNClient::logMessages(const char *
SVN_JNI_NULL_PTR_EX(path, "path", );
- svn_client_ctx_t *ctx = getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL);
if (ctx == NULL)
return;
@@ -277,7 +248,7 @@ jlong SVNClient::checkout(const char *mo
SVN_JNI_ERR(path.error_occured(), -1);
svn_revnum_t rev;
- svn_client_ctx_t *ctx = getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL);
if (ctx == NULL)
return -1;
@@ -295,30 +266,12 @@ jlong SVNClient::checkout(const char *mo
return rev;
}
-void SVNClient::notification2(ClientNotifyCallback *notify2)
-{
- delete m_notify2;
- m_notify2 = notify2;
-}
-
-void SVNClient::setConflictResolver(ConflictResolverCallback *conflictResolver)
-{
- delete m_conflictResolver;
- m_conflictResolver = conflictResolver;
-}
-
-void SVNClient::setProgressListener(ProgressListener *listener)
-{
- delete m_progressListener;
- m_progressListener = listener;
-}
-
void SVNClient::remove(Targets &targets, const char *message, bool force,
bool keep_local, RevpropTable &revprops,
CommitCallback *callback)
{
SVN::Pool requestPool;
- svn_client_ctx_t *ctx = getContext(message);
+ svn_client_ctx_t *ctx = context.getContext(message);
if (ctx == NULL)
return;
@@ -338,7 +291,7 @@ void SVNClient::revert(const char *path,
SVN_JNI_NULL_PTR_EX(path, "path", );
- svn_client_ctx_t *ctx = getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL);
if (ctx == NULL)
return;
@@ -360,7 +313,7 @@ void SVNClient::add(const char *path,
Path intPath(path);
SVN_JNI_ERR(intPath.error_occured(), );
- svn_client_ctx_t *ctx = getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL);
if (ctx == NULL)
return;
@@ -376,7 +329,7 @@ jlongArray SVNClient::update(Targets &ta
{
SVN::Pool requestPool;
- svn_client_ctx_t *ctx = getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL);
apr_array_header_t *revs;
if (ctx == NULL)
return NULL;
@@ -417,7 +370,7 @@ void SVNClient::commit(Targets &targets,
SVN::Pool requestPool;
const apr_array_header_t *targets2 = targets.array(requestPool);
SVN_JNI_ERR(targets.error_occured(), );
- svn_client_ctx_t *ctx = getContext(message);
+ svn_client_ctx_t *ctx = context.getContext(message);
if (ctx == NULL)
return;
@@ -448,7 +401,7 @@ void SVNClient::copy(CopySources ©So
Path destinationPath(destPath);
SVN_JNI_ERR(destinationPath.error_occured(), );
- svn_client_ctx_t *ctx = getContext(message);
+ svn_client_ctx_t *ctx = context.getContext(message);
if (ctx == NULL)
return;
@@ -472,7 +425,7 @@ void SVNClient::move(Targets &srcPaths,
Path destinationPath(destPath);
SVN_JNI_ERR(destinationPath.error_occured(), );
- svn_client_ctx_t *ctx = getContext(message);
+ svn_client_ctx_t *ctx = context.getContext(message);
if (ctx == NULL)
return;
@@ -487,7 +440,7 @@ void SVNClient::mkdir(Targets &targets,
RevpropTable &revprops, CommitCallback *callback)
{
SVN::Pool requestPool;
- svn_client_ctx_t *ctx = getContext(message);
+ svn_client_ctx_t *ctx = context.getContext(message);
if (ctx == NULL)
return;
@@ -507,7 +460,7 @@ void SVNClient::cleanup(const char *path
Path intPath(path);
SVN_JNI_ERR(intPath.error_occured(), );
- svn_client_ctx_t *ctx = getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL);
if (ctx == NULL)
return;
@@ -521,7 +474,7 @@ void SVNClient::resolve(const char *path
SVN_JNI_NULL_PTR_EX(path, "path", );
Path intPath(path);
SVN_JNI_ERR(intPath.error_occured(), );
- svn_client_ctx_t *ctx = getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL);
if (ctx == NULL)
return;
@@ -542,7 +495,7 @@ jlong SVNClient::doExport(const char *sr
Path destinationPath(destPath);
SVN_JNI_ERR(destinationPath.error_occured(), -1);
svn_revnum_t rev;
- svn_client_ctx_t *ctx = getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL);
if (ctx == NULL)
return -1;
@@ -575,7 +528,7 @@ jlong SVNClient::doSwitch(const char *pa
SVN_JNI_ERR(intPath.error_occured(), -1);
svn_revnum_t rev;
- svn_client_ctx_t *ctx = getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL);
if (ctx == NULL)
return -1;
@@ -607,7 +560,7 @@ void SVNClient::doImport(const char *pat
Path intUrl(url);
SVN_JNI_ERR(intUrl.error_occured(), );
- svn_client_ctx_t *ctx = getContext(message);
+ svn_client_ctx_t *ctx = context.getContext(message);
if (ctx == NULL)
return;
@@ -622,7 +575,7 @@ jobject
SVNClient::suggestMergeSources(const char *path, Revision &pegRevision)
{
SVN::Pool requestPool;
- svn_client_ctx_t *ctx = getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL);
if (ctx == NULL)
return NULL;
@@ -653,7 +606,7 @@ void SVNClient::merge(const char *path1,
Path srcPath2 = path2;
SVN_JNI_ERR(srcPath2.error_occured(), );
- svn_client_ctx_t *ctx = getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL);
if (ctx == NULL)
return;
@@ -679,7 +632,7 @@ void SVNClient::merge(const char *path,
Path srcPath(path);
SVN_JNI_ERR(srcPath.error_occured(), );
- svn_client_ctx_t *ctx = getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL);
if (ctx == NULL)
return;
@@ -734,7 +687,7 @@ void SVNClient::mergeReintegrate(const c
Path srcPath(path);
SVN_JNI_ERR(srcPath.error_occured(), );
- svn_client_ctx_t *ctx = getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL);
if (ctx == NULL)
return;
@@ -751,7 +704,7 @@ SVNClient::getMergeinfo(const char *targ
SVN::Pool requestPool;
JNIEnv *env = JNIUtil::getEnv();
- svn_client_ctx_t *ctx = getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL);
if (ctx == NULL)
return NULL;
@@ -828,7 +781,7 @@ void SVNClient::getMergeinfoLog(int type
{
SVN::Pool requestPool;
- svn_client_ctx_t *ctx = getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL);
if (ctx == NULL)
return;
@@ -868,7 +821,7 @@ jbyteArray SVNClient::propertyGet(const
Path intPath(path);
SVN_JNI_ERR(intPath.error_occured(), NULL);
- svn_client_ctx_t *ctx = getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL);
if (ctx == NULL)
return NULL;
@@ -904,7 +857,7 @@ void SVNClient::properties(const char *p
Path intPath(path);
SVN_JNI_ERR(intPath.error_occured(), );
- svn_client_ctx_t *ctx = getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL);
if (ctx == NULL)
return;
@@ -935,7 +888,7 @@ void SVNClient::propertySet(const char *
Path intPath(path);
SVN_JNI_ERR(intPath.error_occured(), );
- svn_client_ctx_t *ctx = getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL);
if (ctx == NULL)
return;
@@ -967,7 +920,7 @@ void SVNClient::diff(const char *target1
SVN_JNI_NULL_PTR_EX(target2, "target2", );
SVN_JNI_NULL_PTR_EX(outfileName, "outfileName", );
- svn_client_ctx_t *ctx = getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL);
if (ctx == NULL)
return;
@@ -1094,7 +1047,7 @@ SVNClient::diffSummarize(const char *tar
SVN_JNI_NULL_PTR_EX(target1, "target1", );
SVN_JNI_NULL_PTR_EX(target2, "target2", );
- svn_client_ctx_t *ctx = getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL);
if (ctx == NULL)
return;
@@ -1123,7 +1076,7 @@ SVNClient::diffSummarize(const char *tar
SVN_JNI_NULL_PTR_EX(target, "target", );
- svn_client_ctx_t *ctx = getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL);
if (ctx == NULL)
return;
@@ -1142,178 +1095,6 @@ SVNClient::diffSummarize(const char *tar
requestPool.pool()), );
}
-svn_client_ctx_t *SVNClient::getContext(const char *message)
-{
- SVN::Pool *requestPool = JNIUtil::getRequestPool();
- apr_pool_t *pool = requestPool->pool();
- svn_auth_baton_t *ab;
- svn_client_ctx_t *ctx;
- SVN_JNI_ERR(svn_client_create_context(&ctx, pool), NULL);
-
- const char *configDir = m_configDir.c_str();
- if (m_configDir.length() == 0)
- configDir = NULL;
- SVN_JNI_ERR(svn_config_get_config(&(ctx->config), configDir, pool), NULL);
- svn_config_t *config = (svn_config_t *) apr_hash_get(ctx->config,
- SVN_CONFIG_CATEGORY_CONFIG,
- APR_HASH_KEY_STRING);
-
- /* The whole list of registered providers */
- apr_array_header_t *providers;
-
- /* Populate the registered providers with the platform-specific providers */
- SVN_JNI_ERR(svn_auth_get_platform_specific_client_providers(&providers,
- config,
- pool),
- NULL);
-
- /* Use the prompter (if available) to prompt for password and cert
- * caching. */
- svn_auth_plaintext_prompt_func_t plaintext_prompt_func = NULL;
- void *plaintext_prompt_baton = NULL;
- svn_auth_plaintext_passphrase_prompt_func_t plaintext_passphrase_prompt_func;
- void *plaintext_passphrase_prompt_baton = NULL;
-
- if (m_prompter != NULL)
- {
- plaintext_prompt_func = Prompter::plaintext_prompt;
- plaintext_prompt_baton = m_prompter;
- plaintext_passphrase_prompt_func = Prompter::plaintext_passphrase_prompt;
- plaintext_passphrase_prompt_baton = m_prompter;
- }
-
- /* The main disk-caching auth providers, for both
- * 'username/password' creds and 'username' creds. */
- svn_auth_provider_object_t *provider;
-
- svn_auth_get_simple_provider2(&provider, plaintext_prompt_func,
- plaintext_prompt_baton, pool);
- APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
-
- svn_auth_get_username_provider(&provider, pool);
- APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
-
- /* The server-cert, client-cert, and client-cert-password providers. */
- SVN_JNI_ERR(svn_auth_get_platform_specific_provider(&provider,
- "windows",
- "ssl_server_trust",
- pool),
- NULL);
-
- if (provider)
- APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
-
- svn_auth_get_ssl_server_trust_file_provider(&provider, pool);
- APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
- svn_auth_get_ssl_client_cert_file_provider(&provider, pool);
- APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
- svn_auth_get_ssl_client_cert_pw_file_provider2(&provider,
- plaintext_passphrase_prompt_func,
- plaintext_passphrase_prompt_baton, pool);
- APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
-
- if (m_prompter != NULL)
- {
- /* Two basic prompt providers: username/password, and just username.*/
- provider = m_prompter->getProviderSimple();
-
- APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
-
- provider = m_prompter->getProviderUsername();
- APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
-
- /* Three ssl prompt providers, for server-certs, client-certs,
- * and client-cert-passphrases. */
- provider = m_prompter->getProviderServerSSLTrust();
- APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
-
- provider = m_prompter->getProviderClientSSL();
- APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
-
- provider = m_prompter->getProviderClientSSLPassword();
- APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
- }
-
- /* Build an authentication baton to give to libsvn_client. */
- svn_auth_open(&ab, providers, pool);
-
- /* Place any default --username or --password credentials into the
- * auth_baton's run-time parameter hash. ### Same with --no-auth-cache? */
- if (!m_userName.empty())
- svn_auth_set_parameter(ab, SVN_AUTH_PARAM_DEFAULT_USERNAME,
- m_userName.c_str());
- if (!m_passWord.empty())
- svn_auth_set_parameter(ab, SVN_AUTH_PARAM_DEFAULT_PASSWORD,
- m_passWord.c_str());
-
- ctx->auth_baton = ab;
- ctx->notify_func = NULL;
- ctx->notify_baton = NULL;
- ctx->log_msg_func3 = getCommitMessage;
- ctx->log_msg_baton3 = getCommitMessageBaton(message);
- ctx->cancel_func = checkCancel;
- m_cancelOperation = false;
- ctx->cancel_baton = this;
- ctx->notify_func2= ClientNotifyCallback::notify;
- ctx->notify_baton2 = m_notify2;
-
- ctx->progress_func = ProgressListener::progress;
- ctx->progress_baton = m_progressListener;
-
- if (m_conflictResolver)
- {
- ctx->conflict_func = ConflictResolverCallback::resolveConflict;
- ctx->conflict_baton = m_conflictResolver;
- }
-
- return ctx;
-}
-
-svn_error_t *
-SVNClient::getCommitMessage(const char **log_msg,
- const char **tmp_file,
- const apr_array_header_t *commit_items,
- void *baton,
- apr_pool_t *pool)
-{
- *log_msg = NULL;
- *tmp_file = NULL;
- log_msg_baton *lmb = (log_msg_baton *) baton;
-
- if (lmb && lmb->messageHandler)
- {
- jstring jmsg = lmb->messageHandler->getCommitMessage(commit_items);
- if (jmsg != NULL)
- {
- JNIStringHolder msg(jmsg);
- *log_msg = apr_pstrdup(pool, msg);
- }
- return SVN_NO_ERROR;
- }
- else if (lmb && lmb->message)
- {
- *log_msg = apr_pstrdup(pool, lmb->message);
- return SVN_NO_ERROR;
- }
-
- return SVN_NO_ERROR;
-}
-
-void *SVNClient::getCommitMessageBaton(const char *message)
-{
- if (message != NULL || m_commitMessage)
- {
- log_msg_baton *baton = (log_msg_baton *)
- apr_palloc(JNIUtil::getRequestPool()->pool(), sizeof(*baton));
-
- baton->message = message;
- baton->messageHandler = m_commitMessage;
-
- return baton;
- }
- return NULL;
-}
-
jbyteArray SVNClient::fileContent(const char *path, Revision &revision,
Revision &pegRevision)
{
@@ -1440,7 +1221,7 @@ svn_stream_t *SVNClient::createReadStrea
}
else
{
- svn_client_ctx_t *ctx = getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL);
if (ctx == NULL)
return NULL;
@@ -1464,7 +1245,7 @@ jbyteArray SVNClient::revProperty(const
Path intPath(path);
SVN_JNI_ERR(intPath.error_occured(), NULL);
- svn_client_ctx_t *ctx = getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL);
if (ctx == NULL)
return NULL;
@@ -1509,7 +1290,7 @@ void SVNClient::relocate(const char *fro
Path intTo(to);
SVN_JNI_ERR(intTo.error_occured(), );
- svn_client_ctx_t *ctx = getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL);
if (ctx == NULL)
return;
@@ -1529,7 +1310,7 @@ void SVNClient::blame(const char *path,
Path intPath(path);
SVN_JNI_ERR(intPath.error_occured(), );
- svn_client_ctx_t *ctx = getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL);
if (ctx == NULL)
return;
@@ -1543,47 +1324,11 @@ void SVNClient::blame(const char *path,
);
}
-void SVNClient::setConfigDirectory(const char *configDir)
-{
- // A change to the config directory may necessitate creation of
- // the config templates.
- SVN::Pool requestPool;
- SVN_JNI_ERR(svn_config_ensure(configDir, requestPool.pool()), );
-
- m_configDir = (configDir == NULL ? "" : configDir);
-}
-
-const char *SVNClient::getConfigDirectory()
-{
- return m_configDir.c_str();
-}
-
-void SVNClient::commitMessageHandler(CommitMessage *commitMessage)
-{
- delete m_commitMessage;
- m_commitMessage = commitMessage;
-}
-
-void SVNClient::cancelOperation()
-{
- m_cancelOperation = true;
-}
-
-svn_error_t *SVNClient::checkCancel(void *cancelBaton)
-{
- SVNClient *that = (SVNClient*)cancelBaton;
- if (that->m_cancelOperation)
- return svn_error_create(SVN_ERR_CANCELLED, NULL,
- _("Operation canceled"));
- else
- return SVN_NO_ERROR;
-}
-
void SVNClient::addToChangelist(Targets &srcPaths, const char *changelist,
svn_depth_t depth, StringArray &changelists)
{
SVN::Pool requestPool;
- svn_client_ctx_t *ctx = getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL);
const apr_array_header_t *srcs = srcPaths.array(requestPool);
SVN_JNI_ERR(srcPaths.error_occured(), );
@@ -1597,7 +1342,7 @@ void SVNClient::removeFromChangelists(Ta
StringArray &changelists)
{
SVN::Pool requestPool;
- svn_client_ctx_t *ctx = getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL);
const apr_array_header_t *srcs = srcPaths.array(requestPool);
SVN_JNI_ERR(srcPaths.error_occured(), );
@@ -1613,7 +1358,7 @@ void SVNClient::getChangelists(const cha
ChangelistCallback *callback)
{
SVN::Pool requestPool;
- svn_client_ctx_t *ctx = getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL);
SVN_JNI_ERR(svn_client_get_changelists(rootPath,
changelists.array(requestPool),
@@ -1627,7 +1372,7 @@ void SVNClient::lock(Targets &targets, c
SVN::Pool requestPool;
const apr_array_header_t *targetsApr = targets.array(requestPool);
SVN_JNI_ERR(targets.error_occured(), );
- svn_client_ctx_t *ctx = getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL);
SVN_JNI_ERR(svn_client_lock(targetsApr, comment, force, ctx,
requestPool.pool()), );
@@ -1639,7 +1384,7 @@ void SVNClient::unlock(Targets &targets,
const apr_array_header_t *targetsApr = targets.array(requestPool);
SVN_JNI_ERR(targets.error_occured(), );
- svn_client_ctx_t *ctx = getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL);
SVN_JNI_ERR(svn_client_unlock((apr_array_header_t*)targetsApr, force,
ctx, requestPool.pool()), );
}
@@ -1654,7 +1399,7 @@ void SVNClient::setRevProperty(const cha
Path intPath(path);
SVN_JNI_ERR(intPath.error_occured(), );
- svn_client_ctx_t *ctx = getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL);
if (ctx == NULL)
return;
@@ -1693,7 +1438,7 @@ jstring SVNClient::getVersionInfo(const
SVN_JNI_ERR(intPath.error_occured(), NULL);
int wc_format;
- svn_client_ctx_t *ctx = getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL);
if (ctx == NULL)
return NULL;
SVN_JNI_ERR(svn_wc_check_wc2(&wc_format, ctx->wc_ctx, intPath.c_str(),
@@ -1752,7 +1497,7 @@ void SVNClient::upgrade(const char *path
SVN::Pool requestPool;
SVN_JNI_NULL_PTR_EX(path, "path", );
- svn_client_ctx_t *ctx = getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL);
if (ctx == NULL)
return;
@@ -1770,7 +1515,7 @@ jobject SVNClient::revProperties(const c
Path intPath(path);
SVN_JNI_ERR(intPath.error_occured(), NULL);
- svn_client_ctx_t *ctx = getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL);
const char *URL;
svn_revnum_t set_rev;
SVN_JNI_ERR(svn_client_url_from_path2(&URL, intPath.c_str(), ctx,
@@ -1803,7 +1548,7 @@ SVNClient::info2(const char *path, Revis
SVN_JNI_NULL_PTR_EX(path, "path", );
SVN::Pool requestPool;
- svn_client_ctx_t *ctx = getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL);
if (ctx == NULL)
return;
@@ -1828,7 +1573,7 @@ SVNClient::patch(const char *patchPath,
SVN_JNI_NULL_PTR_EX(targetPath, "targetPath", );
SVN::Pool requestPool;
- svn_client_ctx_t *ctx = getContext(NULL);
+ svn_client_ctx_t *ctx = context.getContext(NULL);
if (ctx == NULL)
return;
@@ -1845,3 +1590,9 @@ SVNClient::patch(const char *patchPath,
ctx, requestPool.pool(),
requestPool.pool()), );
}
+
+ClientContext &
+SVNClient::getClientContext()
+{
+ return context;
+}
Modified: subversion/trunk/subversion/bindings/javahl/native/SVNClient.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/SVNClient.h?rev=989819&r1=989818&r2=989819&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/SVNClient.h (original)
+++ subversion/trunk/subversion/bindings/javahl/native/SVNClient.h Thu Aug 26 16:52:27 2010
@@ -31,6 +31,7 @@
#include <string>
#include <jni.h>
#include "Path.h"
+#include "ClientContext.h"
class Revision;
class RevisionRange;
@@ -70,16 +71,6 @@ class SVNClient :public SVNBase
void unlock(Targets &targets, bool force);
void lock(Targets &targets, const char *comment, bool force);
jobject revProperties(const char *path, Revision &revision);
- void cancelOperation();
- void commitMessageHandler(CommitMessage *commitMessage);
- const char *getConfigDirectory();
-
- /**
- * Set the configuration directory, taking the usual steps to
- * ensure that Subversion's config file templates exist in the
- * specified location.
- */
- void setConfigDirectory(const char *configDir);
void blame(const char *path, Revision &pegRevision,
Revision &revisionStart, Revision &revisionEnd,
@@ -151,9 +142,6 @@ class SVNClient :public SVNBase
void remove(Targets &targets, const char *message, bool force,
bool keep_local, RevpropTable &revprops,
CommitCallback *callback);
- void notification2(ClientNotifyCallback *notify2);
- void setConflictResolver(ConflictResolverCallback *conflictResolver);
- void setProgressListener(ProgressListener *progressListener);
jlong checkout(const char *moduleName, const char *destPath,
Revision &revision, Revision &pegRevsion, svn_depth_t depth,
bool ignoreExternals, bool allowUnverObstructions);
@@ -162,9 +150,6 @@ class SVNClient :public SVNBase
bool discoverPaths, bool includeMergedRevisions,
StringArray &revProps,
long limit, LogMessageCallback *callback);
- void setPrompt(Prompter *prompter);
- void password(const char *pi_password);
- void username(const char *pi_username);
jstring getAdminDirectoryName();
jboolean isAdminDirectory(const char *name);
void addToChangelist(Targets &srcPaths, const char *changelist,
@@ -209,14 +194,14 @@ class SVNClient :public SVNBase
svn_depth_t depth, StringArray &changelists,
bool ignoreAncestry, DiffSummaryReceiver &receiver);
+ ClientContext &getClientContext();
+
const char *getLastPath();
void dispose();
static SVNClient *getCppObject(jobject jthis);
SVNClient();
virtual ~SVNClient();
private:
- static svn_error_t *checkCancel(void *cancelBaton);
- svn_client_ctx_t *getContext(const char *message);
svn_stream_t *createReadStream(apr_pool_t *pool, const char *path,
Revision &revision, Revision &pegRevision,
size_t &size);
@@ -232,31 +217,8 @@ class SVNClient :public SVNBase
bool ignoreAncestry, bool noDiffDelete, bool force,
bool showCopiesAsAdds);
- ClientNotifyCallback *m_notify2;
- ConflictResolverCallback *m_conflictResolver;
- ProgressListener *m_progressListener;
- Prompter *m_prompter;
Path m_lastPath;
- bool m_cancelOperation;
- CommitMessage *m_commitMessage;
-
- /**
- * Implements the svn_client_get_commit_log3_t API.
- */
- static svn_error_t *getCommitMessage(const char **log_msg,
- const char **tmp_file,
- const apr_array_header_t *
- commit_items,
- void *baton,
- apr_pool_t *pool);
- /**
- * Produce a baton for the getCommitMessage() callback.
- */
- void *getCommitMessageBaton(const char *message);
-
- std::string m_userName;
- std::string m_passWord;
- std::string m_configDir;
+ ClientContext context;
};
#endif // SVNCLIENT_H
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=989819&r1=989818&r2=989819&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 Thu Aug 26 16:52:27 2010
@@ -213,7 +213,7 @@ Java_org_apache_subversion_javahl_SVNCli
if (JNIUtil::isExceptionThrown())
return;
- cl->username(username);
+ cl->getClientContext().username(username);
}
JNIEXPORT void JNICALL
@@ -237,7 +237,7 @@ Java_org_apache_subversion_javahl_SVNCli
if (JNIUtil::isExceptionThrown())
return;
- cl->password(password);
+ cl->getClientContext().password(password);
}
JNIEXPORT void JNICALL
@@ -255,7 +255,7 @@ Java_org_apache_subversion_javahl_SVNCli
if (JNIUtil::isExceptionThrown())
return;
- cl->setPrompt(prompter);
+ cl->getClientContext().setPrompt(prompter);
}
JNIEXPORT void JNICALL
@@ -360,7 +360,7 @@ Java_org_apache_subversion_javahl_SVNCli
if (JNIUtil::isExceptionThrown())
return;
- cl->notification2(notify2);
+ cl->getClientContext().notification2(notify2);
}
JNIEXPORT void JNICALL
@@ -379,7 +379,7 @@ Java_org_apache_subversion_javahl_SVNCli
if (JNIUtil::isExceptionThrown())
return;
- cl->setConflictResolver(listener);
+ cl->getClientContext().setConflictResolver(listener);
}
JNIEXPORT void JNICALL
@@ -398,7 +398,7 @@ Java_org_apache_subversion_javahl_SVNCli
if (JNIUtil::isExceptionThrown())
return;
- cl->setProgressListener(listener);
+ cl->getClientContext().setProgressListener(listener);
}
JNIEXPORT void JNICALL
@@ -417,7 +417,7 @@ Java_org_apache_subversion_javahl_SVNCli
if (JNIUtil::isExceptionThrown())
return;
- cl->commitMessageHandler(commitMessage);
+ cl->getClientContext().commitMessageHandler(commitMessage);
}
JNIEXPORT void JNICALL
@@ -1588,7 +1588,7 @@ Java_org_apache_subversion_javahl_SVNCli
if (JNIUtil::isExceptionThrown())
return;
- cl->setConfigDirectory(configDir);
+ cl->getClientContext().setConfigDirectory(configDir);
}
JNIEXPORT jstring JNICALL
@@ -1603,7 +1603,7 @@ Java_org_apache_subversion_javahl_SVNCli
return NULL;
}
- const char *configDir = cl->getConfigDirectory();
+ const char *configDir = cl->getClientContext().getConfigDirectory();
return JNIUtil::makeJString(configDir);
}
@@ -1618,7 +1618,7 @@ Java_org_apache_subversion_javahl_SVNCli
JNIUtil::throwError("bad C++ this");
return;
}
- cl->cancelOperation();
+ cl->getClientContext().cancelOperation();
}
JNIEXPORT void JNICALL