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

API Questions -> svn_client_status2

From: Matt Daniel <Matt.Daniel_at_invetech.com.au>
Date: 2005-05-26 07:21:31 CEST

Hi

I am trying to use the API, I need to know if a file is under src control and then if a property has been set. I am using the svn_client_status2.

when I use it the error I get back is path is not a working copy. what should path be ?
1) a path to file ? D:\a\b.text
2) with file:\\ added in front file:\\d:\a\b.text
3) URL combination etc.. ??

any help greatly appreciated

thanks
Matt
error ==>
+ (*err).message 0x0186dd10 "'file:\d:\mxd\argh\SVNpython\Attribute.py' is not a working copy"
Code
==
   char MYREPO[] =
                                          "file:\\d:\\mxd\\argh\\SVNpython\\Attribute.py";
       // "d:\\mxd\\argh\\SVNpython\\Attribute.py";
        //"http://svn.here.com.au/svn/project/SVNpython/Attribute.py";
    svn_revnum_t result_rev;
    const char* path;
    svn_opt_revision_t revision;
    svn_boolean_t recurse = TRUE;
    svn_boolean_t get_all = TRUE;
    svn_boolean_t update = TRUE;
    svn_boolean_t no_ignore = TRUE;
    svn_boolean_t ignore_externals = TRUE;
    svn_client_ctx_t* ctx;
    status_baton sb;
    svn_error_t* err;
    /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

    if ( apr_allocator_create ( &allocator ) )
    {
        return ( false );
    }

    svn_client_create_context ( &ctx, pool );

    // wchar2char ( filePath, path );
    ctx->config = apr_hash_make ( pool );

    //
    // Setup the notification and cancellation callbacks, and their shared
    // baton ( which is also shared with the status function ).
    //
    ctx->notify_func = notify;
    ctx->notify_baton = &sb;
    ctx->cancel_func = cancel;
    ctx->cancel_baton = &sb;

    // wchar2char ( MYREPO.c_str (), path );
    sb.locked = FALSE;
    sb.underDMS = FALSE;
    sb.underSrcControl = FALSE;
    path = svn_path_uri_decode ( MYREPO, pool );

    // /* We want our -u statuses to be against HEAD.
    revision.kind = svn_opt_revision_head;

    if ( DMS_Available ( filePath ) )
    {
        err = svn_client_status2 ( &result_rev,
                                   path,
                                   &revision,
                                   status_func,
                                   &sb,
                                   recurse,
                                   get_all,
                                   update,
                                   no_ignore,
                                   ignore_externals,
                                   ctx,
                                   pool );
        if ( err && (err->apr_err == SVN_ERR_CANCELLED) )
        {
            svn_error_clear ( err );
        }
        else
        {
            SVN_INT_ERR ( err );
        }
    }

    return ( sb.underDMS == TRUE );

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu May 26 07:23:31 2005

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

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