On Fri, 2011-01-07 at 15:45 +0530, Prabhu Gnana Sundar wrote:
> Hi Julian,
>
> On Thu, 2011-01-06 at 16:25 +0530, Prabhu Gnana Sundar wrote:
>
> > > Isn't it a layering violation for libsvn_wc to know about libsvn_ra?
> > > Maybe this needs to use callbacks or something, so that all the RA
> > > knowledge remains in libsvn_client.
> > >
> >
> > What you say is correct. :)
> > But since we need to access a file which is not in our text-base. I had
> > to get the ra_session to make use of the repository to fetch the file.
> >
> > Anyway now I am working on this to make use of any function in
> > libsvn_client that would get me an ra_session. But that seems to me like
> > a costly work.
> >
>
> I was trying to make use of some functions from libsvn_client to keep
> the RA knowldege in the libsvn_client. In that course, I ended up in a
> "circular dependency" in the 'build.conf'.
>
> I had to include the "svn_client.h" in the 'subversion/libsvn_wc/diff.c'
> file. So I updated the build.conf file and ran the 'autogen.sh' script,
> there by ending up in *error*.
> I could not find any other way than teaching libsvn_ra to libsvn_wc
> inorder to fetch a file from the repo (like done in the patch). Am very
> glad if you have other suggestions :)
I can't look into this in detail, but I have two thoughts:
1. Ideally, I would expect the structure of the diff code to be
something like:
libsvn_client:
call libsvn_wc to get the WC file;
call libsvn_ra to get the repos file;
call libsvn_diff to compare the two files;
report the results.
So libsvn_wc would not need to read files from the repository.
2. If for some reason the code is structured such that libsvn_wc does
need to fetch a repository file, it should do so via a callback function
provided by libsvn_client, not by calling libsvn_client or libsvn_ra
functions directly. There is already some code somewhere in libsvn_wc
that uses a callback into libsvn_client to fetch a file's text from the
repository. I can't remember where.
- Julian
Received on 2011-01-07 13:17:54 CET