Philip Martin <firstname.lastname@example.org> writes:
> Ben Collins-Sussman <email@example.com> writes:
> > Hey Philip, I'm glad you're trying to figure out what's up with 'svn
> > diff'. I'm also working on it. I'm seeing a DAV bug in the URL to
> > URL diffing codepath, not just in the wc-to-URL diffing codepath.
> Are you referring to issue 753? I am looking but I may give up, I
> don't know very much about mod_dav_svn :-(
OK, yah, our two bugs are in fact the exact same bug, and I have a
better idea of the problem now.
The bug affects 'svn diff -rX:Y URL'. In the case of 'svn diff -rX:Y
WCPATH', the wcpath gets converted to a URL anyway. It's the same
code path running.
Here's what happened. cmpilato and I added a bunch of new code to
mod_dav_svn/update.c which deals with this magic variable
'dst_path'. [This was done to make switches work in disjointed working
copies] In *theory*, the server is only supposed to receive the
dst_path when the client is doing a switch instead of an update. (In
the case of an update, no dst-path is sent over the wire, and
mod_dav_svn just assumes that dst_path == src_path).
If you look at the client code (libsvn_client/diff.c:1053), the code
segment that sets up the URL-to-URL diffing is invoking a 'switch'
command. That means dst_path will be sent (namely, the 2nd url).
The first Big Problem is in the case of diffing a single file URL;
the mod_dav_svn code assumes that dst_path will *always* be a
directory. Why? Because of the way we implemented 'svn switch'.
Apparently RA->do_switch only works on dirs; svn_client_switch()
either calls RA->do_switch on a directory, or just calls RA->get_file
when switching a single file.
(For the life of me, I can't remember *why* we did it this way. I
thought there was a compelling reason... but RA->do_update seems to
work on single files. Can anyone remember what's up here? Why the
inconsistency? Something to do with dir_delta maybe?)
Anyway, the diff.c code isn't following this practice. It's calling
RA->do_switch on a dir *and* single file. This causes a single file
URL to sent over the network as 'dst_path', and mod_dav_svn chokes on
it, producing bad paths because of the assumption that dst_path must
be a directory.
That's my first pass at the problem; I'll poke more holes soon.
To unsubscribe, e-mail: firstname.lastname@example.org
For additional commands, e-mail: email@example.com
Received on Thu Jun 20 00:44:27 2002