Login | Register
My pages Projects Community openCollabNet

Discussions > dev [DISABLED] > RE: Trouble replacing adm_access in libsvn_client/merge.c (merge_file_changed)

subversion
Discussion topic

Back to topic list

RE: Trouble replacing adm_access in libsvn_client/merge.c (merge_file_changed)

Author rhuijben
Full name Bert Huijben
Date 2009-08-25 06:22:29 PDT
Message > -----Original Message-----
> From: Daniel Näslund [mailto:daniel at longitudo dot com]
> Sent: dinsdag 25 augustus 2009 15:13
> To: dev at subversion dot tigris dot org
> Subject: Re: Trouble replacing adm_access in libsvn_client/merge.c
> (merge_file_changed)
>
> On Tue, Aug 25, 2009 at 02:52:53PM +0200, Hyrum K. Wright wrote:
> > On Aug 25, 2009, at 2:46 PM, Bert Huijben wrote:
>
> > > Yes, please add a svn_wc__adm_retrieve​_(with/via/...?)_con​text()
> > > helper.
> > >
> > > I think that would be a useful helper in more places of
> > > libsvn_client, until libsvn_wc accepts wc_ctx, abspath everywhere.
> >
> > Note that we already have a svn_wc__adm_retrieve​_internal2() API
> which
> > accepts an wc_db and abspath, and just fetches the baton from the
> db's
> > set of cached batons. Perhaps this might be of some use. One catch
> > here is that the *type* of the baton needs to be correct. In other
> > words, we should return a cached read baton, when the caller asks for
> > a read/write baton. (I tried making *all* batons read/write at one
> > point, but that introduces problems of it's own, believe it or not.)
>
> I was planning on just wrapping svn_wc__adm_retrieve​_internal2() and
> feed it with the db of the wc_ctx. I thought that I could just get me
> the existing baton. For my purpose (those darn wc_diff_callbacks) I
> know
> what kind of lock was set by the caller. Hrm, I'm reading a course in
> design
> pattern and that doesn't sound like louse coupling to me.
>
> Can one path have multiple batons, i.e. one read baton and another
> write
> baton? I thought that there would only be one?

In the old code there can be more, but there should be just one. (The wc_db
+- has a hashtable mapping absolute paths to access batons)

Most svn_client_*() function calls start by opening an access baton for
writing for the part of the working copy they are interested in (depth
infinity for most recursive calls) and retrieving this baton via the context
will usually work just fine.

    Bert
>
> > What *I* want to see, and I don't know if we have it or not, is
> > something which I could call to "go get me an access baton for PATH,
> > whether you fetch the cached one, or whether you open a new one, I
> > don't care." Maybe we have that already, or maybe it's just a pipe
> > dream.
>
> I haven't found one.

svn_wc_adm_try_probe...() does about that, but it is not very friendly,
because other code has to switch to the same kind of calls then. (It
sometimes receives an access baton, sometimes not.. and access batons are
closed everywhere via pool cleanup).

I think moving to lock once before the major operation will make the
transfer to WC-NG easier. (I don't think we should introduce new access
batons just to make a few places easier).

    Bert

(Mostly working on things beside subversion and on the adm_crawler)

« Previous message in topic | 9 of 11 | Next message in topic »

Messages

Show all messages in topic

Trouble replacing adm_access in libsvn_client/merge.c (merge_file_changed) dannas Daniel Näslund 2009-08-23 11:45:23 PDT
     Re: Trouble replacing adm_access in libsvn_client/merge.c (merge_file_changed) dannas Daniel Näslund 2009-08-24 00:07:28 PDT
         Re: Trouble replacing adm_access in libsvn_client/merge.c (merge_file_changed) julianfoad Julian Foad 2009-08-24 05:19:22 PDT
             Re: Trouble replacing adm_access in libsvn_client/merge.c (merge_file_changed) dannas Daniel Näslund 2009-08-25 05:16:35 PDT
                 Re: Trouble replacing adm_access in libsvn_client/merge.c (merge_file_changed) julianfoad Julian Foad 2009-08-25 05:45:30 PDT
                 RE: Trouble replacing adm_access in libsvn_client/merge.c (merge_file_changed) rhuijben Bert Huijben 2009-08-25 05:45:47 PDT
                     Re: Trouble replacing adm_access in libsvn_client/merge.c (merge_file_changed) hwright Hyrum K. Wright 2009-08-25 05:52:56 PDT
                         Re: Trouble replacing adm_access in libsvn_client/merge.c (merge_file_changed) dannas Daniel Näslund 2009-08-25 06:13:13 PDT
                             RE: Trouble replacing adm_access in libsvn_client/merge.c (merge_file_changed) rhuijben Bert Huijben 2009-08-25 06:22:29 PDT
                             What's up with SVNTreeUnequal: Expected and actual SVN_ROOT_NODE differs dannas Daniel Näslund 2009-08-25 10:29:44 PDT
                                 Zooming in on the cause of test merge_tests failures dannas Daniel Näslund 2009-08-25 12:53:57 PDT
Messages per page: