subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hwri...@apache.org
Subject svn commit: r997237 - in /subversion/trunk/subversion/bindings/javahl/native: ClientContext.cpp ClientContext.h SVNClient.cpp
Date Wed, 15 Sep 2010 09:17:34 GMT
Author: hwright
Date: Wed Sep 15 09:17:34 2010
New Revision: 997237

URL: http://svn.apache.org/viewvc?rev=997237&view=rev
Log:
Revert r997228.  Apparently, some of the improved error handling added in that
revision wasn't to friendly with the tests.  It will require further digging,
but I'm reverting in the intrim.

Modified:
    subversion/trunk/subversion/bindings/javahl/native/ClientContext.cpp
    subversion/trunk/subversion/bindings/javahl/native/ClientContext.h
    subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp

Modified: subversion/trunk/subversion/bindings/javahl/native/ClientContext.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/ClientContext.cpp?rev=997237&r1=997236&r2=997237&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/ClientContext.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/ClientContext.cpp Wed Sep 15 09:17:34
2010
@@ -97,20 +97,20 @@ ClientContext::~ClientContext()
     env->DeleteGlobalRef(m_jctx);
 }
 
-svn_error_t *
-ClientContext::getContext(svn_client_ctx_t **ctx, CommitMessage *message)
+svn_client_ctx_t *
+ClientContext::getContext(CommitMessage *message)
 {
     SVN::Pool *requestPool = JNIUtil::getRequestPool();
     apr_pool_t *pool = requestPool->pool();
     svn_auth_baton_t *ab;
-
-    *ctx = persistentCtx;
+    svn_client_ctx_t *ctx = persistentCtx;
+    //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_ERR(svn_config_get_config(&((*ctx)->config), configDir, pool));
-    svn_config_t *config = (svn_config_t *) apr_hash_get((*ctx)->config,
+    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);
 
@@ -118,8 +118,10 @@ ClientContext::getContext(svn_client_ctx
     apr_array_header_t *providers;
 
     /* Populate the registered providers with the platform-specific providers */
-    SVN_ERR(svn_auth_get_platform_specific_client_providers(&providers,
-                                                            config, pool));
+    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. */
@@ -148,10 +150,11 @@ ClientContext::getContext(svn_client_ctx
     APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
 
     /* The server-cert, client-cert, and client-cert-password providers. */
-    SVN_ERR(svn_auth_get_platform_specific_provider(&provider,
-                                                    "windows",
-                                                    "ssl_server_trust",
-                                                    pool));
+    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;
@@ -199,11 +202,11 @@ ClientContext::getContext(svn_client_ctx
         svn_auth_set_parameter(ab, SVN_AUTH_PARAM_DEFAULT_PASSWORD,
                                m_passWord.c_str());
 
-    (*ctx)->auth_baton = ab;
-    (*ctx)->log_msg_baton3 = message;
+    ctx->auth_baton = ab;
+    ctx->log_msg_baton3 = message;
     m_cancelOperation = false;
 
-    return SVN_NO_ERROR;
+    return ctx;
 }
 
 void

Modified: subversion/trunk/subversion/bindings/javahl/native/ClientContext.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/ClientContext.h?rev=997237&r1=997236&r2=997237&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/ClientContext.h (original)
+++ subversion/trunk/subversion/bindings/javahl/native/ClientContext.h Wed Sep 15 09:17:34
2010
@@ -74,7 +74,7 @@ class ClientContext
 
   static svn_error_t *checkCancel(void *cancelBaton);
 
-  svn_error_t *getContext(svn_client_ctx_t **ctx, CommitMessage *message);
+  svn_client_ctx_t *getContext(CommitMessage *message);
 
   void username(const char *pi_username);
   void password(const char *pi_password);

Modified: subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp?rev=997237&r1=997236&r2=997237&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp Wed Sep 15 09:17:34 2010
@@ -122,8 +122,9 @@ void SVNClient::list(const char *url, Re
                      ListCallback *callback)
 {
     SVN::Pool requestPool;
-    svn_client_ctx_t *ctx;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), );
+    svn_client_ctx_t *ctx = context.getContext(NULL);
+    if (ctx == NULL)
+        return;
 
     SVN_JNI_NULL_PTR_EX(url, "path or url", );
 
@@ -153,8 +154,9 @@ SVNClient::status(const char *path, svn_
 
     SVN_JNI_NULL_PTR_EX(path, "path", );
 
-    svn_client_ctx_t *ctx;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), );
+    svn_client_ctx_t *ctx = context.getContext(NULL);
+    if (ctx == NULL)
+        return;
     callback->setWcCtx(ctx->wc_ctx);
 
     Path checkedPath(path);
@@ -182,8 +184,9 @@ void SVNClient::logMessages(const char *
 
     SVN_JNI_NULL_PTR_EX(path, "path", );
 
-    svn_client_ctx_t *ctx;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), );
+    svn_client_ctx_t *ctx = context.getContext(NULL);
+    if (ctx == NULL)
+        return;
 
     Targets target(path);
     const apr_array_header_t *targets = target.array(requestPool);
