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

Re: Looking for auth. info. in the WC

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2003-09-24 21:21:25 CEST

Greg Stein wrote:
> On Wed, Sep 24, 2003 at 11:59:35AM +0100, Julian Foad wrote:
>>...
>>BTW, at first I assumed that svn_client__default_auth_dir got the new
>>home-directory location, but it doesn't: it just tries the current and
>>parent WC directories, very similar to __dir_if_wc. So I can also delete
>>those two functions, which have no other use. (I searched.)
>
> Excellent.
>
>>I was unable to follow usage of this base_dir parameter down through
>>svn_ra_dav__open, so I don't know for sure that it doesn't still try to
>>use it. However, such usage is not documented for
>>svn_client__open_ra_session, and it was always able to work with NULL
>>(when the current directory is not a WC), so this should all be quite
>>safe.
>
> No. That parameter is necessary. When provided, it enables the RA layer to
> fetch wcprop values. If you pass NULL, then you "hide" all wcprops from
> the RA layer. That means that ra_dav will need to make a bunch of round
> trips to the server to figure out the missing values. Quite awful.

> Any change in this space will need to retain that parameter. It should
> probably just point to the directory corresponding to the root of the RA
> session.

I'm confused.

What is the difference between that and the "base_access" parameter then? I mean, I know one's a string and the other's a structure, but I thought "base_access" was the one that allowed it to access the wcprops etc. From the doc string:

  The root of the session is specified by BASE_URL and BASE_DIR.
  BASE_ACCESS is an access baton for BASE_DIR administrative data.

At the points of call when base_access is null, the comments say things like:

  /* Open an RA session for the URL. Note that we don't have a local
     directory, nor a place to put temp files or store the auth
     data, although we'll try to retrieve auth data from the
     current directory. */
  SVN_ERR (svn_client__dir_if_wc (&auth_dir, "", pool));
  SVN_ERR (svn_client__open_ra_session (&session, ra_lib, common, auth_dir,
                                        NULL, NULL, FALSE, TRUE,
                                        ctx, pool));

Where is the clue that the "auth_dir" (= base_dir) parameter is used for anything but auth info? Does the doc string for svn_client__open_ra_session need to be updated?

- Julian

[For reference, from client.h:]

/* Open an RA session, returning the session baton in SESSION_BATON. The
   RA library to use is specified by RA_LIB.

   The root of the session is specified by BASE_URL and BASE_DIR.
   BASE_ACCESS is an access baton for BASE_DIR administrative data.

   Additional control parameters:

      - COMMIT_ITEMS is an array of svn_client_commit_item_t *
        structures, present only for working copy commits, NULL otherwise.

      - USE_ADMIN indicates that the RA layer should create tempfiles
        in the administrative area instead of in the working copy itself.

      - READ_ONLY_WC indicates that the RA layer should not attempt
        modify the WC props directly.

   BASE_DIR may be NULL if the RA operation does not correspond to a
   working copy (in which case, USE_ADMIN should be FALSE, and
   BASE_ACCESS should be null).

   The calling application's authentication baton is provided in CTX,
   and allocations related to this session are performed in POOL. */
svn_error_t * svn_client__open_ra_session (void **session_baton,
                                           const svn_ra_plugin_t *ra_lib,
                                           const char *base_url,
                                           const char *base_dir,
                                           svn_wc_adm_access_t *base_access,
                                           apr_array_header_t *commit_items,
                                           svn_boolean_t use_admin,
                                           svn_boolean_t read_only_wc,
                                           svn_client_ctx_t *ctx,
                                           apr_pool_t *pool);

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Sep 24 21:24:24 2003

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.