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

Another svn diff thought

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2002-01-29 02:24:40 CET

Hello

Karl's post about diff prompted me to write about something I have
been considering for a while. If this has already been discussed I
apologise, I missed it or didn't understand it!

The two diff editors, -rREV in wc and -rREV1:REV2 in client both use
an RA session like

   SVN_ERR (svn_client__open_ra_session (&session, ra_lib, URL,
                                         NULL, /* this is base_dir */
                                         FALSE, FALSE, auth_baton, pool));

to retrieve revisions from the server. In both cases a null base_dir
parameter is passed because the working copy does not in general match
the requested revision. This avoids a problem when ra_dav uses the
session get_wc_prop callback to retrieve properties from the working
copy. If the revision and working copy have unrelated files, the RA
layer may request properties for a file that does not exist in the
working copy. Passing a null base_dir prevents the RA layer making the
get_wc_prop calls, but also prevents the server sending diffs.

It occurs to me that the answer to this is that the get_wc_prop
callback and the editor need to cooperate. Thus instead of using the
generic get_wc_prop function provided by svn_client__open_ra_session,
we need a get_wc_prop callback that is specific to the editor. While
the editor is processing open_directory, and open_file calls it should
be possible for the get_wc_prop callback to provide properties from
the wc, it is only when processing add_directory and add_file that
there is no corresponding wc file and thus no properties available.

A session with a suitably "intelligent" get_wc_prop callback should
allow svn diff -rREV1:REV2 to obtain REV1 (and -rREV to obtain REV)
via a server diff from the working copy. A further "intelligent"
get_wc_prop callback would allow -rREV1:REV2 to obtain REV2 from REV1,
again via a server diff.

Obviously this does not apply for -rREV1:REV2 URL where there is no
working copy. It doesn't look too complicated though, for those cases
where there is a working copy.

-- 
Philip
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:37:01 2006

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.