@@ -242,8 +245,9 @@ jlong SVNClient::checkout(const char *mo
     SVN_JNI_ERR(path.error_occured(), -1);
     svn_revnum_t rev;
 
-    svn_client_ctx_t *ctx;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), -1);
+    svn_client_ctx_t *ctx = context.getContext(NULL);
+    if (ctx == NULL)
+        return -1;
 
     SVN_JNI_ERR(svn_client_checkout3(&rev, url.c_str(),
                                      path.c_str(),
@@ -264,8 +268,9 @@ void SVNClient::remove(Targets &targets,
                        CommitCallback *callback)
 {
     SVN::Pool requestPool;
-    svn_client_ctx_t *ctx;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), );
+    svn_client_ctx_t *ctx = context.getContext(message);
+    if (ctx == NULL)
+        return;
 
     const apr_array_header_t *targets2 = targets.array(requestPool);
     SVN_JNI_ERR(targets.error_occured(), );
@@ -283,8 +288,9 @@ void SVNClient::revert(const char *path,
 
     SVN_JNI_NULL_PTR_EX(path, "path", );
 
-    svn_client_ctx_t *ctx;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), );
+    svn_client_ctx_t *ctx = context.getContext(NULL);
+    if (ctx == NULL)
+        return;
 
     Targets target(path);
     const apr_array_header_t *targets = target.array(requestPool);
