[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] No error dialog if lock command failed

From: Andriy Kulchytskyy <whoops_at_ukrtop.com>
Date: 2005-08-30 17:46:20 CEST

Hello,

There is no error dialog (and no exception thrown) if lock command
failed. I am using subclipse (JavaHL interface).

Probably bug is in JavaHL library in file SVNClient.cpp
http://svn.collab.net/repos/svn/trunk/subversion/bindings/java/javahl/native/SVNClient.cpp

Method: SVNClient::lock (line 3072)

void SVNClient::lock(Targets &targets, const char *comment,
                        bool force)
{
    Pool requestPool;
    const apr_array_header_t *targetsApr = targets.array(requestPool);
    svn_error_t *Err = targets.error_occured(); // one *Err variable
    if(Err != NULL)
    {
        JNIUtil::handleSVNError(Err);
        return;
    }
    apr_pool_t * apr_pool = requestPool.pool ();
    svn_client_ctx_t *ctx = getContext(NULL);
    svn_error_t *err = svn_client_lock(targetsApr, // !!! another *err variable
        comment, force, ctx, apr_pool);

    if (Err != NULL) // !!! but checked the first one
    {
        JNIUtil::handleSVNError(err);
    }
}

The correct code should be:

void SVNClient::lock(Targets &targets, const char *comment,
                        bool force)
{
    Pool requestPool;
    const apr_array_header_t *targetsApr = targets.array(requestPool);
    svn_error_t *Err = targets.error_occured();
    if(Err != NULL)
    {
        JNIUtil::handleSVNError(Err);
        return;
    }
    apr_pool_t * apr_pool = requestPool.pool ();
    svn_client_ctx_t *ctx = getContext(NULL);
    Err = svn_client_lock(targetsApr,
        comment, force, ctx, apr_pool);

    if (Err != NULL)
    {
        JNIUtil::handleSVNError(err);
    }
}

-- 
Best regards,
 Andriy                          mailto:whoops@ukrtop.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Tue Aug 30 16:46:39 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.