@@ -304,8 +310,9 @@ void SVNClient::add(const char *path,
 
     Path intPath(path);
     SVN_JNI_ERR(intPath.error_occured(), );
-    svn_client_ctx_t *ctx;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), );
+    svn_client_ctx_t *ctx = context.getContext(NULL);
+    if (ctx == NULL)
+        return;
 
     SVN_JNI_ERR(svn_client_add4(intPath.c_str(), depth, force,
                                 no_ignore, add_parents, ctx,
@@ -319,9 +326,10 @@ jlongArray SVNClient::update(Targets &ta
 {
     SVN::Pool requestPool;
 
+    svn_client_ctx_t *ctx = context.getContext(NULL);
     apr_array_header_t *revs;
-    svn_client_ctx_t *ctx;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), NULL);
+    if (ctx == NULL)
+        return NULL;
 
     const apr_array_header_t *array = targets.array(requestPool);
     SVN_JNI_ERR(targets.error_occured(), NULL);
@@ -359,8 +367,9 @@ 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;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), );
+    svn_client_ctx_t *ctx = context.getContext(message);
+    if (ctx == NULL)
+        return;
 
     SVN_JNI_ERR(svn_client_commit5(targets2, depth,
                                    noUnlock, keepChangelist,
@@ -389,8 +398,9 @@ void SVNClient::copy(CopySources &copySo
     Path destinationPath(destPath);
     SVN_JNI_ERR(destinationPath.error_occured(), );
 
-    svn_client_ctx_t *ctx;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), );
+    svn_client_ctx_t *ctx = context.getContext(message);
+    if (ctx == NULL)
+        return;
 
     SVN_JNI_ERR(svn_client_copy6(srcs, destinationPath.c_str(),
                                  copyAsChild, makeParents, ignoreExternals,
@@ -412,8 +422,9 @@ void SVNClient::move(Targets &srcPaths, 
     Path destinationPath(destPath);
     SVN_JNI_ERR(destinationPath.error_occured(), );
 
-    svn_client_ctx_t *ctx;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), );
+    svn_client_ctx_t *ctx = context.getContext(message);
+    if (ctx == NULL)
+        return;
 
     SVN_JNI_ERR(svn_client_move6((apr_array_header_t *) srcs,
                                  destinationPath.c_str(), force, moveAsChild,
@@ -427,8 +438,9 @@ void SVNClient::mkdir(Targets &targets, 
                       CommitCallback *callback)
 {
     SVN::Pool requestPool;
-    svn_client_ctx_t *ctx;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), );
+    svn_client_ctx_t *ctx = context.getContext(message);
+    if (ctx == NULL)
+        return;
 
     const apr_array_header_t *targets2 = targets.array(requestPool);
     SVN_JNI_ERR(targets.error_occured(), );
@@ -446,8 +458,9 @@ void SVNClient::cleanup(const char *path
     Path intPath(path);
     SVN_JNI_ERR(intPath.error_occured(), );
 
-    svn_client_ctx_t *ctx;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), );
+    svn_client_ctx_t *ctx = context.getContext(NULL);
+    if (ctx == NULL)
+        return;
 
     SVN_JNI_ERR(svn_client_cleanup(intPath.c_str(), ctx, requestPool.pool()),);
 }
@@ -459,8 +472,9 @@ 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;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), );
+    svn_client_ctx_t *ctx = context.getContext(NULL);
+    if (ctx == NULL)
+        return;
 
     SVN_JNI_ERR(svn_client_resolve(intPath.c_str(), depth, choice,
                                    ctx, requestPool.pool()), );
@@ -479,8 +493,9 @@ 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;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), -1);
+    svn_client_ctx_t *ctx = context.getContext(NULL);
+    if (ctx == NULL)
+        return -1;
 
     SVN_JNI_ERR(svn_client_export4(&rev, sourcePath.c_str(),
                                    destinationPath.c_str(),
@@ -511,8 +526,9 @@ jlong SVNClient::doSwitch(const char *pa
     SVN_JNI_ERR(intPath.error_occured(), -1);
 
     svn_revnum_t rev;
-    svn_client_ctx_t *ctx;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), -1);
+    svn_client_ctx_t *ctx = context.getContext(NULL);
+    if (ctx == NULL)
+        return -1;
 
     SVN_JNI_ERR(svn_client_switch2(&rev, intPath.c_str(),
                                    intUrl.c_str(),
@@ -542,8 +558,9 @@ void SVNClient::doImport(const char *pat
     Path intUrl(url);
     SVN_JNI_ERR(intUrl.error_occured(), );
 
-    svn_client_ctx_t *ctx;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), );
+    svn_client_ctx_t *ctx = context.getContext(message);
+    if (ctx == NULL)
+        return;
 
     SVN_JNI_ERR(svn_client_import4(intPath.c_str(), intUrl.c_str(), depth,
                                    noIgnore, ignoreUnknownNodeTypes,
@@ -556,8 +573,9 @@ jobject
 SVNClient::suggestMergeSources(const char *path, Revision &pegRevision)
 {
     SVN::Pool requestPool;
-    svn_client_ctx_t *ctx;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), NULL);
+    svn_client_ctx_t *ctx = context.getContext(NULL);
+    if (ctx == NULL)
+        return NULL;
 
     apr_array_header_t *sources;
     SVN_JNI_ERR(svn_client_suggest_merge_sources(&sources, path,
@@ -586,8 +604,9 @@ void SVNClient::merge(const char *path1,
     Path srcPath2 = path2;
     SVN_JNI_ERR(srcPath2.error_occured(), );
 
-    svn_client_ctx_t *ctx;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), );
+    svn_client_ctx_t *ctx = context.getContext(NULL);
+    if (ctx == NULL)
+        return;
 
     SVN_JNI_ERR(svn_client_merge3(srcPath1.c_str(), revision1.revision(),
                                   srcPath2.c_str(), revision2.revision(),
@@ -611,8 +630,9 @@ void SVNClient::merge(const char *path, 
     Path srcPath(path);
     SVN_JNI_ERR(srcPath.error_occured(), );
 
-    svn_client_ctx_t *ctx;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), );
+    svn_client_ctx_t *ctx = context.getContext(NULL);
+    if (ctx == NULL)
+        return;
 
     apr_array_header_t *ranges =
       apr_array_make(requestPool.pool(), rangesToMerge.size(),
@@ -665,8 +685,9 @@ void SVNClient::mergeReintegrate(const c
     Path srcPath(path);
     SVN_JNI_ERR(srcPath.error_occured(), );
 
-    svn_client_ctx_t *ctx;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), );
+    svn_client_ctx_t *ctx = context.getContext(NULL);
+    if (ctx == NULL)
+        return;
 
     SVN_JNI_ERR(svn_client_merge_reintegrate(srcPath.c_str(),
                                              pegRevision.revision(),
@@ -681,8 +702,9 @@ SVNClient::getMergeinfo(const char *targ
     SVN::Pool requestPool;
     JNIEnv *env = JNIUtil::getEnv();
 
-    svn_client_ctx_t *ctx;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), NULL);
+    svn_client_ctx_t *ctx = context.getContext(NULL);
+    if (ctx == NULL)
+        return NULL;
 
     svn_mergeinfo_t mergeinfo;
     Path intLocalTarget(target);
@@ -757,8 +779,9 @@ void SVNClient::getMergeinfoLog(int type
 {
     SVN::Pool requestPool;
 
-    svn_client_ctx_t *ctx;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), );
+    svn_client_ctx_t *ctx = context.getContext(NULL);
+    if (ctx == NULL)
+        return;
 
     SVN_JNI_NULL_PTR_EX(pathOrURL, "path or url", );
     Path urlPath(pathOrURL);
@@ -796,8 +819,9 @@ jbyteArray SVNClient::propertyGet(const 
     Path intPath(path);
     SVN_JNI_ERR(intPath.error_occured(), NULL);
 
-    svn_client_ctx_t *ctx;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), NULL);
+    svn_client_ctx_t *ctx = context.getContext(NULL);
+    if (ctx == NULL)
+        return NULL;
 
     apr_hash_t *props;
     SVN_JNI_ERR(svn_client_propget3(&props, name,
@@ -831,8 +855,9 @@ void SVNClient::properties(const char *p
     Path intPath(path);
     SVN_JNI_ERR(intPath.error_occured(), );
 
-    svn_client_ctx_t *ctx;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), );
+    svn_client_ctx_t *ctx = context.getContext(NULL);
+    if (ctx == NULL)
+        return;
 
     SVN_JNI_ERR(svn_client_proplist3(intPath.c_str(), pegRevision.revision(),
                                      revision.revision(), depth,
@@ -861,8 +886,9 @@ void SVNClient::propertySet(const char *
     Path intPath(path);
     SVN_JNI_ERR(intPath.error_occured(), );
 
-    svn_client_ctx_t *ctx;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), );
+    svn_client_ctx_t *ctx = context.getContext(NULL);
+    if (ctx == NULL)
+        return;
 
     SVN_JNI_ERR(svn_client_propset4(name, val, intPath.c_str(),
                                     depth, force, SVN_INVALID_REVNUM,
@@ -892,8 +918,9 @@ 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;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), );
+    svn_client_ctx_t *ctx = context.getContext(NULL);
+    if (ctx == NULL)
+        return;
 
     Path path1(target1);
     SVN_JNI_ERR(path1.error_occured(), );
@@ -1018,8 +1045,9 @@ SVNClient::diffSummarize(const char *tar
     SVN_JNI_NULL_PTR_EX(target1, "target1", );
     SVN_JNI_NULL_PTR_EX(target2, "target2", );
 
-    svn_client_ctx_t *ctx;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), );
+    svn_client_ctx_t *ctx = context.getContext(NULL);
+    if (ctx == NULL)
+        return;
 
     Path path1(target1);
     SVN_JNI_ERR(path1.error_occured(), );
@@ -1046,8 +1074,9 @@ SVNClient::diffSummarize(const char *tar
 
     SVN_JNI_NULL_PTR_EX(target, "target", );
 
-    svn_client_ctx_t *ctx;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), );
+    svn_client_ctx_t *ctx = context.getContext(NULL);
+    if (ctx == NULL)
+        return;
 
     Path path(target);
     SVN_JNI_ERR(path.error_occured(), );
@@ -1190,8 +1219,9 @@ svn_stream_t *SVNClient::createReadStrea
     }
     else
     {
-        svn_client_ctx_t *ctx;
-        SVN_JNI_ERR(context.getContext(&ctx, NULL), NULL);
+        svn_client_ctx_t *ctx = context.getContext(NULL);
+        if (ctx == NULL)
+            return NULL;
 
         svn_stringbuf_t *buf = svn_stringbuf_create("", pool);
         read_stream = svn_stream_from_stringbuf(buf, pool);
@@ -1213,8 +1243,9 @@ jbyteArray SVNClient::revProperty(const 
     Path intPath(path);
     SVN_JNI_ERR(intPath.error_occured(), NULL);
 
-    svn_client_ctx_t *ctx;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), NULL);
+    svn_client_ctx_t *ctx = context.getContext(NULL);
+    if (ctx == NULL)
+        return NULL;
 
     const char *URL;
     svn_string_t *propval;
@@ -1257,8 +1288,9 @@ void SVNClient::relocate(const char *fro
     Path intTo(to);
     SVN_JNI_ERR(intTo.error_occured(), );
 
-    svn_client_ctx_t *ctx;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), );
+    svn_client_ctx_t *ctx = context.getContext(NULL);
+    if (ctx == NULL)
+        return;
 
     SVN_JNI_ERR(svn_client_relocate(intPath.c_str(), intFrom.c_str(),
                                     intTo.c_str(), recurse, ctx,
@@ -1276,8 +1308,9 @@ void SVNClient::blame(const char *path, 
     Path intPath(path);
     SVN_JNI_ERR(intPath.error_occured(), );
 
-    svn_client_ctx_t *ctx;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), );
+    svn_client_ctx_t *ctx = context.getContext(NULL);
+    if (ctx == NULL)
+        return;
 
     SVN_JNI_ERR(svn_client_blame5(intPath.c_str(), pegRevision.revision(),
                                   revisionStart.revision(),
@@ -1293,8 +1326,7 @@ void SVNClient::addToChangelist(Targets 
                                 svn_depth_t depth, StringArray &changelists)
 {
     SVN::Pool requestPool;
-    svn_client_ctx_t *ctx;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), );
+    svn_client_ctx_t *ctx = context.getContext(NULL);
 
     const apr_array_header_t *srcs = srcPaths.array(requestPool);
     SVN_JNI_ERR(srcPaths.error_occured(), );
@@ -1308,8 +1340,7 @@ void SVNClient::removeFromChangelists(Ta
                                       StringArray &changelists)
 {
     SVN::Pool requestPool;
-    svn_client_ctx_t *ctx;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), );
+    svn_client_ctx_t *ctx = context.getContext(NULL);
 
     const apr_array_header_t *srcs = srcPaths.array(requestPool);
     SVN_JNI_ERR(srcPaths.error_occured(), );
@@ -1325,8 +1356,7 @@ void SVNClient::getChangelists(const cha
                                ChangelistCallback *callback)
 {
     SVN::Pool requestPool;
-    svn_client_ctx_t *ctx;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), );
+    svn_client_ctx_t *ctx = context.getContext(NULL);
 
     SVN_JNI_ERR(svn_client_get_changelists(rootPath,
                                            changelists.array(requestPool),
@@ -1340,8 +1370,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;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), );
+    svn_client_ctx_t *ctx = context.getContext(NULL);
 
     SVN_JNI_ERR(svn_client_lock(targetsApr, comment, force, ctx,
                                 requestPool.pool()), );
@@ -1353,8 +1382,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;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), );
+    svn_client_ctx_t *ctx = context.getContext(NULL);
     SVN_JNI_ERR(svn_client_unlock((apr_array_header_t*)targetsApr, force,
                                   ctx, requestPool.pool()), );
 }
@@ -1369,8 +1397,9 @@ void SVNClient::setRevProperty(const cha
     Path intPath(path);
     SVN_JNI_ERR(intPath.error_occured(), );
 
-    svn_client_ctx_t *ctx;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), );
+    svn_client_ctx_t *ctx = context.getContext(NULL);
+    if (ctx == NULL)
+        return;
 
     const char *URL;
     SVN_JNI_ERR(svn_client_url_from_path2(&URL, intPath.c_str(), ctx,
@@ -1407,9 +1436,9 @@ jstring SVNClient::getVersionInfo(const 
     SVN_JNI_ERR(intPath.error_occured(), NULL);
 
     int wc_format;
-
-    svn_client_ctx_t *ctx;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), 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(),
                                  requestPool.pool()),
                 NULL);
@@ -1466,8 +1495,9 @@ void SVNClient::upgrade(const char *path
     SVN::Pool requestPool;
     SVN_JNI_NULL_PTR_EX(path, "path", );
 
-    svn_client_ctx_t *ctx;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), );
+    svn_client_ctx_t *ctx = context.getContext(NULL);
+    if (ctx == NULL)
+        return;
 
     Path checkedPath(path);
     SVN_JNI_ERR(checkedPath.error_occured(), );
@@ -1483,9 +1513,7 @@ jobject SVNClient::revProperties(const c
     Path intPath(path);
     SVN_JNI_ERR(intPath.error_occured(), NULL);
 
-    svn_client_ctx_t *ctx;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), 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,
@@ -1518,8 +1546,9 @@ SVNClient::info2(const char *path, Revis
     SVN_JNI_NULL_PTR_EX(path, "path", );
 
     SVN::Pool requestPool;
-    svn_client_ctx_t *ctx;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), );
+    svn_client_ctx_t *ctx = context.getContext(NULL);
+    if (ctx == NULL)
+        return;
 
     Path checkedPath(path);
     SVN_JNI_ERR(checkedPath.error_occured(), );
@@ -1542,8 +1571,9 @@ SVNClient::patch(const char *patchPath, 
     SVN_JNI_NULL_PTR_EX(targetPath, "targetPath", );
 
     SVN::Pool requestPool;
-    svn_client_ctx_t *ctx;
-    SVN_JNI_ERR(context.getContext(&ctx, NULL), );
+    svn_client_ctx_t *ctx = context.getContext(NULL);
+    if (ctx == NULL)
+        return;
 
     Path checkedPatchPath(patchPath);
     SVN_JNI_ERR(checkedPatchPath.error_occured(), );



Mime
View raw message